InfoWorld's Test Center picks the best open source development tools of 2011
Was it just a few months ago that everyone loved multithreading and concurrently running tasks? My how the pendulum swings! Some clever programmers behind Node.js realized that each new thread cost 2MB in memory and gave it a second thought. Sure, that's not much for a desktop app that might use one to watch the user interface and another to watch the network traffic, but it adds up quickly when you're using a new thread for every request that reaches your website. If Slashdot loves your site, suddenly a server with 16GB of RAM looks quite small.
The genius of Node.js is that it uses only one thread to handle all of the input. This forces the developer to anticipate when the code might hang and to split up the code in these places. If a request comes into the website and you need to check a database to see if the user has enough cash in the bank, you write two functions. The first handles the work before the potentially slow database query, and the second handles the decisions after the poky database sends along the bank balance. When the programmer does all of this for Node.js, there's no need for extra threads or an operating system layer that can juggle the different processes.
Node.js still feels more like a science project than an enterprise-ready tool, but the community is growing quickly as people recognize just how fast the system can be when the programmers don't screw up. It's only a matter of time before some clever JVM lovers write a nice container for Java or Ruby programmers who are willing to insert the right splitting points into the code. Until then, Node.js is the place to experiment with lightweight server stacks.
The Bossies 2011 index:
This slideshow, "Bossie Awards 2011: The best open source application development software," originally appeared at InfoWorld.com. Follow the latest developments in application development and open source at InfoWorld.com.