Why Node.js is a Great New Technology for the Cloud

Node.js logo- why node.jsAs with many technologists, I have developed and managed teams that have worked on various languages from interpreted to compiled. A few years back I jumped on the client-side Javascript web programming bandwagon due to new and emerging JavaScript frameworks like jQuery and Yahoo YUI. I really enjoyed the power of these frameworks and the way they allowed for easy manipulation of the HTML DOM, which is always an important capability when creating web based applications.

Most recently, I have been playing with Node.js which is essentially an open source server-side event-driven JavaScript environment that implements Google’s V8 JavaScript engine. So what is so great about Node and why would I use it in the cloud? First and foremost it is JavaScript, which allows front-end web developers who are familiar with writing JavaScript to utilize good old JavaScript on the server in a very similar fashion to writing client-side JavaScript. I remember in college one of my Computer Science professors saying, “Good programmers can program in any language because once you know how to program the rest is just syntax.” I still think this is true; however it is so much nicer when you don’t have to go through a syntax learning curve.

In addition to being JavaScript based, the other great thing about Node is it uses an evented model and it is totally non-blocking. This means that Node can handle simultaneous requests exceptionally well because it never gets in a wait state that takes up resources.  Another way to put it, an application on Node.js will probably out perform an application on most any other type of dynamic application server. Although Node is fast, performance will depend on a whole host of factors, starting with the specifics of what you are doing in an application. 

Finally, Node is very well suited for distributed applications that need to be highly scalable and work across multiple machines. This is an important attribute when scalability and availability are key concerns, as with many SaaS applications today. To better understand the value of the event-driven model that Node.js uses, check out the great analogies in this post: “Node.js, Doctor’s Offices and Fast Food Restaurants – Understanding Event-driven Programming”.

So what’s the downside? It is still a fairly young project that is being quickly iterated, and as a result has quite a few issues/bugs. As I write this post, the latest release is version v0.5.0. The project does, however, have some velocity and there are already 2500+ repositories for Node.js related code on github. Thus, if you are a technologist who enjoys playing with the latest and greatest, and the buzz around Node gets you excited, then you shouldn’t hesitate to install it and start coding. Better yet, why not contribute back to the community and help shape the project going forward?

In a future post, I will cover some code examples using Node.js and discuss in detail some more specific use cases that Node is a great fit for. In the meantime, if you want to learn more about Node follow fellow HP employee Tim Caswell’s blog: How To Node.

Node.js and graphical logo are trademarks of Joyent, Inc.