Preface

Node.js is a fantastic way to begin your journey in building scalable applications. As it was built using non-blocking I/O, it can serve more concurrent requests than a blocking server, such as Apache, which can be achieved through asynchronous events. When a function call blocks, Node.js will reply via a callback. The great foundation of Node.js has led to many libraries that allow you to build a scalable application.

Redis is another vital building block of scalable applications. While Redis is not Node.js-specific, it offers great support. It fills up the need of shared memory between web servers that scalable applications require. Redis also has bindings in some other frameworks, which will be covered in this book. This prevents us from falling into the trap of needing five different data stores for five different frameworks, which only adds to the complexity of our environment and system administration overhead.

Building Scalable Apps with Redis and Node.js combines both of these essential building blocks into one comprehensive and straightforward project guide. It shows you how to build an application from scratch, straight from having an idea all the way to deploying it. The first seven chapters show you a specific problem or issue you might come across during development. The following chapter will cover some best practices when developing. The final two chapters will cover the deployment of your site to Amazon Web Services. These particular chapters will also show you how you can troubleshoot and debug your application. Although the book covers one project, the chapters are organized in such a way that you can jump straight into them, to be shown how to create a certain feature or learn a specific topic. It is recommended, though, that you work from the beginning of the book. You will find that because we will be building an entire site, the code from one chapter will have relevance to another. However, most code samples will be usable in other contexts.

On a personal note, I will say that using JavaScript for backend development is refreshing. I readily admit that when I first heard about Node.js and the idea of using JavaScript in the backend, my initial reaction was "Why would I want to do that?" I have run the gamut of server-side languages (PHP to Ruby and Python, and C# .NET). I have worked with many different web servers (Apache, IIS, built-in servers, Unicorn, Gunicorn, and so on). Throw in the fact that all modern web applications require some JavaScript and you start to build mental barriers, which is especially true if the syntax is different (consider comparing Ruby to JavaScript, for example). Node.js allows you to remain in the JavaScript mode, utilizing the same design patterns and even the same tools. You will also be glad to hear there is not much to set up. You build your Node.js app and then you simply run it. All these reasons are exactly why Node.js is one of the best web application/serving frameworks and why I, personally, love to use it.