Chapter 12. Node in production: Deploying applications safely

 

This chapter covers

  • Deploying Node applications to your own server
  • Deploying Node applications to cloud providers
  • Managing packages for production
  • Logging
  • Scaling with proxies and cluster

Once you’ve built and tested a Node application, you’ll want to release it. Popular PaaS (platform as a service) providers like Heroku and Nodejitsu make deployment simple, but you can also deploy to private servers. Once your code is out there, you’ll need to cope with unexpected errors, service outages, and bugs, and monitor performance.

This chapter shows you how to safely release and maintain Node programs. It covers privately hosted servers that use Apache and nginx, WebSockets, horizontal scaling, automated deployment, logging, and ways to boost performance.

12.1. Deployment

In this section you’ll learn how to deploy Node applications to popular cloud providers and your own private servers. It’s likely that you’ll only typically use one of these approaches, depending on the requirements of your application or employer, but being familiar with both is instructive. For example, the Git-based workflow employed by Heroku has influenced how people deploy applications to servers they control, and with a bit of knowledge you can set up a server without having to call for help from a DevOps specialist.

12.2. Caching and scaling

12.3. Maintenance

12.4. Further notes on scaling and resiliency

12.5. Summary