Technically Speaking: Node.js

By

image

These days, web apps that function in real-time aren’t a novelty. They’re the standard. Users have come to expect instantaneous results, and to expect live, social components built into their applications. These expectations are met — with increasing ease and power — thanks to a small phenomenon called Node.js.

Node.js (or simply “Node”) is a software system that is used to create fast, scalable websites and applications that can perform wonders in real-time. It enables developers to write Javascript on the server side, instead of the front-end where it traditionally runs. Node allows a program to perform asynchronous input/output processing that minimizes overhead and maximizes scalability. Sounds like gibberish? Okay. In order to dive in to how Node works, let us take a trip to our local deli.

Infinite Lunch

At most corner delis, customers (or, clients) place their sandwich order with the charming guy behind the counter (the server). He makes the sandwich and hands it over. He then starts over with the next customer’s order. This works out well for all parties until the lunchtime rush. If the deli only has one sandwich maker, it’ll be crushed by the traffic — and impatient customers might flee to Burger King.

Node as a lunch chef is a multi-tasking wizard.

Most traditional, basic websites employ this kind of client-server relationship. The client (your browser) asks for and receives information from a server, one piece at a time. Node.js allows for asynchronous input/output processing, meaning it can handle thousands or millions of diverse requests at the same time. In other words, Node as a lunch chef is a multi-tasking wizard, one who can start on the next customer’s sandwich, ring someone up, and prep the next batch of potato salad — all while the first customer’s sandwich is toasting. Every customer can order any kind of sandwich, and they’ll all get their lunch on time. Delicious.

My Answer is Node

Employing server-side Javascript with Node has had serious implications both in business and in the developer community. LinkedIn used it to build its lightweight, much-praised mobile app, and Walmart announced earlier this year that they’ll be powering their mobile apps with Node too. Both Microsoft and eBay have also used the software for internal projects.

But the most interesting uses of Node have come through new startups. Voxer, which essentially turns smartphones into real-time walkie-talkies, uses Node because its low latency can handle the massive amount of data needed for real-time audio. Mockingbird uses Node to allow multiple users to build wireframes simultaneously. Nodejitsu (part of the GA family) offers a cohesive set of cloud management technologies for businesses — essentially, they do the Node for you.

Node, the Places You’ll Go!

Node is a great tool for building something that can really scale.

If you’re just starting out as a developer, Node is a great tool for building something that can really scale. But it is not without its drawbacks. First, Node is immature as a platform. Though it was launched by Ryan Dahl in 2009, it is technically still in preview mode. So while it has a growing, enthusiastic community of users, Node doesn’t have as large a library of modules and frameworks as compared with more established platforms. Also, if you’re building something especially complex — like a series of functions within functions — Node can bring about “callback hell” and be hard to debug.

That said, if you have at least a working knowledge of JavaScript and basic server-side programming, Node can be of great use, and won’t be that hard to learn. The Node Beginner Book is a great resources to get you started.