It appears that Microsoft has just sown the seeds for their own demise. In June, 2011, they announced that they would port Node.js to Windows.
I know what you’re thinking…
Node.js has been growing steadily in the background for years. Nobody gave it much attention. It was sort of a hobby tool that only the uber-geeks played with. Well, no more. When you’ve got serious professionals like Scott Hanselman looking seriously at this stuff, it does make you take a closer look.
What can Node.js do? In theory – anything that Apache or IIS can do. And more – as you’ll see.
What’s the Difference? Or, Why Apache Sucked, Still Sucks, and Will Continue to Suck
As we all know, the Windows world uses IIS. It’s the server that serves up all your neat little ASPX pages. IIS is used on about 40% of servers worldwide.
According to that same CNet study, Apache is used on about 50% of servers. It’s the most popular web server worldwide. It’s popular because it’s free, and because there has always been no better alternative – until Node.js.
So why does Apache suck? According to Wikipedia, Apache was conceived in 1995 and is written in C. Add on top of that the fact that it’s an open-source project and you can immediately start to see the level of complexity of this behemoth. More evidence of the fact that Apache has become unnecessarily complex can be seen in the emergence of Lighttpd – a web server that duplicates Apache’s HTTPd with far less complexity. In fact, Lighttpd powers YouTube, Wikipedia, and Meebo.
But complexity is not the only reason why Apache sucks. While the Apache server itself is quite robust, it’s the libraries and languages that grew up on it that really suck. PHP is a prime example. PHP is the language of choice for just about everyone who does development on Apache. The only language I can think of that is more arcane, backward, and stupid than PHP is C++. PHP was conceived in 1994 as a way to build “Personal Home Pages,” back when a “home page” was nothing more than an HTML3.2 page hosted on Compuserve or Geocities (RIP) designed for IE 3 with lots of blinking text and animated GIFs, to be viewed on a screen with a maximum of 256 colors and 640×480 resolution, over a dial-up 28.8Kbps connection. Times have changed since then, yet PHP has refused to die. Moreover, it carries all of that legacy minutia right to this day. Same as Apache. So let’s call the other reason why Apache sucks “legacy.” Over 16 years of it. Same reason why C++ sucks.
Additionally, PHP has major gaping holes in security. Aside from PHP, for Apache, you have Perl a language that is some 7 years older than PHP. Then you have Django which is a great framework, but which suffers from the same legacy background that the others suffer by virtue of the fact that it runs on Apache. In addition, Python is rather slow compared to Java or .NET. In fact, in some tests even Ruby is twice as fast as Python.
Finally you have Java, and Tomcat. A language conceived at the same time as PHP, Java has lived its life with spectacular tenacity. Despite all of its deployment nightmares, Java continues to linger on enterprise systems simply by virtue of the fact that it is so difficult to work with, thus making contractors tons of money. Why is Java difficult? Well, take the JVM. The JVM was never designed to run a web server. That it allows you to run a web server doesn’t mean you should. Neither Sun nor Oracle have done much in optimizing Java for server-side use, other than providing you with a PHP clone called JSP and a whole plethora of acronyms to memorize. Bottom line – Java was never designed for server-side web application development.
The development of custom web servers (like Lighttpd) has accelerated over the last decade, as the world kept moving beyond Geocities and Angelfire. Flexibility requirements have grown, and web programming is a lot more low-level now than it was at the start of the web. Web developers mostly want the same things: JSON, XML, page templates, and distributed key-value (“NoSQL”) data stores. The primary reason for this shift is the increase in distributed and scalable nature of web applications. Apps like Facebook or Wikipedia require lots of servers interoperating efficiently over large distances (high latency). Web development in this kind of environment needs to be a lot more modular; less monolithic. This is why a low-footprint zero-config server like Node.js is so exciting.
Microsoft’s future, if you’re at all concerned, is not going to be affected by this. They probably have this all factored in. Their future is in developer tools and more importantly business intelligence tools. They will continue to have a first-class platform with Windows, but on the server their market share will drop significantly unless they can come up with something bigger and better than ASP.NET was back in 2002.
With that, I’m off to install iisnode and read Scott Hanselman’s article about Node.js. Isn’t it great to be mad, Scott?