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