This is a short, concise book that explains how Node.js gives solution to support thousands of asynchronous requests through its event-loop mechanism and core functionality. In chapters 1 to 5, we can find the structure of a basic, raw HTTP Node.js server, what request callbacks mean, and how to organize these callbacks to obtain clarity and consistence. We can also find basic utility functionality dealing with IP addresses, clusters and child processes, and how to encrypt public and private application keys.
In chapters 6 and 7, this book explains briefly the most popular third party Node.js modules from which we can actually use for building useful web applications and services. We can briefly learn how to setup database connections, operations and queries, ho to build a basic, managed HTTP server with the Expressjs module for web page rendering; and how to work with WebSockets, the new feature found in recent version of web browsers for persistent connection with the server. Final chapter 8 explains to how to publish our own Node.js modules to share with the community.
What I liked most of Node: Up and Running is that it offers suggestions to avoid pitfalls when dealing with callback chaining, why a ‘try…catch’ block doesn’t catch an asynchronous exception and how to distribute the work load on several CPUs when possible (chapter 3). Programming good callback chaining and monitoring mechanisms is important to improve readability and maintainability, and to avoid possible hang-out conditions due that certain I/O events may take long time to be processed, like downloading a file and querying a database.
However, if the reader really wants to build a web server he/she should look for more information about Node.js frameworks like Expressjs, Restify and Mojito since this book only introduces the basics. But, Node: Up and Running opens the doors to understand how a Node.js HTTP server works so the readier will be able to understand the vocabulary, the mechanics and the good practices offered by each module and framework.
Finally, I want to say that there’s a difficulty to imitate some code examples because the directory structure was not specified. You’ll notice this when reading the Twitter App on chapter 2. That may change if O’Reilly Media publish the accompanying source code or a book update. Meanwhile, you can read the errata section at the publishers web site.
Note: This review is in exchange for the O'Reilly Bloggers Review Program (http://oreilly.com/bloggers).