JavaScript is the New Black - Why Node.js is Going to Rock Your World

Tom Croucher (Uber)
Location: New York West
Average rating: ****.
(4.35, 17 ratings)

Node.js is a highly concurrent JavaScript server written on top of the V8 JavaScript runtime. This is awesome for a number of reasons. Firstly Node.js has re-architected some of the core module of V8 to create a server implementation that is non-blocking (similar to other event driven frameworks like Twisted). Event driven architectures are a natural fit for JavaScript developers because it’s already how the browser works. By using an event driven framework Node is not only intuitive to use but also highly scalable. Tests have shown Node instances running tens of thousands of simultaneous users.

This session will explore the architectural basics of Node.js and how it’s different from blocking server implementations such as PHP, Rail or Java Servlets. We’ll explore some basic examples of creating a simple server, dealing with HTTP requests, etc.

The bigger question is once we have this awesome programming environment, what do we do with it? Node already has a really vibrant collection of modules which provide a range of functionality. Demystifying what’s available is pretty important to actually getting stuff done with Node. Since Node itself is very low level, lot’s of things people expect in web servers aren’t automatically there (for example, request routing). In order to help ease people into using Node this session will look at a range of the best modules for Node.js.

There are many approaches to programming in this environment, from Rails and Django clones, to alternative models that even throw away MVC. One of the most interesting is the work from the YUI (Yahoo! User Interface) team in porting the YUI3 library to Node.js. By having the client side library able to run on Node with a full DOM we can render the same widgets we render on the client on the server, with the same code! This is a really big step. By being able to use the same code on both the client and the server we get two really important benefits:

  1. We get huge code re-use
  2. We make the page much faster by pre-rendering on the server

The benefits of code re-use are really obvious. We get to write less code and use it in more places. The performance benefits are less obvious. It was always possible to pre-render the correct markup and state for complex interactive widgets on the server, however maintaining two implementations of widgets was prohibitively expensive. Now that we can run the same code on both the client and the server it’s possible to massively reduce the amount of processing and rendering work the client has to do by sending pre-rendered pages, or pieces of pages.

This approach gives us huge flexibility. We are able to send high bandwidth users an incredibly interactive experience that is largely client driven but is still able to draw on server-side components drawn and loaded dynamically. However in more constrained environments we can draw everything on the server and send finished pages to the client. This is ideal for providing a united platform to handle both web and mobile web.

Participants in this session will learn:

  • How to get started with Node.js
  • Which modules are important and how to pick the ones for them
  • How YUI3 on Node.js implements a shared client/server library to gain coding and performance gains

Participants should have a good understanding of JavaScript and be familiar with web development to make the most of this talk.

Photo of Tom Croucher

Tom Croucher


Tom Hughes-Croucher is an Evangelist and Senior Developer in Yahoo’s Open Strategy Group, focusing on Yahoo’s Web Services and Cloud Platform. Tom has contributed to a number of Web standards for the World Wide Web Consortium (W3C) and the British Standards Institute (BSI). Previously he helped build the online music stores for some of the UK’s largest brands including Tesco, Three Telecom and Channel 4.

Comments on this page are now closed.


Picture of Tom Croucher
Tom Croucher
09/30/2010 11:02am EDT

Added the slides here:

Picture of Fernando Alfaro
Fernando Alfaro
09/30/2010 10:27am EDT

Node.js is awesome! Very energetic presentation. I enjoyed it, even with comic sans.

Lotus knows
  • IBM
  • Microsoft
  • Rackspace Hosting
  • 3DVIA
  • Authorize.Net
  • HP
  • Neustar, Inc.
  • OpenSRS
  • open{subnet}

Rob Koziura
(415) 947-6111

Kaitlin Pike
(415) 947-6306

View a complete list of Web 2.0 Expo contacts.