jRuby on Rails vs Grails [closed] jRuby on Rails vs Grails [closed] ruby-on-rails ruby-on-rails

jRuby on Rails vs Grails [closed]


Try both, and pick the language and environment that suits you best. It's true that the Grails stack out of the box is more suited towards Java integration, but many components are just a few lines of Ruby code away from integration with Rails. Rails 3 is a great release that doesn't require you to use ActiveRecord, in fact it would be trivial to use Hibernate for your models instead. See also DataMapper, MongoMapper and a whole host of database adapters for SQL and NoSQL databases alike.

Also, JUnit != functional testing. Instead, have a look at Cucumber + Cucumber-Rails + Capybara + Selenium for an integrated browser automation testing experience. Take a look at https://github.com/elabs/front_end_testing for an example application that demonstrates this stack.

I'll suggest that Ruby is better suited as a web integration language, and JRuby hits the sweet spot of making integration with Java easy as well as pleasing while making a wealth of non-Java libraries available to you. Don't think that Groovy automatically wins because it's "closer" to Java. Sometimes you need to step into a refreshingly different environment in order to have a new look at how to solve a problem.

Disclosure: as a member of the JRuby team my bias is evident in my answer.


I know Grails very well (right now I'm working on a Grails project), but not JRuby, so take this as a probably biased opinion: looking at the JRuby documentation, it looks that JRubys integration with Java is a bit more cumbersome, since Java is more native in Groovy than it is in Ruby; therefore, in JRuby, you have a lot of java-specific keywords and methods (e.g. java_import, java_send). Put simply, Groovy is a language targeted specifically at the Java world, while JRuby is, well, Ruby put on the JVM.

Grails has JUnit tests built in.

Can't say much about performance and scalability, but given the good integration with Java, one can always write performance-critical parts in Java when Groovy is too slow.


  • ease of integration with existing Java components:

it's easier with groovy, cause groovy is basically java. you do not have big context-switches

  • support for functional testing frameworks

ruby has it's own pile of testing frameworks like rspec/shoulda/cucumber/steak and tons more. since i like ruby syntax i would prefer those

  • performance on a single machine

as far as i know, grails is better in multithreading, because rails did not fokus too much on that in the past. they are currently catching up, so it might be tie.

  • scalability

both scale with the jvm environement. if you have a running infrastructure for java, grails is easier to integrate.