11/26/2012

Grails vs Rails

For four years I've been heavily involved in Grails and web development. Load balancing, relational and not relational databases, not fully defined business model and unexpected requirements from client is my daily basis. Simple problems? No, thank you.

Recently I was curious about Rails and looking for answer which framework (RoR or GoG) is the best solution to create robust start up without worrying that at some point of development we hit dead end.

Grails guys like to show Grails advantages. Rails guys like to show Rails advantages. It is not a rocket science. Apparently there is not much people who want to compare these frameworks basing on real development experience from both worlds. I was very disappointed with the information I've found online so I've decided to make my private test. I've wanted to create simple application where user could register, login and maybe some place where only admin could see users. To make it nicer, bootstrap layout would also be nice.

I started with Grails in which I have a lot of experience. New app, some standard plugins, spring security of course, unit tests, integration (so slow...), ui, validation, internationalisation, activation, confirmation email etc... 4 hours later application was running. That is nice time (I thought).

Then Rails. I must admit my experience in Rails was quite poor, just few tutorials online, some glorification articles and even a little skepticism because everything was not typed as I used to. Before I started doing anything I looked at google and baaaam. What? They've already done it, describe it, and yet didn't even bother to send me an email ;). Code is available with cucumber tests and rspec. I did not want to download it but instead went through all steps by myself only with the help from tutorial. In that case time comparison would be more reliable. After 4 hours time I left Grails far behind. Not only because rails security (gem) is way more robust than spring and support mail activation from scratch, not only because hot deploy is amazing but everything is so straightforward and so damn fast. Grails promised it but in Rails it is totally different story. This is working much better that I would even expect. Finally, I was pleased by simple deploy of rails app on cloud hosting (heroku) and I could share a link to working app to a friend.

Just to keep momentum I’ve created some modifications, connect rails application with multiple data sources, one SQL and one NoSQL on heroku. Made some additional cucumber tests and everything work like a charm. I had felling that I've already known that framework before, just forgot to use it.

Rails is way more mature than Grails. Everything that in Grails is a problem, Rails already done, twice and community describe it well. Where Grails docs described potential code that could be vulnerable for malicious attacks. In Rails, apart from prevention they describe that attacks.

I'm not here to convince anybody. Don’t take my words only, take a leap in Rails world, just a short one as I did. You'll see.

edit (2013-11-22): It looks like, not surprisingly, that Ruby and Rails comparison is still a hot topic

2 comments:

  1. Grzegorz, I think the reason for missing comparisons based on real development experience is ignorance.

    People who start out with any framework often simply *assume* that they are already using the best framework available. After all, that's what the marketing told them, right?


    Besides, allowing the thought that their current framework is a fail, would mean they'd have to redo their project from scratch or, at least, accept the fact that they'd wasted time by aggregating knowledge about it.


    _Our experience after working intensively with both, Grails and Rails, has been the same as yours: One promises, the other delivers._


    In order to provide developers with the opportunity to get a solid impression, we compiled a comparison based on a real-life project.

    It emerged while reimplementing that project in Rails. Thus it highlights the differences based on details of common challenges that most projects will face within the first couple of weeks/months.


    http://groovy-skills.com/Grails/2012/08/19/ultimativer-showdown-grails-vs-rails/


    (The article is in German, so you might want to use a translator.)

    ReplyDelete
  2. Iarissak, great article. I hadn't opportunity to get commercial experience on Rails yet. Based on comparison that you provided, Rails looks even more promising and confirms my hunch on Rails. Thanks for sharing link.

    ReplyDelete