Feeds

The Node Ahead: JavaScript leaps from browser into future

Google V8 engine spawns server world doppelgänger

Choosing a cloud hosting partner with confidence

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

Business security measures using SSL

More from The Register

next story
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.