Sunday, February 3, 2008

Rant on Ruby On Rails

I have just about wrapped up my spike using Ruby on Rails. It was only for a very small RESTful web service, but this experience has left a somewhat bitter aftertaste. Here's a short list of things I hate about Ruby on Rails:

1. No documentation.
This one floored me, but it is true. Just have a look here. Do you see any useful specifications? User manuals? Nope. Just some dry API documentation, a handful of tutorials, and a link to a book for sale. Sorry, but does anyone find this acceptable?

2. Questionable release management
The latest Rails release broke what little library support was available for composite keys for database tables. I don't even know if this has been fixed yet. But that's not all.

The latest Rails release also apparently broke the API for setting up functional tests. Again, I don't even know if this has been addressed, not even in edge Rails.

3. Rails API for send_file and send_data leaks memory
This is not a mongrel problem. I've seen this happen with webrick, and I bet this would happen with whatever else you happen to use with Rails, but if you try to stream data or a file with the aforementioned APIs, Rails will not release the memory it uses. The current best practice is to use the HTTP header X-Sendfile if you've got to send a static file, but you are hosed if you need to do something dynamic. Oh, and I think this issue has been around since 2006.

Now, this is just a short, 3-bullet list. I get this sneaking suspicion that if I were working on a larger project, one with more enterprise-level requirements such as Service Level Agreements on performance or speed, I suppose I would find more drawbacks to using Ruby on Rails.

Which is a disappointing, for the expressiveness of Ruby and Rail's basic approach to being a fast-track framework for web apps that babysit databases actually makes for a very highly productive environment. Don't get me wrong: I would consider Ruby on Rails for future projects, but only after carefully considering the functional requirements versus what Rails can/cannot/will not do. There's way too much hype surrounding Rails right now, and that clouds better judgment.

1 comment:

Buruzaemon said...

Regarding list item 3 and that weaksauce API for send_data/send_file, I was lucky in that I am using Mongrel, which allows for using the TCPSocket reference that is available in Mongrel::HttpResponse. In a nutshell, I had to ditch using a stock Rails controller, and hack up my own Mongrel servlet that was configured to intercept requests to a certain target URL pattern.

Ruby is very hackable, which is, as Martha would say, "a good thing", not a "bad thing".