Ryan Twomey
A Twitter Rewrite?

There’s some interesting chatter going around saying that Twitter is contemplating a move from Ruby on Rails to something else, like PHP or Java.  As I read the article (and knowing some recent news about Twitter), I had to shake my head.

“Twitter is planning to abandon Ruby on Rails as their web framework and start from scratch with PHP or Java (another solution is to stick with the Ruby language and move away from the Rails framework).”

Let’s go over a couple points here, because there’s a lot going on.  First, Twitter has been notorious with downtime.  As more people join up, it’s been harder and harder for them to keep their service running.  And that’s certainly understandable - after all, most popular sites have had the exact same problem.

Second, Twitter has been hiring a whole bunch of people lately, supposedly with experience scaling web applications, in an effort to get some smart people working on the problem.  Good for them - it’s a step in the right direction and will keep their investors happy.

Third, the Twitter service is unique from a development perspective in that it doesn’t inherently lend itself well to caching.  The point of the service is to constantly add and receive new messages, not to access individual messages many times (like a web page).  So it’s tough to realize much from caching.

So, with all this in mind, here’s what I think is happening: politics.

Ruby on Rails, like any other web framework, language, or development tool, has its supporters and detractors.  For every reason a developer may like it, there’s another reason not to.  Same with everything else out there.  But the main problem it’s got is that it’s the new kid on the block, and all those scaling experts Twitter’s been hiring have experience in things other than RoR.  Their natural tendency is to favor something they know works.  But I digress - they can choose whatever language they want, because ultimately, they’re solving the wrong problem.

My issue is that I don’t buy that RoR is the actual problem here.  A business, like Twitter’s, that is so dependent on database access is going to have issues with their databases way before anything else.  After all, what is Twitter other than a front end to a database with millions of 140-character rows?  I’m surprised they haven’t been hiring DB experts (and by experts, I mean db developers - not your average DBA) more aggressively, as I would be focusing my efforts on data throughput and other performance issues first and foremost.  And to evidence this: I don’t know of anything coming out of the company that’s been db-focused (research, code, etc).  Google has an entire MySQL-modified project they’ve developed to improve their own performance.  Where’s Twitters’?  Since I know of literally nothing about their database-level scaling efforts, I have to assume there just hasn’t been much done.  And that, I believe, is their real problem.

If Twitter is at all interested in solving their scaling issue, they should put together a comprehensive report on the scaling issues they’ve faced and let impartial experts go over the facts.  But I’d be surprised if that ever happened.  So, RoR will get a bad rap due to the politics over at Twitter, and they’ll continue having scaling problem.

Update: Yep, it’s apparently not true.  I probably should have suspected, given the absurdity of the whole thing.  But, regardless, it does start some discussion on Twitter’s scaling problems, and I still ask that they reveal an analysis of their problems to the community. 

  1. ryantwomey posted this