Thursday, January 10, 2008

Grails Making Java Developers Forget about Rails

In 10 reasons to switch from Rails to Grails

Here is another 10:

1. A view technology that doesn't suck
2. Mixed source development made easy with the Groovy joint compiler (no falling back to C to solve those performance problems ;-)
3. Built in support for rich conversations with Web Flow
4. Grails 1.0 coming out within the month
5. IntelliJ's JetGroovy Plug-in
6. A rich plug-in system that integrates Grails with technologies Java people care about like GWT, DWR, JMS etc.
7. A buzzing and growing community with a larger traffic mailing list as opposed to a stagnating one
8. Built on Spring, the ultimate Enterprise Application Integration technology
9. A Service layer with automatic transaction demarcation and support for scopes
10. More books coming and being adopted by enterprise organisations near you


The Relevance guys have chipped in! They've gone ahead and neatly organised my points, good job. Let's deal with the ones under the "Crap" section:

Grails 1.0 coming out -
Ok fair point not a reason to choose Rails over Grails, unless stable release numbers is an issue for you

Built on Spring -
To put this one under crap sadly misses the point by a million miles. Rails has zero enterprise penetration, let's put that out there right now. Grails on the other hand has enterprise penetration and is only growing. A large part of this is the Spring toolkit which solves more enteprise problems than you can shake a stick at.

The comments on the Relevance blog back this up. Rails' attitude of openly shirking the enterprise has left a big gaping whole that Grails is happily filling. And finally for a Rails guy to call Spring a leaky abstraction is a little rich.

A Buzzing and Growing Community -
I'm not arguing that Rails has a smaller community, merely that it has plateaud, whilst Grails has no where near reached that point and has the potential to go much much further. Watch this space.

More books coming -
See above, even though I don't regard Grails as second best now for those that think that we won't be second best for long trust me ;-)


tug said...

And another book on the way

bewhite said...

1. ..that doesn't suck, have no differences from Rails helpers/layouts/partials and uses lovely XML in every possible place.
2. Rails have no performance problems. Maybe you have but you are not the whole Rails community.
4. Is it still 'beta'? So what we are talking about?
5.In the Rails you have NetBeans or RadRails that are completely free while IJI costs 500$ for each organisation. In the NetBeans you have numerous plugins and gems. Don't like rich IDE? Then you can use vim, textmate , gedit or whatever you like.
6. Take a look at point 5.
7. And what? A lot of emails means that Grails community have a lot of questions while Rails community have all needed answers and may simply work.
8. Does 'Enterprise' means 'few more configuration XML and another one possibility to get more money from client'?
9. In the Rails there is
Model.transaction do
puts 'Don\'t panic. We are in transactional control here!'
10. PickAxe and AWDWR is enough for beginning in Rails. Then you can read Recipes and other books.

So, sorry but I'll stay at Rails.

Graeme Rocher said...

oh you guys are so touchy, fun ;-)

tug said...

"Rails have no performance problems"

You just have to admire these guys.


Unknown said...

Yes, Grails is pretty good, but Rails have Ruby. Stuff like {-> and lots of {{}} really freaks some people out)

Graeme Rocher said...

Yeh but we're not too bothered about freaking ex Perl programmers out ;-)

Anonymous said...

If I understand it correctly, then in Rails you generate the models initially by reading in database tables; in Grails, you define your domain class and then Grails generates everything, including the database tables. If that is true, then to me this is the biggest advantage - I argue that more people (especially beginners), maybe all, can write a domain class in Grails than creating proper database tables for Rails. But maybe you can also start with a domain class in Rails...

bewhite said...


My first Rails website was deployed at the Dreamhost. Dreamhost is shared hosting with Apache+FCGI. It is exactly what you should NOT to use as hosting for Rails projects.

So these guys are just like people who have tried to buy car for $1 and after deal signing begin to wonder that their new car have three wheels and engine from lawn-mower :)

Kaveh Shahbazian said...

Just about performance:
Java should not speak about this one! And if you are talking even about Java 7; just wait for Ruby 7!
(I do C# and hate C# and Java; Ruby is fine; best is scheme(or parenthesis-less dialects of it like Dylan, Goo or REBOL. So I am not a Just-Java-Hater).
Cheers! ;)

Graeme Rocher said...

Err why should Java not talk about performance when it blows most languages besides things like C and Fortran out the water?

In addition Ruby is the same age if not older than Java. Fact is Ruby and Groovy will never be as fast as languages like Java by design even when Ruby 7 comes out.

With Groovy you drop back to Java when you need performance, with Ruby you drop back to C which is a whole bundle of fun.

Emmanuel Pirsch said...

You're a funny man... your mailing list link is not even sorted by date. If you sort by date, Rails have more recent results. And then if you take a deeper look, ( you see than Rails has fare more posts than Grails (

Also, Rails can be run on JRuby. So the mixed source argument is wrong.

As for views, you can plug your own way of doing it in Rails. Rails also has a rich plugin system (I guess with far more plugins than Grails).

There are more Rails books available than upcoming Grails books.

Anyway... These kind of posts are irrelevant childish piece of crap... From whatever camp they are coming from. They are not based on anything beside the authors opinion.

You post far more interesting pieces when your are not comparing Grails with Rails.

Graeme Rocher said...

Well its great to stir up a response everynow and then too, if just to see the agro it creates ;-)

Thanks for the correction on the mailing lists, although your two links don't seem to compare anything.

I couldn't figure out a good way for nabble to give me this info. I'm hoping that Grails will be added to this category:

Which would give us more accurate stats (Note wicket is currently outstripping Rails by a long way).

As for JRuby, JRuby doesn't support mixed source development at the moment.

It allows you to call Java from Ruby, but going the other way and have circular dependencies is either hard or impossible.

Emmanuel Pirsch said...

First link displays : "Found 162511 matching posts for grails OR rails in Ruby on Rails in about 111726 threads. Showing threads 1 to 10. "

Second link displays : "Found 26528 matching posts for grails OR rails in codehaus - grails in about 4783 threads. Showing threads 1 to 10."

Thats more that 161K posts in the Rails forums compared to 26k in the Grails forums.

Anyway... I don't think these kind of non-scientific comparison are really relevant.

Graeme Rocher said...

I'm not interested in total volumes, Rails has been around nearly 3 years longer than Grails.

I'm interested in activity numbers, so daily/monthly volumes

Emmanuel Pirsch said...

Then, with the previous links, if you limit the query to the last month...

Found 6834 matching posts for grails OR rails in Ruby on Rails within past month in about 5782 threads. Showing threads 1 to 10.

Found 1808 matching posts for grails OR rails in codehaus - grails within past month in about 568 threads. Showing threads 1 to 10.

So there are more than 3 times more post in Rails forums than Grails forums.

And the numbers are 17984 / 5482 for the past three months. That's also more than 3 times.

Anonymous said...

Check out what made this fella switch from Rails to Grails:

Graeme Rocher said...

Thanks for the clarification Emmanuel, well... we're growing and we'll get there it is only a matter of time

Anonymous said...

This is not an argument over rails as i have never used it. But one of the many many reasons i use Grails is simply this:

The project structure is decided for you and done in a most elegant way. This enables myself and my peers to simply build the application. Rather than spending time deciding on who has the best ideas for laying out project structure (too many tech lead guys). Essentially this also means all grails projects look the same which is fantastic for hitting the ground running. Don't re-invent the skeleton :)

I would actually like to see this taken even further. When you create a controller/view then you also get a dedicated directory created under css to hold the css for the pages related to that controller and maybe images too.

Keith Donald said...

Spring, a leaky abstraction? That's the funniest thing I've heard in awhile.

Anonymous said...

Somewhat off-topic, but how well does Grails and Maven2 play together? I love to hate Maven sometimes, but overall I've gotten used to it. I'd like to think they work together, but I'm not finding much on Google...

Anonymous said...

Oh, never mind, I saw your entry complaining about Maven, and I also found the Maven2 plugin project for Grails.

Federico Grilli said...

Grails is better than Rails because Graeme Rocher is handsomer than David Heinemeier Hansson!
Jokes aside, as a JEE developer, I find Grails more attractive for the very simple reason that you can *reuse* all the good Open Source software running on the JVM that has been written, tested and enhanced for more than a decade now.

Christian Rivasseau said...

I'd rather fallback to java's incredible set of open-source libraries and IDE refactoring support, than to C, and that's why scripting the JVM is the future.

This is exactly the reason why rails si written in plain ruby while grails "low level" is java. And that shows : any rails application even the simplest hello world suffers from this little not killing but annoying lag, where grails does not. Period.

JRuby ? sure but I'd rather put a lot of effort getting JRuby on Grails, or any other java framework, (as it has been discussed ealier in this blog) than running plain ruby rails.

Brian Ketelsen said...

Interesting list, but wanted to correct the part about Rails and enterprise penetration. We're a Fortune 500 company and we've standardized on Rails for all external and internal web development. Check out - and don't tell me that Rails doesn't scale.

Marcin Domanski said...

In my opinion, Rails still wins this battle, for one particular reason: testing is much better. I haven't looked at Grails for a while, but after a quick 'test' I've just done I can tell that testing in Grails hasn't changed much. It still takes over 10 sec to run a single, very basic test (at least on my 2.4GHz MBP), which compared to 3 sec in Rails is really slow. Maybe it's not Grails but more Groovy that makes it slow, I don't know. One way or another, Rails is far more productive here.

And one more thing - the learning curve. How many tutorials/books should one read to actually become an expert in Grails? I am afraid it would not be enough just to read one book on Grails. One should know Spring, Hibernate, Lucene etc., basically the whole enterprise Java stack! That's why I think Grails would mainly be used by Java developers with some previous experience. It may just sound to scary for the others.

Anonymous said...

I have to agree with marcin. Testing in Grails is no where near as fast and easy as in Rails. In textmate I can do CTRL-R to run my test - even SHIFT-CTRL-R to jusr run my one test method my cursor is inside. Very fast and easy to bounce around.
Also, why is stdout not sent to the console in tmy tests? When I put in println "PRINT THIS", it's not sent to the console? Instead it's put in some target test file. Maybe I'm missing a configuration, but I would assume output would be sent to stdout in tests.
It just seems like Rails is really more TDD and RAD than Grails. Don't get me wrong, Grails already has a huge market because I do think most Java programmers will switch to it and probably Grails has a good chance of winning the battle down the road in a few more years, but there are just too many things that slow me down when using Grails at this time. I felt so liberated when I got out of Java and started using Ruby. And using Grails is a step (albeit a small step) back to where I just left.

Anonymous said...

I totally agree with Marcin and goforth, testing with Grails sucks in terms of speed. You just can't work the 'code a little, test a little' way with it.

To be honest, JRuby suffers from the same problem, but last time I checked it felt quite a bit faster in terms of start up time when running tests. Still nothing compared to pure Ruby/Rails, where I can hit F12 in VI to execute a single test method I'm working on, see it run and am right back to work.

sandofsky said...

Could you please define enterprise? Lots of employees? Lots of traffic?

According to your linked-in profile, the largest company you've worked for had 200 employees. We have nearly 1000.

Traffic? Sites say we got
17 million uniques in December.

And we're part of AT&T. Can you get more enterprise?

I think Rails has enterprise penetration.

Graeme Rocher said...

@marcin and goforth

Thanks for this feedback, we're continuing to try and improve the speed of Grails and plan to implement continuous testing for the next release which should improve things greatly

@brian and @sandofsky

Congrats to you guys to having the flexibility to move your enterprises to something like Rails.

However, you're in the minority I can tell you that.

As for who I have worked for, LinkedIn profiles don't tell the full story. I've been a consultant for 5 years across different companies and worked for pretty much every major bank in the UK each of which have 10s of thousands of employees

I've also worked for many government organisations, telecoms giants and in the pharmaceutical industry

Graeme Rocher said...

Just an update to this, Grails has been added to the Web Development Category on Nabble:

Apparently we have the busiest mailing list after all. Or am I mistaken again?

Anonymous said...

Rails: not interesting, not interested.

As a Java developer with significant experience, Groovy/Grails has the shortest path to productivity for me. It's often about the libraries and tools and Java's got them.

So, does anybody give a hoop about Rails? --I don't.

Good going Graeme. Grails rocks...I will soon prove when I launch --about two-months work --all Grails!!!!

SocialThumbs will let the crowds decide on a dilemma by weighing the pros and cons. Perhaps we can set up a Grails/Rails dilemma, just to prove the point what's best.

April is launch date...


Anonymous said...

Wow! So much work just to clone Rails. Would be much more productive to spend the time improving rails, than copy it in another language?

Graeme Rocher said...


You obviously haven't tried Grails.

Anonymous said...

I'm coming a bit late into this discussion but I actively use both Rails and Grails and find both have their advantages and shortcomings.

I prefer Rails' database-centric models. I find Grails' dynamic creation of database tables to be finicky and has a tendency to not work where it ought to. Also Rails' migrations give a lot of control over the DB schema without having to write any SQL.

For example, inheritance simply doesn't work in grails. If I have a domain class extend from another, grails table-per-hierarchy mapping tries to create a table with the name of the parent class. Well if I have two classes extending from the same parent class this results in all the properties from all three classes getting dumped into the same table. I can write the domain using Hibernate's @MappedSuperclass annotation, but if I have to write the domain in Hibernate, why am I using Grails? (well, because of the URL mapping, nice templating, and controller logic, but you get the point)

Also, Grails lacks some features of Rails that I use all the time; the only equivalent of Rails' URL helper is available as a GSP tag. Well, I'd like to provide a link in my REST web services to drill down to a detail view from a list, but I have to generate the URL manually, eliminating the excellent loose-coupling provided by the URL helper.

On the other hand, Grails' service layer, while simple, is something I miss in Rails. I implement service methods as static methods in Rails' models, but I would much prefer to relocate it to a separate source file.

I also would never have any chance of using Rails at work where our applications are based on a J2EE stack with wayyy too much code for it to be worth rewriting the core system. Grails will integrate with this MUCH better than Rails.

When I'm in a situation where my deployment resources are limited (no Java server available) I use Rails. Otherwise it's Java.

Graeme Rocher said...


couple of points

a) GSP tags are callable from controllers, just like Rails helpers. For your usage you can call createLink(..)
b) Grails supports what you want to do without Hibernate mapping. To do your inheritance mapping add

static mapping = {
tablePerSubclass true

To the parent class

Also if you have any suggestions for improvements feel free to raise a feature request on JIRA

Brent said...

OK, so I really like grails, but I really miss my server side scripting. When can I have my server side scripting for Ajax?

Anonymous said...

good post

Anonymous said...

It is the holic gold which makes me very happy these days, my brother says holic money is his favorite games gold he likes, he usually holic online gold to start his game and most of the time he will win the cheap holic gold back and give me some holic online money to play the game.
I am so happy to get some kal geons and the kal gold is given by my close friend who tells me that the kal online geons is the basis to enter into the game. Therefore, I should kal online gold with the spare money and I gain some kalonline Geons from other players.

Anonymous said...

搬家 搬家 搬家公司 搬家 搬家 票貼 借款 徵信社 徵信 補習班 多益 留學 在職進修 婚紗 補正下着 新娘秘書 汽車旅館 室內設計 室內設計 中古車買賣 植牙 坐月子 婚禮佈置 催眠 派報 漆彈 視訊會議 真空成型 Shade sail nike shoes MBA 在职研究生 在职博士 關鍵字廣告 租屋 花蓮民宿 花蓮民宿 花店 花店 花蓮民宿 租房子 xo醬 牛軋糖 牛嘎糖 代償 房屋貸款 信用貸款 失眠 減肥 糖尿病 日立家電 外遇 離婚 抓姦 外遇蒐證 外遇抓姦 侵權 仿冒 應收帳款 工商徵信 徵信 徵信社 外遇 徵信 徵信社 外遇 电动隔膜泵 自吸泵 化工泵 离心泵 磁力泵 螺杆泵 水泵 隔膜泵 气动隔膜泵 白蟻 花蓮民宿 美國留學 新娘秘書 汽車旅館 新娘秘書 催眠 花蓮民宿 搬家 搬家服務 搬家保障 搬家網 搬家估價 徵信 徵信的意義 徵信服務 徵信報導 徵信問答 徵信知識 婚禮佈置 婚禮佈置 票貼 工作服 班服 團體服 糖尿病 勞工體檢 呼吸照護 資源回收 生日禮物 美國遊學 留學代辦 彩妝造型 新娘秘書 宜蘭民宿推薦 催眠 漆彈場 太陽能熱水器 減重 自助洗衣加盟 綠豆椪 床墊 創業加盟 資源回收 鋼戒 廢車回收 創業加盟 龍眼蜜 買房子 買房子 班服配件 團體服配件 團體服 班服 團體服 班服 團體服 眼鏡 創業加盟 室內設計公司 室內設計公司 室內設計公司 最好的婚禮佈置,婚禮佈置花園感官花園婚禮佈置,婚禮佈置最新消息,婚禮佈置專業多元化,為你量身定作完美婚禮佈置,完美的婚禮佈置請來感官花園。婚禮佈置時間雙休請來電預約,婚禮佈置周五正常營業。婚禮佈置地點遼寧街,婚禮佈置聯絡方式電話。婚禮佈置訂購方式,婚禮佈置請提前兩天通知,婚禮佈置請先完成付款及傳真或郵件傳送匯款單。婚禮佈置免費外送價格,婚禮佈置請參考列表。