I’m about to start a project with Node, Express and Mongo, but there is one important question that I have to solve first.
Say I have a running application. Sooner or later, I will code again and want to deploy changes. Until now, I’ve worked in development mode only, so it’s not a problem to do a ^C and restart the server.
How about in the production ? Obviously I can’t just trash the server and all the users at once. Is there any way to deploy changes without interrupting the service ?
I’ve looked into systems like upstart and similar, but it doesn’t solve the problem (or did I miss anything?). I’m currently considering building a kind of failover, but someone must have done that before me…
Well, I’ll probably go with a reverse proxy like nginx: low memory footprint, able to handle lots of simultaneous connections and supports failover when I’ll finally have more than one server.
With this nginx reverse proxy, I can start a new Node process with the updated sources, have nginx switch to the new Node and trash the old version.
This will also allow me to keep previous version of the app on the server, just in case the new version crashes too early…
Links:
http://nginx.org/en/docs/control.html