From browser to server
Scalable applications from less experienced developers
As an IT decision maker, Node.js holds the promise of enabling less experienced, potentially lower cost, developers to create more scalable web applications than they can build today with existing skills and languages.
Node.js attempts to achieve this goal through its asynchronous nature as described on the Node.js website:
Thread-based networking is relatively inefficient and very difficult to use….Node will show much better memory efficiency under high-loads than systems which allocate 2mb thread stacks for each connection. Furthermore, users of Node are free from worries of dead-locking the process–there are no locks. Almost no function in Node directly performs I/O, so the process never blocks. Because nothing blocks, less-than-expert programmers are able to develop fast systems.
The large developer base and growing community around Node.js were key factors in HP/Palm’s decision to utilize Node.js in its webOS 2.0 platform. Dion Almaer, Director of Developer Relations at Palm, explained in an email:
Scaling applications – a reality check
Alex Payne, a developer at BankSimple, however provides a reality check of Node.js’ scaling aspirations. Payne explains the technical challenges between, as he calls it, “Scaling in the Small” versus “Scaling in the Large”.
The power of today’s hardware is such that, for example, you can build a web application that supports thousands of users using one of the slowest available programming languages, brutally inefficient datastore access and storage patterns, zero caching, no sensible distribution of work, no attention to locality, etc. etc. Basically, you can apply every available anti-pattern and still come out the other end with a workable system, simply because the hardware can move faster than your bad decision-making
To further scale an application like the one Payne describes above, he suggest developers must only select a technology that with “slightly better” performance characteristics than the currently technology. On the other hand, Payne explains, a system with significant scale requirements has no single magic bullet technology choice. Payne explains:
When you’re operating at scale, pushing the needle means a complex, coordinated dance of well-applied technologies, development techniques, statistical analyses, intra-organizational communication, judicious engineering management, speedy and reliable operationalization of hardware and software, vigilant monitoring, and so forth. Scaling is hard. So hard, in fact, that the ability to scale is a deep competitive advantage of the sort that you can’t simply go out and download, copy, purchase, or steal.
Payne sees Node.js being a very attractive technology choice for developers dealing with “Scaling in the Small” scenarios. Other technologies such as Java or Scala, and a host of related architecture decisions are better suited for operating at high scale in Payne’s opinion.
Node.js in your PaaS of choice
For most enterprises, a fairly large portion of their applications could operate under the “small scale” limitation, opening the door for Node.js usage.
However, it’s important to note that, outside of the .NET market, modern enterprise web applications are largely Java based. Dynamic scripting languages haven’t crossed the mainstream enterprise chasm to any significant degree.
Maybe Node.js, like other dynamic scripting languages before it, won’t play a major role in your datacenter, but it could still impact your IT portfolio – through your platform as a service (PaaS) provider of choice. Node.js is an appropriate technology choice for web applications that need the elastic scale characteristics a cloud provides.
Joyent, a startup that employs Node.js creator Ryan Dahl, and Heroku, a cloud service provider, are both offering Node.js runtime environments in the cloud. It’s also within the realm of possibility that Google would support Node.js on its PaaS offering, Google App Engine (GAE). This decision may be accelerated by Google’s decisions in the Java ecosystem.