Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

The rise of Node.js: JavaScript graduates to the server

Excitement about Node.js is on the rise, but beware its limits

  • Print
  • Feedback

Page 2 of 3

Node.js is no panacea
Although Node.js is generating a lot of positive buzz, not everyone is sold on it. Ted Dziuba, a senior technical staff member at eBay, has posted a profanity-laced blog in which he declares, "Node.js is cancer." In the blog, he calls it a "scalability disaster waiting to happen." He also argues a server-side framework should not be written in JavaScript and says Node.js disobeys the Unix way.

"I got into most of the detail on my blog, but I believe that JavaScript is a bad server-side language because it was never designed to be a server-side language," Dziuba says. "Because JavaScript has always been client-side, browser implementers assume its use is pretty lightweight. For example, it was only in September that a Node.js server-side process could allocate more than 1GB of memory, because of limits in Google's V8 JavaScript engine."

Node.js creator Dahl acknowledges Dziuba's concerns, but says they are not mainstream: "This person makes complaints about how CPU- bound tasks can block a process -- which is true. Most servers we see are I/O-bound -- not calculating numbers in a tight loop -- so they do not hit this problem. If there is a CPU-bound part of a server, we provide a number of methods for running it in parallel -- which [Dziuba] does not consider (for example, a child_process.fork). It certainly is not a scalability disaster waiting to happen." Dahl cites the smartphone application builder Voxer, which runs hundreds of Node processes to do VoIP, processing thousands of parallel processes.

Node.js, says IDC analyst Al Hilwa, has strengths in Web applications that follow an event-driven model: "The asynchronous nature of the language and its similarity to JavaScript, which is of course not Java, are the key assets making it much easier to express concurrency in the application." But he adds there is a big gap between developers who can use JavaScript at the basic level and those sufficiently skilled enough to build complex applications, such as what Node.js requires. "This situation is improving and the JavaScript syntax is being more broadly adopted by many tools and runtimes, but it would be a mistake to assume that any JavaScript developer is sufficiently skilled with Node.js to hit the ground running in a project."

Whereas Dahl sees Node.js as a Java replacement on servers, others disagree. "The short answer is no, we don't see Node.js displacing PHP or Java," says Solomon Hykes, CEO of DotCloud, which offers a cloud computing platform that supports Node.js. "But we're seeing two very important trends: First, the landscape of server-side languages and frameworks is increasingly fragmented -- and applications increasingly need to combine several of them to be successful. So we're going to see more of Java and Node.js, more of PHP plus Node.js, for example, all working together in the same application."

Where Node.js is headed
The developers of Node.js hope to have a stable 0.7 release of the platform ready by March. It will support isolates, a type of parallel JavaScript thread. This enables shared memory between isolates in add-ons and allows for advanced optimization techniques such as rendering multiple parts of a page in parallel, Dahl says.


  • Print
  • Feedback

Resources