BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News iisnode: Node.js for Internet Information Server

iisnode: Node.js for Internet Information Server

This item in japanese

Bookmarks

The iisnode project is a module that adds Node support to Internet Information Server 7.0 and later. The primary role of IIS is to act as an application server for Node, much in the same way that it does for classic ASP and ASP.NET. Developers familiar with these technologies will find the feature list to be quite familiar.

Node is informally known as node.js. It is a JavaScript-based server-side framework with a heavy emphasis on asynchronous programming techniques. Back in June it was announced that Microsoft would be partnering with Joynet to port Node to the Windows platform. While a naive port would be quite trivial, in order to get the desired performance this project has an emphasis on using native features such as I/O completion ports.

Back to the IIS module, where process management takes the center stage. Just like ASP.NET, IIS handles starting and stopping instances of the Node runtime. Since Node is single-threaded, IIS will also handle monitoring and load-balancing across multiple instances of Node. There are no details yet, but one would assume that we are looking at the traditional ratio of one process/thread per logical core.

Like ASP.NET, iisnode will support in-place updating. One merely has to drop a new version of a script file and IIS will recycle the Node processes as they complete their currently executing requests.

Node can be used as a standalone web server, but that requires the developer to handle a lot of things that they really have no business messing with. For example, who wants to spend weeks fine-tuning caching and compression code for static files? Instead developers can leverage IIS capabilities for this and focus on the areas where Node shines.

In addition to caching and compression, Node also inherits the port sharing, security, URL rewriting, and logging capabilities of IIS. Some of these features will require changes to your Node code, for example one needs to read the address and port numbers from the process.env.PORT environmental variable.

Since we are talking about IIS, there will of course be some XML configuration to deal with. At the very least one needs to register the server-side JavaScript files in the web.config file. Failure to do so will cause those files to be served by IIS as if they were client-side JavaScript.

Rate this Article

Adoption
Style

BT