www.flickr.com

There is a lot of talk right now about Ruby/Rails and scalablility. People are watching Twitter fall on its ass due to its massive popularity. A lot of people seem to point the figure at their development team and say they obviously must have written bad code, or they’ve made bad design decisions somewhere in their code, etc. But why couldn’t it be Ruby? Could it be that we’ve finally seen the limits of Rails and Ruby on the web? I’d say its possible. So this begs the question, would Twitter be more scalable in a different language? What if it was written in ColdFusion? What if it was ported to the Google App Engine? Surely the Google stack can handle it, right? :)

Languages like Java, Smalltalk, .NET, etc. Boast virtual machines, which in most performance cases, tends to be what makes or breaks a language under load. There is a ton of discussion out there in the Ruby community about Ruby and virtual machines. We have projects like Rubinius, and MRI which are out to build a “drop in” replacements for the original Ruby runtime that provides all of the benefits and power of virtual machines for the language we love. The only downside is, these projects are green. Rubinius (according to lighthouse) is about 85% away from a 1.0 Preview release. I am not sure that Twitter is going to want to run on a preview codebase, so you can imagine its hard for it to be taken seriously by the “enterprise”. But, there is a contender that has recently come into the spotlight.

MagLev

MagLev is a Ruby VM based on the GemStone S64 VM, which runs Smalltalk. The Smalltalk VM has been extended with special byte codes to make it Ruby compatible. GemStone’s Smalltalk VM has been used for over 20 years in sectors such as real time financial markets and the worldwide shipping industry. It as a mature, fast, stable, distributed, and transactional data store which can hold over a trillion objects or 17PB (Petabytes) worth of information. The goal of the MagLev project is to bring this distributed object technology to the world of Ruby on Rails.

This caught my attention. We’ve got a VM coming that has been in use for over 20 years running Smalltalk! MagLev has proven reliability and its coming to Ruby and Rails! The burst of innovation that Ruby has been seeing in the last 5 or 6 years is really impressive. Now, we are seeing robust technologies come to the surface to help push this language into bigger and more robust markets, its only a matter of time until we’ve rid ourselves of that “but can it scale?” question.

I can only dream of my future application stack:

Thats a real dream team in my mind!


Comments

Name (required)

Email (required)

Website

Speak your mind

5 Comments so far

  1. Adrock on June 8, 2008 1:00 pm

    Quite frankly I love saying “Ruby Can’t Scale”. It just makes me smile. Not so much because it’s true, but ColdFusion spent it’s first 5 years hearing the same complaint. So it’s almost a write of passage for a new development platform.

    Technically, I imagine the scalability problem is Rails not Ruby, but they’ve become so intertwined that the general consensus points to Ruby instead of the framework. When MySpace was having it’s bouts with uptime, people we’re quick to say CF couldn’t scale, but in reality it was the underlying framework (pseudo-fusebox) that wasn’t built for load. I imagine it’s the same for Twitter.

    But this sparks a very interesting debate. Twitter is ripe to be surpassed at them moment and an number of other services are quickly gobbling up market share (brightkite, plurk, etc). So while there were many benefits to using Rails at the start (free and fast development model) now that they are established they are looking to build a new platform on PHP or Java.

    Sounds like what the world needs is a platform that free and quick to production, but solid enough to withstand heavy load… JBoss Railo anyone?

  2. Derek P. on June 9, 2008 7:42 am

    @Adrock, actually the scalability issues are surrounding the core Ruby language itself, not Rails. The “vanilla” Ruby runtime is just a C-based interpreter, it has support for only green threads, and it has no VM support, no bytecode, no nothing.

    Thats one of the reasons the community is trying hard at the moment to create more scalable solutions. Right now, the most successful one is JRuby, which unlike the others, can successfully run Rails at the moment. None of the other Ruby VM’s can run Rails today because they don’t suppport all the language constructs yet.

    So, in short, this isn’t a Rails thing, its a bigger issue with the language runtime itself. I’ve not really had a chance to mess with JRuby myself, but I’ve been told its becoming more perfomant than the C-based runtime, and I’m not surprised. The JVM is a very powerful platform, and I am glad that Ruby developers can utilize it themselves.

  3. Ruby “Enterprise” Edition : Derek Perez on June 11, 2008 9:20 am

    [...] I’ve been talking about Ruby VM’s lately, I thought it’d be interesting to bring up another “segway” technology that is [...]

  4. sal on June 15, 2008 10:42 am

    have you played with passenger lots?

    seems interesting…

  5. Derek P. on June 15, 2008 11:06 am

    @sal,

    Yes, I’ve played with Passenger pretty extensively. Its definitely a more robust solution than setting up a billion mongrel processes. Its performance is fantastic, and it was a snap to install.

    Highly recommended.