Express 4 in production

Express 4 just got released thanks to the great work of @defunctzombie and the expressjs team.

The main change is, that Express does not have connect as a dependency anymore, which means that the bundled middlewares are no longer available in the express module. These should be installed and listed in your apps package.json. This allows faster updates of the middlewares without affecting the release cycles of express.

Migrating

The things you should pay attention to:

  • app.configure(): removed, no longer available
  • app.router: removed, no need to manually do it
  • express.createServer(): removed, use express()
  • public API for the Router

It took only a day to change to new version of express, in a medium size application like ours.

For more, please check the migrating guidelines and the list of new features.

In production

We have deployed to only one API node for testing purposes (after running it several days on our staging environment) just to see how it performs under heavy load. We are serving millions of requests every day so even in this setup the node with the new version still receives lots of requests.

In short: hats off! All of our metrics improved on the API node using the new version of Express:

  • response times dropped by 20%
  • memory consumption dropped by 10%

Conclusion

As you can see, the effort you have to put in to migrate the new version is very little compared to the performance gains. If you have at least integration tests to check if everything is okay, you should definitely start using the new version.

Express 4 just got released thanks to the great work of @defunctzombie and the expressjs team.The main change is, that Express does not have connect as a dependency anymore, which means that the bundled middlewares are no longer available in the express module. These should be installed and listed…

Read More

KANO

This weekend I put together my first open source project called Kano. You can learn more about the project by visiting here or visiting my github https://github.com/erictherobot/kano

This weekend I put together my first open source project called Kano. You can learn more about the project by visiting here or visiting my github https://github.com/erictherobot/kano…

Read More

Shutting of my LAMP and turning on my MEAN...stack

I've been a PHP guy for a long time. Like all computer languages, I've learned through trial and error. PHP just sort of fell on me and I hung out with it because it was well documented, open source, most hosting companies supported it, most of my friends used it. For me, PHP was understood.

PHP Frameworks. Over the years I started thinking of finding a silver bullet. Something that I could quickly understand and hit the ground running and PHP Frameworks was that silver bullet for me. In the past I've tried Yii, Codeigniter, FuelPHP, CakePHP, Lithium, Kohana, Laravel, PhalconPHP, and about 30 more that are worth mentioning, I'm just not going to because from here on out I am moving over to a MEAN (Mongo + ExpressJS + AngularJS + NodeJS) stack... well actually for me at the moment I'm skipping AngularJS and just using a MEN Stack.

What generally takes me one week to do in PHP is now taking me two hours in NodeJS and it is soooo much lighter and beautiful. Time saver! Lightbulbs! Inspiration! New Chapter!

I still love you PHP, but I'm shutting down the LAMP stack and getting seriously MEAN!

I've been a PHP guy for a long time. Like all computer languages, I've learned through trial and error. PHP just sort of fell on me and I hung out with it because it was well documented, open source, most hosting companies supported it, most of my friends used it.…

Read More