Ruby-on-rails – Groovy/Grails :: Ruby/Rails :: 2011 State of the framework

frameworksgrailsruby-on-rails

Yes, several similar threads exist, but we're now in 2011, and much has changed.

Grails 1.3.6 has improved hugely compared to v1.3 when I initially tried to learn the framework (and gave up to slow compile times and other groan inducing events).

Having spent a couple months with the latest release, I am impressed, protyping an app is an absolute breeze (GORM is great!). In development mode one no longer needs to restart, barring changes to domain classes. Groovy.lang is fantastic (bare in mind, this is compared to my day job life in PHP).

Now, on the flip side there is Ruby/Rails, which I have little experience with beyond perusing Ruby docs and exploring Active Record (to compare to GORM). Coming from PHP/Jquery, groovy syntax is cake, ruby not so much, although accessible.

Ruby/Rails is all the rage, while Groovy/Grails seems to be picking up speed in its own right.

I'd like to hear what both camps have to say (flame inducing lang war welcome) re: pros/cons of both langs/frameworks now in 2011. When choosing a framework it's important to know what you're getting into, so have at it, newbies will benefit, and experts can vent ;–)

Best Answer

Rails and Grails are both excellent frameworks with their current releases. You really can't go wrong with either. Here are some things I find interesting about them though:

Rails

  • Rails (Ruby) does not scale as well as Grails (Groovy). You will need more horsepower to run your application. This isn't a big deal at all with PaaS options like EngineYard (and hopefully a AWS BeanStalk Rails option in the future), but it might just cost a little more to run a Rails app vs a Grails app (obviously JRuby is also an option to though).
  • Rails is slightly better with NoSQL alternatives currently, but Grails is catching up quickly
  • Rails has many more plugins, but this can lead to trouble if you use some that aren't maintained (a lot of them don't currently work with Rails 3 yet either).
  • Rails is more mature and has more features at this point in time because it's been around longer
  • Rails REST support is amazing
  • There are many more "big" Rails websites than Grails
  • Ruby is much more popular than Groovy - TIOBE
  • No dependence on Oracle, ha! (Grails obviously needs the JVM)

Grails

  • Grails integrates with the JVM better than JRuby
  • Grails GORM is better than ActiveRecord (IMHO), although Rails 3 opened the door a little bit for other persistence options, but all the books, tutorials, etc all use ActiveRecord
  • Grails View taglibs are better than <=%...%> in view
  • Grails plugins are well documented and clearly state whether they are supported by SpringSource or not
  • SpringSource is investing heavily in Grails
  • There will be many more corporate jobs for Grails than Rails in the future, but more startups use Rails (where do you want to work?)

My perspective

  • I used Rails a couple years ago, I'm working on a Grails project now
  • I like them both better than Django (Python) or Zend Framework (PHP)
  • I plan to learn Lift (Scala) next

My Recommendation

  • If you have never done Java development and are working on a side project for a small to medium website, go with Rails
  • If you are working at a big company that uses Java, try pitching Grails to your management as the "next Java framework" they should invest in
  • If you are working on "the next twitter or foursquare," well then you are smart enough to answer this question yourself! :)