Skip to main content

Rails or Grails?

Posted by boneill42 on December 2, 2010 at 11:50 AM PST

I was recently asked the question: Rails or Grails? I needed to summarize the key differences and industry sentiment. This was my response.

Before I make any subjective comments, let me start with some objective metrics I found:
http://www.expectationgap.com/posts/13

Now for my sentiments, I believe there are three key-dimensions: momentum, cloud-support, and people.

Momentum

Rails has the momentum as evidenced by the number of committers and plugins available. Many of the rockstar developers I know are all now developing in Rails, supporting that community, etc. The underlying Ruby language is incredibly expressive and allows dramatic productivity improvements. (write less code that can do more)

Only a handful of rockstars I know are developing on Grails. Typically, those developing on Grails are in enterprises or markets that are comfortable with Java and they want to continue leveraging that investment. (infrastructure, app servers, production support, etc.) Grails/Groovy does have the advantage that It can continue to leverage the output of the Java community (e.g. Spring). The better projects within the Java community are quickly integrated into Grails. For example, Grails uses Hibernate and Spring Security under the hood. As those projects improve, so will Grails.

Cloud Support

Rails and the cloud go hand in hand. Again, of the rockstar Rails developers I know, nearly all of them are running on virtual hardware owned and managed by others. Some of those let others manage the entire application server / platform (e.g. EngineYard). In contrast, all of the Grails development I know of is running on hardware (virtualized) owned and managed by the company itself in their own data centers (or rented space). As mentioned before, this may actually have been the motivating factor to select Grails. That is not to say that there isn’t cloud support for Grails. And now that VMWare owns SpringSource, this may change rapidly now that enterprises will have a trusted name (in VMWare) to host their Grails applications.

People

Rails has the momentum, more committers and potentially a more active community, but lets not fool ourselves -- there is an army of labor out there to sling Java code. Offshore resources are readily available. The market for Rails is developing, but demand isn’t yet high enough to drive consulting companies to substantially increase their supply. As one of my good friends put it, “I’d love to develop in Ruby, but Java pays the bills.”. It is that sentiment, that has may limit the availability of resources.

However, even with readily available Java resources, that doesn’t guarantee the availability of Groovy resources. Both Grails and Rails require a slightly different mindset. If you take a Java developer and tell them to code in Groovy or Ruby, you’ll end up with Java code using Ruby/Groovy syntax. (not good) But at least the tooling, debugging practices, and libraries will all be familiar.

And just to stoke the fire...

Here are my entirely subjective scores:
Momentum: Rails (9) vs. Grails (4)
Cloud Support: Rails (8) vs. Grails( 5)
People: Rails (6) vs. Grails (8)
---------------------------------------------------
Rails (23) vs. Grails (17)

Comments

Rails or Grails?

You might update your subjective scores to say Rails vs Grails instead of Rails vs Groovy.
I'd give rails the nod as well, but for different reasons. I think your assessment is correct that grails is usually picked in the corporate world is because the java expertise and ecosystem is already present. Yeah one could use jruby, but I think that leap is slightly bigger than going to grails.
Overall, I think people tend to think their opinions are unbiased but in reality aren't. For example, I follow lots of people on twitter that think Camel is the next best thing since sliced bread. Does that mean the community has decided that Camel is better than Spring Integration? Not necessarily. I think it just means the "rockstars" I currently follow fall in the Camel Camp. Same thing "could" be happening to you. You can't possibly follow enough people from both camps to know for sure. In the end we are still making our own pre-biased opinion.
Also, I think from my perspective, I've seen the momentum decrease the past year for grails. I think some of this has to do with scala stealing some of the thunder along with other java web frameworks like play and lift. I think the java community suffers from too many choices with just confuses everyone. I'm not sure I see that same issue in the RoR community.
Finally, if your really not settled in on language, I'd even throw in django (python). I've also heard great things about it.
Thanks for sharing your annual article. You should try and find more time to write.

You say, "Grails/Groovy does

You say, "Grails/Groovy does have the advantage that It can continue to leverage the output of the Java community (e.g. Spring)." - while it is true that Groovy and Grails can leverage the Java community's output, I should point out that Grails is a Spring MVC application. This is not so much leverage, but an actual substantial part of the architecture and design. This makes me slightly doubt the level of your research.
Also, who cares what "rock star programmers" are doing? I don't care what a bunch egotistical, fashion victims are doing. I want to know what will get the job done and what our team and infrastructure (ie. non-cloud) will support now and continue to support.
As for "cloud support" (whatever that means) perhaps you should look at SpringSource Cloud Tools - which includes a Grails plugin that lets you deploy directly to EC2.
Yes, I understand how "hip" Rails is and the advantages it may give some people over Java and C# solutions. I can see that due to nature of programmers flocking to the new "shiny" there is a large community, but PHP and Perl also have large communities (and surprisingly, some good apps written in both).
Java has a large community, too and learning Groovy is a no-brainer. Grails is also really simple for anyone who has ever used Spring MVC, and having Spring innards should be familiar to set-up for your better programmers.
I'm not saying Rails won't win over Grails, but I found your research scant.

Rails or Grails?

If you are not dependent on Java code, I would say that Rails is a better option.
You can run it everywhere where Ruby is available and it makes your skills available to non Java shops as well.
Plus if you really need Java interoperability you can always reach to JRuby.
Personally I see Groovy/Grails as Ruby for the Java community, specially when working on Java only shops.

Rails or Grails?

can i ask what do you mean in this case by Cloud Support: ?
I have the feeling you wanted to say hosting....which is a little bit different in my opinion.