20 of 22 people found the following review helpful
This is the node.js book I wish I read a year ago!,
This review is from: Sams Teach Yourself Node.js in 24 Hours (Paperback)
Of course, I couldn't. It didn't exist a year ago, when I decided to adopt node.js for a medium-sized commercial web application with lots of moving parts and an insanely short runway. A client of long standing had already invested more than a decade's worth of R&D into a specialized machine learning engine written in C++ running on small clusters. This wasn't their whole secret sauce, but it was the tomato in their marinara. An opportunity to apply the engine to much larger datasets - including some near real-time components - created a window of opportunity. But they would need to move fast. They would need to scale dynamically in a private cloud; the computations would be "highly parallel and adaptively coordinated;" and they needed a web interface to support regional offices on three continents. Oh, and they wanted a ReSTful API to help the the home office develop new applications on the infrastructure. And it had to be operational in one month.
None of the web frameworks I had worked with in the past really seemed like a good fit to both features and schedule. I needed a flexible kit which would allow me to quickly implement custom servers and clients and integrate cleanly with database-driven webapps and message queues. I'd heard some of the hype about node.js and thought that it was probably mostly that...hype. Well it turns out that node.js was exactly what I needed to do all this and more and deliver my project on time.
Now, approaching the the end of 2012, using node.js in this scenario seems almost routine. It was much less so just a year earlier. Buzz outweighed books about node.js then. There was so much to learn. The entire node.js ecosystem was evolving rapidly, some might say fanatically. Documentation was typically out of date by the time it was written. Today, the node.js community is just as active, but the technology and the community are maturing ably to manage the growth. But you still need to get started. Lucky for you, George Ornbo has written this wonderful book. You'll get going fast and that will free up your gray matter to focus on the parts of your application which are unique to your business.
Teach Yourself Node.js in 24 Hours is an ambitious project. Just look at any of the other node.js books available now and notice how many pages you have to read to get beyond the metaphorical "hello world" stage and into the stuff you can really use. George Ornbo gets right to the point and writes with the focus of someone who gets projects done and meets deadlines. I had to learn most of what's in this book the hard way, and I will now try to summarize its many strengths - and a few weaknesses - from the perspective of a newcomer to node.js.
The authors of some books on node.js spend a lot of ink to proselytize. Not Ornbo. Despite what you may have heard, node.js does not cause cancer. Neither does it cure cancer. Ornbo briefly acknowledges the variety of opinions surrounding node.js and immediately gets on with the work at hand, starting with a clear articulation of the kinds of problems node.js was designed to solve. Next!
The first half of the book is very HTTP-centric, which is not unexpected but tells only part of the story. The second half of the book illuminates the broader scope and power of the kit. And while we are on the topic of HTTP, it is helpful if the reader has at least a passing familiarity with jQuery. Ornbo takes time to describe HTTP client-server sessions and HTTP verbs, which one hopes are already familiar to the reader. This is significant because some popular web frameworks go out of their way to hide HTTP from the web developer.
One of the distinguishing features of node.js is that it give you wrappers around network sockets which are abstract enough to accelerate your development yet thin enough to be transparent and flexible. The book does a nice job of highlighting this balance which made node.js perfect for my project.
The book has good sections on deploying your node.js webapps, but Ornbo seems to downplay running node.js behind proxies. This seems like a missed opportunity. Most serious deployments will need at least one layer of proxying, and even a Wikipedia reference would have been useful for developers who are truly new to the game.
A couple of the 24 hours focus on Express, the dominant web framework for node.js. Express is relatively light compared to the web frameworks many readers already know. The purpose of Express is to handle HTTP requests, cookies, sessions and to provide hooks for middelware. Note the absence of a baked-in MVC model. So getting past the basics with Express might be a bit challenging for people coming from MVC frameworks. That said, a later chapter is devoted entirely to Backbone.js as a means to provide models and views. All of the examples in the book use Express 2.5.4. Meanwhile, Express 3.0 has been released and includes significant breaking changes for all Express webapps. Fortunately, Ornbo uses node's package.json mechanism to specify dependencies to be downloaded on the fly, and the examples just work. That's really nice.
Hour 8 strains to do justice to the important topic of persistence, using the excellent mongoose connector for MongoDB. Curiously, on the heels of a length discussion of webapps, there is no mention of sticky sessions. Ornbo tries gamely within the confines fo the 24 Hours format to illustrate how easily node.js works with databases. I suggest you spend some time exploring the node.js modules for your favorite data stores. I laughed pretty hard at what appears to be a good-natured pun on join-less NoSQL stores: "MongoDB structures data around the idea of documents. This is a little disjointing at first..." ROTFL, thanks. On a serious note, I hope the next edition will include specific references to avoiding user-data injection attacks. Everyone likes to talk and nod knowingly about "SQL injection attacks." Too few do anything. Hour 8 also makes use of Twitter Bootstrap 1.4; readers take note that Bootstrap 2.1 is current as of this review.
Hour 9 is a short but excellent hour on debugging tools for node.js. This is an unique feature and sets this book apart.
Learn to use the debugger and inspector! They will save you a lot of time. This chapter is worth the cost of the book many times over. Hour 10 is about testing, and it's long. The examples demonstrate some of the test frameworks commonly used with node.js. To get good with these tools, you really need to practice. You test all the time, right? I thought so.
An extraordinary and very practical feature of the book is the introduction of two fairly advanced topics not typically found in a crash course on node.js. These are socket.io, the de facto standard implementation of WebSockets for node.js and Backbone.js as mentioned above. Ornbo's skill as a mentor shines through in the clear, concise introduction to the thicket that is WebSockets.
JSON APIs are the topic of Hour 15. The focus is on passing JSON data over HTTP connections. Admittedly, this probably is the most common kind, but any connection will do! Node.js makes it ridiculously easy to create custom client-server pairs interacting via JSON APIs and I am biased by my very good experience with node.js experience in this area.
No introduction to node.js would be complete without some discussion of the node.js API itself. Hours 16 through 20 represent a vital subset of the node.js API. After mastering these five chapters you will be in a strong position to begin applying node.js patterns to your application development. In some sense, this is where you become a true node.js user as you use the node.js API to interact in a non-blocking way with external processes and streams. This is a big part of the node.js mantra.
Hour 22 provides a wealth of valuable detail on creating and distributing your own node.js modules, and Ornbo provides the best explanation of the process I've seen yet. This is a great chapter. Even if you do not plan to distribute your own modules, this chapter will help you use other people's modules.
Five stars for relevance. Five stars for ambition. Four stars for execution.
Round up to five stars.
Sort: Oldest first | Newest first
Showing 1-3 of 3 posts in this discussion
Initial post: Jan 31, 2013 9:16:32 AM PST
Michael Caudy says:
Thank you for this very complete and very helpful review. There are now quite a lot of books on node.js, and this review help to identify this book as a good one to focus on.
Posted on Feb 6, 2013 1:51:42 PM PST
[Deleted by the author on Feb 6, 2013 1:52:20 PM PST]
Posted on Jul 24, 2013 4:12:37 PM PDT
Dominick G says:
Phenomenal write-up/review. I'm going down the stack from the Front-End world, and Node.js is looking to be in my future. This book is now #1 on my resources list.
‹ Previous 1 Next ›