Ruby on Rails – a paper dragon?

May 25, 2008
Posted in Editorial

Hi,

I was going to start this off with some analogy on how Ruby is like dating some ‘hottie’ that turns out to be crazy .. but I just couldn’t make it work …

When Ruby on Rails started to gain some momentum a year or so ago, I decided to take another look at the Ruby language itself along with the Rails web framework.

ruby on rails logo

Before I get to the heart of this article, I have to tell you that I love the elegance of the language … it is fun to use.

But, being a nerd who’s has experienced disappointment in promising new technologies in the past, I decided to dig a little deeper into Ruby and Ruby on Rails before committing to use it in real projects. I did my research … and I’m glad I went with PHP instead.

… Let me just say that this Twitter news, only reinforces my own thinking from a year and a half ago.

Why did Twitter decide to move away from Ruby and Ruby on Rails?

Well according to TechCrunch, the boys at Twitter found that Ruby could not be made to scale.

Update:

Apparently this Techcrunch report was later refuted by the Twitter people. Nonetheless, the point of this article still holds true.

I’ve also found comments from a Twitter developer (Alex Payne) talking about how slow the Ruby language is:

“All the convenience methods and syntactical sugar that makes Rails such a pleasure for coders ends up being absolutely punishing, performance-wise.

Once you hit a certain threshold of traffic, either you need to strip out all the costly neat stuff that Rails does for you (RJS, ActiveRecord, ActiveSupport, etc.) or move the slow parts of your application out of Rails, or both.

It’s also worth mentioning that there shouldn’t be doubt in anybody’s mind at this point that Ruby itself is slow. “

Even the creator of Ruby (Matz) has his beefs with Ruby

When I heard about the critical comments made by the creator of Ruby about the language … it made me think twice about jumping in.

Always look at what’s going on ‘under-the-hood’

So, when I decided to move forward with a new web application, my first decision to make was the technology stack I was going to use. I was considering:

  • PHP
  • Ruby
  • Java with JSP and Servlets

… I had to at least consider Java since I’ve done a lot of my work in Java in the past.

Quickly though, it came down to PHP or Ruby with Ruby on Rails. Ruby was the hot new language and my little team really wanted to jump into it .. and I must admit, so did I.

But experience prevailed, and I decide to take a deeper look at Ruby (and Ruby on Rails) before I would commit myself.

… I found some major holes.

The problem with Ruby and Rails

I don’t want to get into to micro-nerd details, but at the time, I found that there were things missing in the core Ruby language, things that developers had to fall back to C solve! This was something I did not want to have to deal with.

Another major hole (and this was the deal breaker for me,) was that Ruby and web server integration sucked. It sucked hard. You had to jump through hoops to get Ruby web hosting working.

One reason I moved away from Java web application development, was because of the problems related to Java web hosting. Though I know Java server setup reasonably well, PHP is so freakin easy by comparison!

Anyway, Ruby web server integration makes the Java thing seem trivial.

Ruby reboot

Beyond all that, you’d here stories (with Ruby and Ruby on Rails) of the web server having to be rebooted several times a day! This is not at all acceptable in any situation. That alone should be enough for any self-respecting developer to want to stay away from a technology.

The above reboot problem is like buying a boat that continuously springs leaks. Who wants to have to bail water all day … especially when you’re out there on the water.

Anyway, I made the choice for PHP because it was fast, could do everything I wanted without having to write C code, and was proven.

As told one of my assistants:

I don’t want to spend months developing an application, and then find that the underlying core can’t support the load. Or … that we find that we have to reboot the web server ten times a day!

… If I wanted that, I would go back to classic ASP!

🙂

Conclusion

I haven’t looked at Ruby and Rails since that time, but I am sure things have progressed. That said, this Twitter news is just further evidence that the Ruby web stack stills needs work … work on the very heart of things Ruby.

It also shows that you should never jump into something until it is really well vetted.

Some related links:

The complete interview with the Twitter developer Alex Payne.

CNET on Twitter’s Ruby move.

Thanks,

Stefan Mischook

www.killerphp.com
www.killersites.com

23 Responses

  1. Fredrik Holmström Author May 25, 2008 at 3:38 pm

    I usually like rants, but this was complete rubbish. You did not identify a single issue with ruby or ruby on rails, except the fact that you “found parts missing” but refuse to go into detail on it?

    And sure, ruby is slow – but I doubt you’re building the next twitter.

    And don’t get me wrong, I work with PHP every day and normally like rants… but this was just.. awful.

  2. victor Author May 25, 2008 at 4:43 pm

    Sounds like your just spreading FUD. Sorry but scalability isn’t about language but architecture. And please do tell about the things you have to fall back to C that you can’t do in ruby?

    That said, I am no Rails developer. I have had a production site written in Rails which was scraped for Java due to static type safety. Maintenance in the long term is what matters. Rails at that time did not cut it, 0.9x releases.

  3. Stefan Mischook Author May 25, 2008 at 4:57 pm

    HI,

    I have no agenda. Just reporting what I found.

    It has been a while since we looked at Ruby (over a year) so I forget the specific components that were missing .. it could have been something to do with GD, but I’m not sure.

    Regardless, how is my referencing Twitter and Alex Payne’s comments FUD? Why is mentioning the FACT that Ruby integration with web servers is not easy … FUD. This is all true and very relevant to anyone considering the language.

    Again, I am not trying to attack Ruby, I leave that to the creator of Ruby.

    PS: I probably won’t be building the next Twitter … but why take the chance!

    😉

    Again, I think Ruby and Rails have their place. It, like all other languages and frameworks (and that includes PHP, Java, C# etc), are not perfect.

    I appreciate the comments.

    Stefan

  4. John Wilkes Boot Author May 25, 2008 at 9:32 pm

    Not sure if you’ve looked at other articles since your “rant” seems to be one sided. I’ve included a few to that says Twitter isn’t ditching Ruby on Rails. One thin that you’ve forgotten to mention in all this is that Twitter already has code that’s not in RoR, so blaming RoR for Twitter’s downtime seems to be just what the public wants to blame.

    http://www.betanews.com/article/Twitter_cofounder_refutes_rumors_of_ditching_Ruby_on_Rails/1209766854

    http://rorblog.techcfl.com/2008/05/02/twitter-is-not-abandoning-rails/

  5. Stefan Mischook Author May 25, 2008 at 11:16 pm

    Hi,

    Fair enough. I had not read those articles.

    Thanks for posting the links.

    Stefan

  6. Joseph Hurtado Author May 26, 2008 at 12:31 am

    Stefan,

    What can I tell you, for the most part I agree. Although Twitter problems are not just Rails, in fact they are problems related with doing a near-real time messaging app with huge traffic.

    However, Rails does seem to be not the ideal solution. Have you explored Python? That seems to be an alternative worth investigating, and also of course PHP 5.x

    Take care,

    Joseph Hurtado
    Web Developer
    Toronto, Canada

  7. julio Author May 26, 2008 at 3:19 am

    for someone who wanted to dig a little big deeper, it looks like you decided to stop digging as soon as you found what you wanted to find.

  8. Tom Author May 26, 2008 at 5:01 am

    I don’t even *like* Ruby and I thought this was complete rubbish. Essentially, you’ve tried to equate “done research” with “heard rumors and speculation.” These two are hardly synonyms. Additionally, “vague generalities” are not synonymous with “facts” or “useful information.”

    Ugh, give me this 5 minutes of my life back, please.

  9. Juan Stang Author May 26, 2008 at 5:14 am

    The deployment argument with Rails is, for many, a red herring now. If you’re deploying on *nix with Apache, then Phusion’s Passenger (mod_rails module) makes deployment easier than PHP, frankly, if that’s possible. Capistrano is easily configured to handle even complex deployment configurations.

    Again, using Passenger, performance is better than PHP when compared to PHP MVC frameworks:
    http://thislab.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/

    I’ve never had reboot issues with Rails. That could, of course, be due to particularities of my environment.

    And Twitter isn’t “abandoning” Rails.

    Finally, your initial comparison isn’t really valid, per se. How can you consider PHP vs. Rails vs. JSP/Servlets? Rails is a framework built with Ruby. PHP is not a framework – it’s analogous to Ruby. And why compare JSP/Servlets to Rails or PHP? The deployment issues alone wouldn’t really merit any serious “mulling over” of pros and cons, unless you were seriously biased *for* the Java platform in the first place.

    For that matter, why didn’t you consider Merb or Hobo? Or Django? Django, after all, has had the deployment issue solved for ages, and Python beats PHP all to hell performance-wise, as well as in other areas.

    Meh.

  10. Kalle Author May 26, 2008 at 6:22 am

    Pure FUD… 😛

  11. dave Author May 26, 2008 at 8:34 am

    Stefan —

    Very thoughtful article! And, of course, there is the very well-know article by Sivers:

    http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html

    …And here is the summary of the Sivers article from Wikipedia:

    CD Baby runs on PHP and MySQL[1]. It gained brief notoriety when Sivers announced publicly in early 2005 that he was rewriting all the systems in Ruby on Rails and PostgreSQL. After about 2 years of work, he felt that the rewrite was still less than half done, and he threw the new code away and rewrote it again in his original programming language, PHP, and database, MySQL. He said it took him only two months to finish. This was a widely-discussed move, because some saw it as a demonstration that Ruby on Rails was overhyped and not up to the task of solving large problems. Sivers himself summed it up by saying that “Rails was an amazing teacher” but that PHP was perfectly up to the task once he had learned the lessons Ruby and Rails taught him.

  12. Mar Gopio Author May 26, 2008 at 8:50 am

    Hi,

    What about ASP.NET 3.5, isn’t it a serious contender for any kind of web app that one can think of now?

    Mar

  13. devmachine Author May 26, 2008 at 10:00 am

    Please do more googling around. It seems that you’re just looking for YOUR answers and to satisfy YOUR wants.

  14. Stefan Mischook Author May 26, 2008 at 10:34 am

    Hi,

    I need to address a few comments:

    “for someone who wanted to dig a little big deeper, it looks like you decided to stop digging as soon as you found what you wanted to find.”

    “Essentially, you’ve tried to equate “done research” with “heard rumors and speculation.” ”

    The ‘digging’ I was speaking of was done about a year and a half ago, way before this whole Twitter thing came about. The Twitter news and the interview with Payne (which some comments seem to ignore ..) served only to remind me of our own findings back then.

    As I stated in the article:

    “… I haven’t looked at Ruby and Rails since that time, but I am sure things have progressed. That said, this …”

    So yes, I’m sure progress has been made.

    “How can you consider PHP vs. Rails vs. JSP/Servlets? Rails is a framework built with Ruby. PHP is not a framework – it’s analogous to Ruby. And why compare JSP/Servlets to Rails or PHP?”

    You guys are getting picky ..

    For PHP we ended up using the Zend Framework and for the Java option, I would have probably gone with my own simple MVC framework I had put together in years past.

    The article was not looking at the specifics, I was only speaking in generalities .. global issues.

    With regards to ASP.net:

    It has some good things, but I don’t like getting into the Mircrosoft camp because they have a tendency of trying to lock you in. OK, ‘tendency’ may be understating the true story.

    Stefan

  15. Randal L. Schwartz Author May 26, 2008 at 10:51 am

    Have you considered Seaside (http://seaside.st), the web-continuation framework written in portable Smalltalk, running on various commercial and free platforms? A lot of Rails people are seriously looking at Seaside for faster development and more efficient deployment.

  16. Stefan Mischook Author May 26, 2008 at 5:06 pm

    Ok,

    Since people want details, I will provide them.

    Preamble:

    It had been a while since we looked at Ruby seriously, so I had forgotten the specific reasons (beyond what I mention above) why we went with PHP over Ruby. Luckily, I spoke to someone who was on my team at the time, and he was able to refresh my memory.


    The issues:

    In general, aside from the pragmatic programmers, a year ago, very little documentation existed, also getting a webhost that supported RoR was a pain in the ass since there really wasn’t a standard configuration for FastCGI to work properly.

    .. We were working with our own live dedicated servers and did not want to risk taking it down to get Ruby to work with Apache.

    I think another thing worth citing, is the RTFM attitude of the RoR community (at the time) versus the feature-rich and procedurally mature PHP community. While as a whole, the PHP community may not have a mature OO-background, but on the plus side, the attitudes fostered in that community lend themselves to more forum posts, message boards and code samples, rather than sifting through mailing lists where elitist nerds take pot shots at each other.

    … This was a year ago … and I don’t know how this is today.

    The business side of things:

    From a business perspective, we wanted a solution that would work with as little time spent as possible building components … Zend had IBM backing it, RoR had 37Signals and that was about it.

    In terms of components, just getting image resizing to work out of the box proved to be tricky (at the time) since, if I recall correctly, ImageMagick was the only option and a non-beta solution didn’t really exist.

    Stefan

  17. poink Author May 26, 2008 at 7:44 pm

    A fine troll, sir. The slo-mo replay:

    Step 1) Find community of zealots
    Step 2) Take (discredited) article from a month ago
    Step 3) Take (probably BS) anecdote from a year ago
    Step 4) Recommend PHP, which’ll really piss ’em off
    Step 5) Maek poast

    I’ll bet your traffic went through the roof, and you might even wind up getting Slashdotted. Congrats.

  18. Stefan Mischook Author May 26, 2008 at 8:01 pm

    HI poink,

    I will concede that the Twitter article has been refuted … when I wrote the piece I was not aware of that.

    That said, Alex Payne’s statement still stands. My own experience and findings are not BS … it is what we found – period.

    I used PHP for this particular project and found it to be the better choice given all my criteria at the time. That said, I am not a PHP zealot and I have developed many more applications in my career with Java than any other language … including PHP.

    I have also stated that I think Ruby has great things going for it. In fact we DO use it in an application that is currently running.

    PS: our traffic is fine as it is.

    Stefan

  19. Andy Jeffries Author May 27, 2008 at 4:46 am

    I think the reason you’ve got such an intense reaction is that you’ve posted an article in May 2008 that you researched “about a year and a half ago”. Your information is therefore hopelessly out of date and is therefore seen as FUD.

    I’m a PHP developer by day and a Rails developer evenings/weekends, so I’m aware of both sides of the fence.

    I’d recommend giving RoR a look NOW and seeing how things have moved on, then you’ll be better placed to write a blog post detailing how PHP is better than RoR.

  20. Nazgum Author May 28, 2008 at 7:24 am

    Well this article was just horrible, and publishing it now based on “research” you did a year ago just seems beyond stupid..

    Use whatever makes you happy, but why bash something you don’t use with outdated FUD?

  21. Stefan Mischook Author May 28, 2008 at 10:54 am

    Hi,

    I first wrote the piece because the Twitter news (that turned out to be false … ) reminded me of my experience.

    I don’t think I am bashing; I’m just pointing out things about Ruby that we ran across when looking into it.

    … If telling the truth about the state of things is bashing, I humbly suggest you need to reevaluate. If I would have praised Ruby for it’s elegant syntax, or Rails for it’s excellent RAD features – would that be pumping?

    Stefan

  22. Rick H. Author June 1, 2008 at 11:42 pm

    Stefan, love the videos, saw this random article and decided to comment, even though its ages old.

    You do not need to reinforce your article. It can stand on its own, and commenting on its accuracy won’t make them go away, just make them comment more. If you believe what you wrote, stick by it, it wasn’t a bad piece.

    -Rick

  23. Stefan Mischook Author June 2, 2008 at 12:01 am

    Hi Rick,

    Thanks for the words of encouragement. It seems to me that whenever you have an opinion about any language (or anything else!) you are bound to tick off someone!

    Stefan

To Top