No, not “because I said so.” The best reason to pay attention to node.js is the audience that is paying attention to it. Joe Shaw’s pointer the other day was just the latest in a string of node.js mentions. By now you’ve probably heard that the folks from Heroku recently – as in two weeks ago yesterday – announced experimental support for the project to a shortlist of their users. Less visible are projects such as the Gilt Group funded real-time web analytics project Hummingbird (that link’s courtesy of Jeff Waugh), currently a trending repo on Github, fanout.js – a node based pubsub messaging server (that one’s via Dion Almaer), or others like nodewiki, a wiki built from node and Redis.
What is node.js? For the technical audience, Joyent’s Ryan Dahl’s (the original author) presentation is an excellent place to start. Wikipedia describes Node.js is an evented I/O framework for the V8 JavaScript engine (yes, the one that ships with Chrome), while Dahl’s deck describes it more prosaicly as a “set of bindings to the V8 javascript VM” that allows developers “to script programs that do I/O in javascript.” Conceptually, it’s not dissimilar to EventMachine or Twisted, but node.js takes the concept further as Heroku’s Adam Wiggins covers here.
A few reasons you should be paying attention.
- It’s Opinionated Software:
Implicit in node is a fundamental rejection of traditional I/O. It’s pushing an asynchronous agenda with its event loops, based on the assumption that concurrency cannot be achieved with a thread per connection. Having just recently suffered through a Daring Fireball induced meltdown of RedMonk.com as Apache spawned dozens of threads, each waiting for the connections to complete, I’m sympathetic to this perspective. While I’m skeptical of the claim that the reasons the approach isn’t more common are predominantly cultural and instrastructural – debugging large asynchronous applications would seem to be a real challenge – the benefits clearly outweigh the costs for a large number of developers. I also find node’s architectural decision to restrict multiple thread access to C bindings rather than Javascript – throttling access to experts, at least in theory – interesting. - It’s Fast:
Speed is a feature, remember. And by all accounts, node.js has this one in spades. Even as we’re told in Ryan’s presentation that it’s a “silly benchmark” that should be taken with a “grain of salt,” node’s ability to field more requests per second than nginx – even with much higher memory consumption – is startling. Because nginx itself is not slow. The focus on performance, at a very fundamental level, is clearly paying dividends. - It’s Javascript:
Well, 15% of it is, anyway. And from a developer’s perspective, the engine is Javascript as are the standard libraries. The evolution of people’s thinking with respect to Javascript has been interesting to watch. Beyond the hype around its central role in the Ajax browser based application revolution, it’s become if anything more important over time. It’s the second most common language on Github (next to Ruby), and is being often portrayed, alongside HTML5, as the last, best hope to save us from a future of proprietary web interfaces. E.g. Gordon, the Flash runtime written in Javascript. The really interesting question to me, however, is whether or not we’re going to see more server-side applications like node.js written partially or totally in the language. If Ted Leung’s correct, and I certainly trust his judgment, the answer to that question is yes. - It’s Aimed at Important Problems:
Designing scalable applications is hard. But the speed at which node.js applications can be built, whether that’s messaging/proxy/web/etc servers or user facing applications like wikis, is impressive. It would be inaccurate to say that it trivalizes developemnt, and I suspect that as applications built on node grow in complexity the fundamentally different architectural approach it takes will introduce as yet unanticipated problems, but the class of problems that node.js is aimed at are important. Scalability isn’t just a challenge for Facebook or Twitter, nor is performance solely the province of Google. Those qualities are going to be at a premium for all applications going forward. - It’s Community Supported:
The visibility of the project we covered above; here are just the Twitter pointers to the Github repo. But just as interesting has been the support. The project is 70 contributors strong already, and the contributions as depicted in the graph above are non-trivial in their substance. And at 174 forks, node.js is only 59 behind jquery. The project is popular, in other words, and with most of it MIT/BSD licensed, the barriers to adoption and contribution are few.


Node.js is good, good stuff. I’ve been banging on about it to anyone who’ll listen in SD for a while now.
Node, by virtue of its JavaScript nature, is also ripe for stepping into the role of dual sided templating, the notion that a template or MVC engine should be able to run on either side of the client/server split. If you have mostly-static content with some items that want to be updated in real time, the hope is that a good dual sided templating implementation will be closer to dealing with a single system, rather than separate front and back end renderers. To fill this need, there’s tmpvar’s node-jsdom, and various accompanying parsers such as node-htmlparse. Jaxer and env-js are the notable pre-existing examples of this kind of technology.
The ability for servers to understand and process HTML & DOM like a browser is also necessary for page scraping or page automation, otherwise you end up reliant upon the browser to understand the page and its content.
My own node.js project is an asynchronous HTML transport; its called Pipe Layer, and source is at http://cgit.voodoowarez.com/pipe-layer/
Last, I want to mention the node community. #node.js is by far one of the most active channels I idle on, and its a testament to how impassioned node makes people. The hard numbers like forks and commits certainly have their place, but it hasnt been since the hayday of #managed-dbus that I’ve seen so many people earnestly having a good time and loving being a part of the community. I cant quantify them, but the soft metrics are really quite a compelling story on their own.
Permit me to part with a recent twitter favorite, c/o technoweenie:
OH: “like everything in node, it has to be at least gigabit/sec throughput. otherwise it’s officially a bug”
i appreciate node’s simple and direct api too – i mean this in a good way – totally under-engineered, fantastic.
For those who like compiled and type checked yet losing no javascriptyness, have a look at haXe (http://www.haxe.org) , and then my hxNode project (http:/github.com/blackdog66/hxnode) which provides haXe type signatures for the node api.
allow me to cite the nginx creator, saying v8 would be a really bad fit for nginx:
http://groups.google.com/group/nodejs/browse_thread/thread/575afc92907c0f3e
@kilimanjaro; perhaps you failed to read point #1. point #1 is that node.js is opinionated software, and its opinion is that the way you write software (synchronously) is fundamentally broken and incorrect. stick with php, node’s not for everyone, and you clearly dont seem to have any pallet for its particular opinions and flavors.
for those of us who’ve been tracking C10K problem since 2006, node.js is a fresh breath of life.
amen, excuse me. there are plenty of places where php is not broken and works just fine.
Anyone else roll there eyes whenever they read that something is “opinionated software”. Isn’t all software opinionated? Any time you write software, especially a library to be used in a more general purpose, you’re basically stating your opinion of “this is the way I think we should do this.”
Free Node.js eBook:
http://www.heronote.com/files/Node.js.htm
Hi Stephen,
It’s really a good introduction to node.js. I use it daily and it’s a awesome framework to use on server side. What I really love in node.js : it’s Javascript ! One unique language from server to client, allow efficiency, fast dev, money
I’m a French node.js addict, you could read my blog post about Node.js here : http://www.it-wars.com/categorie8/dev ! Feel free to use Google Trans widget and leave comments !
Regards,
Vincent
I’m planning to move to an EC2 to start deploying Node.js , it is possible to run PHP ,ruby and NodeJS ?
It’s interesting, just 9 months or so down the line, quite how it is continuing to gather momentum. So many benefits in tooling and skills for people developing ajax applications. The number of new libraries and tools for node seems to be growing every week.
That should, of course, be 19 months!
If you want to build apps using node, I’ve been working on a cloud app framework built on top of Node.js called nCombo. Please check it out: http://ncombo.com