Node.js, a new open source JavaScript-based server side framework has become a hot new technology for web developers. While still early in its maturity and adoption lifecycle, Node.js recently gained HP/Palm’s endorsement with its inclusion in webOS 2.0. Learn about Node and its future prospects before your developers begin to endorse its use in the enterprise.

From browser to server
While JavaScript has been used in the browser for over a decade, its use as a server side application language has been gaining developer traction, primarily due to Node.js.

Node.js lets web developers write event-driven JavaScript applications that run on Google’s open source V8 JavaScript engine. For instance, Jackalope is a web application built in under 48 hours during the Joyent sponsored Node.js knockout competition. Jackalope provide real time web statistics on mouse movements and clicks on a website and scales with the number of users on a given webpage.

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.

Node.js requires developers write event driven applications. The use of AJAX in modern web applications which utilize JavaScript, an event-based language, provides Node.js with a sufficiently large developer base to draw from. Whether developers have written server side modern web applications in PHP, Ruby, Python, Java, etc., chances are they’ve been exposed to some degree of JavaScript programming at the presentation layer.

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:

Node was an obvious choice for us. We had started to write a JavaScript service framework ourselves, but then Node came out with a great product and a great community. Rather than come out with our own system, we wanted to align behind something that was out there. We are webOS after all, and we’re always looking to align with the Web as a whole. We only innovate when there aren’t standards for us to work with (de facto or otherwise). The node team was also FANTASTIC to work with, and really helped us as we transitioned it to a mobile form factor.

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”.

Payne writes:

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.

While the future of Node.js in the enterprise is not at all guaranteed, its ability to allow less experienced developer to create more scalable applications by leveraging skills they already have with JavaScript, bodes well for the technology.

Follow me on Twitter at SavioRodrigues. I should state: “The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies, or opinions.”