What this book covers
Chapter 1, Appreciating Node, goes into the thinking behind Node.js, helping you to think clearly about what Node.js is good at, what it is less good at, and how to leverage Node.js to solve real-world challenges.
Chapter 2, Installing and Virtualizing Node Servers, teaches you how to create a basic Node.js application and get it running on a server. You will also learn how to do the same thing on certain popular cloud-hosting providers, such as DigitalOcean and Heroku, additionally learning how to use Docker to create lightweight, easily replicable, virtual machines.
Chapter 3, Scaling Node, explores both vertical and horizontal scaling techniques. You will learn how to use the cluster module to maximize Node's effectiveness on a single server and how to coordinate many distributed Node.js servers to handle increasing network traffic, learning about Nginx load balancing, setting up proxies using message queues, and coordinating interprocess communication in the process.
Chapter 4, Managing Memory and Space, demonstrates how good engineering practices never go out of style. We start with a discussion of microservices, introducing general techniques to design systems composed of small, focused, communicating processes. Next comes a deep exploration of how to optimize JavaScript, particularly for the V8 compiler. Beginning with several examples of memory-efficient ways to store and retrieve event data in Redis, we look at caching strategies, session management, and using CDNs to reduce server load.
Chapter 5, Monitoring Applications, explains strategies to effectively monitor your application once it has been deployed. Examples of using various third-party monitoring tools are included as well as examples outlining how you can build your own custom system sampling and logging modules. Finally, we look at debugging techniques, examining several tools and strategies to help you find and prevent runtime bottlenecks.
Chapter 6, Building and Testing, introduces certain considerations when creating a build pipeline for your application. Full examples of using Gulp, Browserify, and npm to create build tools are provided as well as information on testing with Mocha, mocking with Sinon, and using PhantomJS for headless browser testing.
Chapter 7, Deploying and Maintaining, walks you through the entire deployment pipleline, from setting up virtualized development environments to building continuous integration into your workflow. You will learn about using GitHub webhooks and Vagrant and using Jenkins to automate your deployment process. Additionally, the npm package manager will be fully dissected, and strategies for dependency management will be discussed.