Ruby on Rails is, as we've written on this blog before, one of the current darlings of the open-source world. Rails, which lets you create sophisticated Web applications relatively easily, is now the tool of choice for many Web application programmers.
I have personally been developing Web applications for about 15 years, and I have been moving all of my consulting work over to Rails in the last 2-3 years, both because of the added productivity, and because of the enjoyment I get from the work. It reminds me of the excitement I had building Web applications in Perl, back in the early 1990s.
One of the biggest issues that has dogged Rails from the beginning is the question of speed -- and with it, the question of scalability. Everyone agrees that Ruby programs execute slowly relative to many other languages. The question is whether the combination of Ruby's slowness, along with the intelligence of the Rails platform, makes it an unviable option for high-profile, "enterprise" applications.
Of course, it's almost always possible to throw more hardware at the problem, in this case by adding additional Web servers running Rails. So the issue is not whether you can make Rails scale for large-scale applications, but how many servers you will need, how much you'll need to think and worry about the network architecture, and how many people you'll need to run things. As Joel Spolsky wrote 18 months ago, "if you become The Next MySpace, you'll be buying 5 times as many boxes as the .NET guy down the hall."
There were thus a number of reactions to the news that microblogging-messaging startup Twitter would be moving away from Ruby on Rails. This news comes just a week after Twitter's chief architect left the company, making it easy to draw the conclusion that the two events were somehow related.
From Twitter itself, Evan Williams wrote that (a) it's not true that Twitter is moving away from Rails, and (b) "lots" of Twitter code isn't in Rails anyway. TechCrunch reported that despite this denial, Twitter is telling people that it is moving away from Rails.
Of course, it's possible that both of them are telling the truth. For example, Twitter might still be using Rails for displaying messages and other elements of the Web application. But for the heavy lifting, such as sending messages, it might have abandoned Rails long ago.
No matter how you slice it, though, Williams's comment would seem to indicate that Twitter isn't using Rails for its most mission-critical software, presumably because it doesn't scale well enough. Does this affect the usage of Rails? Does this mean that people with grandiose plans should look elsewhere?
Not necessarily: First of all, there are a lot of people and companies with a vested interest in seeing faster, more scalable implementations of both Ruby and Rails. Sun has poured a great deal of money and effort into the JRuby project, and it may well be that the most popular version of Rails in the future will run on the Java virtual machine (JVM).
But the other argument that benefits Rails is one that has been tossed around since the early days of Perl, which was often criticized for being slower than C. In those days, we would say that Perl might be slower than C, but that a company's most expensive resource is it's programmers' time. It's OK for a program to run in twice the time, if it takes a programmer half the time to write it.
Obviously, there are times when this is not the case, and languages like C exist for that precise reason. But if a company needs to buy twice as many servers, while using three fewer programmers, that might turn out to break even, or even put the company slightly ahead.
Would you use Rails in a mission-critical environment?