Feeds

The Node Ahead: JavaScript leaps from browser into future

Google V8 engine spawns server world doppelgänger

SANS - Survey on application security programs

All the way to the end

In the beginning, Ryan Dahl didn't see node as a platform for "end" developers, coders building end-user applications. But he was proven wrong almost immediately. "We thought Node was just kinda about opening TCP connections, a kind of low-level thing, something you do low down in the operating system," he says. "But people starting building websites with it."

To tap this interest, Joyent built no.de, a means of using Node as a service, through a web browser. For LearnBoost's Rauch, node is – more so than other systems – tailor-made for this sort of platform-as-a-service (PaaS). "Node is really well-suited for the cloud," he says. "Running a node server uses few resources, but it's able to handle really large numbers of users."

With no.de, you essentially build a git repository with a Node server, and you push it to a virtual machine running on Joyent's infrastructure cloud. It starts up the daemon and makes sure the daemon keeps running. The underpinnings of the service are also included with SDC6, so that third parties can run their own no.de.

According to Joyent's Tom Hughes-Croucher, when benchmarking its Node setup the company has set up a 'hello world' server that can handle 8,000 requests per second from a single CPU core. "It's just saying 'hello world,'" he says. "But still." He says that some apps have been known to accomodate 15,000 concurrent users from a single server.

Because it's so efficient, Hughes-Croucher believes Node is on the verge of hitting it very big among end developers. But as Ryan Dahl points out, this is still a niche platform. "Most people are working on asp or Java or PHP," he says. "They're not looking for new platforms. They've got their company. They will use the next product from Microsoft, but they're not in search of a new runtime to use."

What's more, the concepts are very different from what developers expect in the multithreaded world. "You're forced into this non-blocking style," Dahl says. "Anytime you want to talk to this remote back end or something, you have to give a callback. You can't say 'Database give me the result and then in the next line use the result.' You have to somehow have a callback, so you get indented a bit or you jump into a different function.

"It can be very painful for people when you have to do a lot of things in serial – a and then b and then c and then d. In a typical blocking language, you would just do a, b, c, and d, one after another, each on its own line. In node, you have to jump into different functions for each of those. You have to request that the database send you some data, go back to the event loop, handle other requests, get the response, call some function that sends off the next request, go back to the event loop, handle more requests."

The flip side is that the platform should feel quite confortable to those who use JavaScript on the front end, who have little history on the server side. "For client-side people, the non-blocking style is all pretty natural. They wouldn't think about it another way."

Node Knockout code

Node Knockout code

The overarching point, however, is that Node is optimal for the new breed of real-time web apps. Yes, there are other means of building real-time tools, but Node lets you build real-time tools on the same platform that runs the rest of your site. Famously, Facebook's chat server was built with Erlang, but as Guillermo Rauch points out, the rest of Facebook wasn't.

"If you have a traditional stack with, say, PHP and Apache, doing real time is almost impossible," Rauch says. "You always have to offload your real-time communications to a different webserver or a specialized webserver you write yourself. Facebook wrote an Erlang server just for Facebook chat and they made it talk to their PHP stack. With Node, all those infrastructure complications are completely removed. You can write your real-time stack right in the same codebase as your normal web application, your database-management layer, and everything else."

So Node is neither The New Rails nor The New PHP. It's something else entirely. ®

3 Big data security analytics techniques

More from The Register

next story
OpenBSD founder wants to bin buggy OpenSSL library, launches fork
One Heartbleed vuln was too many for Theo de Raadt
Got Windows 8.1 Update yet? Get ready for YET ANOTHER ONE – rumor
Leaker claims big release due this fall as Microsoft herds us into the CLOUD
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Ubuntu 14.04 LTS: Great changes, but sssh don't mention the...
Why HELLO Amazon! You weren't here last time
Patch iOS, OS X now: PDFs, JPEGs, URLs, web pages can pwn your kit
Plus: iThings and desktops at risk of NEW SSL attack flaw
Next Windows obsolescence panic is 450 days from … NOW!
The clock is ticking louder for Windows Server 2003 R2 users
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
Apple inaugurates free OS X beta program for world+dog
Prerelease software now open to anyone, not just developers – as long as you keep quiet
prev story

Whitepapers

Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Mainstay ROI - Does application security pay?
In this whitepaper learn how you and your enterprise might benefit from better software security.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.