views:

420

answers:

4

I'd like to know situations in which I should consider using a framework other than Rails.

+1  A: 

Wow, way to start a flamewar!

I'm going to start it off by saying that Rails will work for most apps. However, if you need to do a lot of async type work (like messaging between systems, such as getting a request, placing it in a queue and processing it in a different thread, or even on another machine), Rails is probably not your best choice. Ruby, at least at the current time, is not really strong on multithreaded code.

Let the insults fly!

Todd R
+2  A: 

Ruby on Rails isn't trying to be an end-all be-all web development framework. If you're going to build an application that is predominantly built using CRUD operations, you want to use a lot of AJAX, and you have total control over the database, then Ruby on Rails is one of a few excellent options. If you're doing something else, then there is a probably another framework that is a better match for your requirements.

Kyle Boon
+2  A: 

Two things. First, Ruby is a relatively young language, and you may run into brick walls when trying to do slightly more esoteric things (like connect to non mainstream or older types of datasources). It also has poor GC, and no kernel threads, both of which are very important for a high performance platform. The main codebase (MRI) is quite hacky (lots of clever obfuscating programmer tricks like macros) and there are parts that are poorly written (gc and thread scheduling leap to mind). Again, it is a very young platform that got very popular very fast.

Secondly, while ruby the language and rails the ideas/paradigm are both phenomenal, ruby and rails the platforms are not. There is a hell of alot in both ruby and rails that is downright ugly, and deployment solutions are in the dark ages compared to what is considered normal for other platforms (php/asp/jsp).

Being accused of trolling here, so I will expound a bit. Due to the threading model, Rails cannot process requests concurrently unless you launch multiple full instances of your rails app. To do that you have two options, the relatively young and still under development passenger (mod_rails), or the tried and tested apache load balancer with multiple mongrel instances behind it.

Either way, the lack of the ability to just just spawn workers means you will want 5-10 full instances of your application running, which incurs a very large overhead (can easily be 300-500megs per app depending on your gems and how big your app is). Because of that, the infrastructure needed to serve rails is a hell of alot more complecated then most other things.

Now, that being said, the situation has been continuously getting better (I mean, passenger is usable now, it wasn't the last time I had to deal with deploying a rails app). I would be very surprised if rails doesn't catch up in the next few years.

Also, rubinius/jruby are doing things the right way, and are moving along at a great pace. I wouldn't be suprised if MRI gets dropped in the next few years in favor of one of those implementations for mainstream rails work.

Matt Briggs
Um, deployment solutions in the dark ages? lolwut? There's capistrano for deploying to a server and passenger for running the app. Really you don't even need to use capistrano, just upload and go.
Ryan Bigg
expounded a bit, I actually wasn't trolling and do have reasons for the things that I said ;-)
Matt Briggs
[YARV](http://en.wikipedia.org/wiki/YARV) is the new Ruby VM as of 1.9 and it makes some speed improvements. It even starts working on making threading better!
CJ Bryan
Rails is thread-safe. http://guides.rubyonrails.org/2_2_release_notes.html#_thread_safetyI think your information is a little old and/or hearsay.
Chuck
Many of the short comings you mention are solved by jruby.
jshen
@Chuck: you are right, I was working off of old information. Most of what I was saying in that part still stands though, so I just reworded it to be more accurate
Matt Briggs
+2  A: 

edit: Matt amended his answer tastefully :) I've removed my own comments pointing out the things he's fixed.

Yes, Ruby definitely has some shortcomings. Green threads being a huge one. But as Matt has said, things are moving along in better directions.

The other posts are pretty much on the money. Decently simple CRUD apps are best suited for rails, though there are other frameworks you can try in Ruby that offer more flexibility.

Here's a great (and might I add objective) example of where not to use rails: http://stackoverflow.com/questions/504553/does-the-rails-orm-limit-the-ability-to-perform-aggregations

Keith Hanson
I expounded a bit on my answer. I don't have professional experience with dynamic languages, but that doesn't mean I am biased or wrong. I have done a hell of alot of research on rails recently, and hopefully getting more specific makes that apparent.
Matt Briggs
This is essentially the typical flame war, though, and I just get sick of hearing it. Someone from your camp (Microsoft/Sun/Static Languages) says that everyone from our camp is completely screwing up and we've got a long way to go, haha. It just rubs me the wrong way since I see it so much.
Keith Hanson
That being said, you're right about the things you're mentioning, though I think external links/underlying code fragments backing up your arguments would make it seem even less of a trolling and more of a well researched posting informing others of what you've learned.
Keith Hanson
I'm actually one of those people who considers it more how I get paid then my "camp" ;-) I have gotten into trouble before for making comments like that, but usually get out of it by showing I actually have a basis for my opinions.
Matt Briggs
I actually came to those opinions trying to get to the bottom of exactly what is true and what is not with the ruby myths floating around. It is hard to point to specific things, since it is an amalgamation of a month or two of reading and listening to podcasts/watching conference footage.
Matt Briggs
Well, consider yourself well researched, imo ;) Most of the things you've mentioned I have read in places as well, so for a lot of your opinions (*after* your elaboration) I tend to agree with you. Thanks for elaborating :D
Keith Hanson