Grails vs Rails vs Django -- Grails wins?
The web is built on three layers:
- Programming Languages (PHP, Java, Ruby, Python)
- Web Frameworks (Cake PHP, Grails, Ruby on Rails, Django)
- Content Management Systems(Drupal, Alfresco, Radiant CMS, Django-CMS)
Each layer has its time and place. Let's start with #1. Used to be that every site was built on JSP, ASP, and PHP. Now with web frameworks and CMS, using this layer to build a site is simply reinventing the wheel. As a result, this layer has been relegated to (1) non-web people trying to get started via a For Dummies book (aka, don't do it!), and (2) to-the-metal, scalability-intensive sites like Google and Yahoo, built on C or Java for per-line performance tweaking.
On the other side we have Content Management Systems. CMSs shine for sites that are common-place -- blogs, photo-galleries, shopping carts, google maps, etc. The reason for this is that a CMS is only as good as its extensibility framework, and the more common a feature the more likely a plugin has been built for the CMS. A CMS will get you an out-of-the-box, feature-rich, functional website in hours. 99% of websites should be built using a CMS, because its only 1% of the time you get something completely brand new -- like Yelp or Twitter in their time. When you do need something completely fresh, a CMS is limiting because of the restrictions its framework imposes. You end up using a lot of code, time, and xdebug to tweak a one-liner.
Enter web frameworks. I like to think of thes layers in a "careers" metaphore. Straight-PHP is like freelancing -- you're doing everyone's job, not getting much done, and don't have time for the tasks you enjoy. CMSs are like government jobs -- everything's taken care of for you, but there's so much yellow-tape that you'll never push the envelope on the simplest of features. Web frameworks are startups! You're going to be reinventing quite a bit to get started (authentication/authorization, shopping carts, etc), but once you've got critical speed the sky's the limit with your features creativity.
There are 4 main players on the market: Rails, PHP Frameworks, Django, and Grails (kinda in order of popularity). I'm going to try to compare these 4 as best as I can, but I only have real experience with Rails and Grails -- the others I've learned stuff from articles and recruiters -- so feel free to chime in!
| Fun/Hype/Community | Libraries/Plugins | Speed/Scalability | Jobs | Hosting | |
| Rails | Great | Great | OK | Many, OK $ | OK |
| Django | Meh | Good | Good | Few, OK $ | OK |
| PHP Frameworks | OK | OK | OK | Many, OK $ | Infinity +1 |
| Grails | OK | Great | Great | Few, Great $ | SUX, $$$ |
Rails
[For coffee + mac hipsters who want to live on the edge]
Pros:
- Rails is the most popular web framework around, hands-down. This means more plugins, more resources (tools, documentation, etc), more jobs (second only to PHP Frameworks), more meetups, etc.
- Rails hosting via Passenger is available on most shared hosts (including my favorite, Dreamhost)
Cons
- Rails was the first popular framework of its kind, which means it has growing-pains from which other frameworks learned. For example, it's a bitch to get simple authentication+authorization working in your Rails app, something that comes default with Django.
Django
[For linux geeks who constantly monitor htop]
Note: I don't know much about Django. Any takers?
Pros
- Python seems to have more mature libraries than PHP or Ruby, making it a more powerful solution.
- As I understand it, it's more performant in the model-layer than Rails
- A bit more CMS-leaning (what with built-in authentication/authorization, etc) than its competition, making it a more agile solution.
Cons
- Not as popular. From my experience, not as available of documentation, etc.
PHP Frameworks (Cake PHP, Codeigniter, Kahona, etc)
[For people who just want a job, in this market]
Pros
- As PHP is the most ubiquitous web language, so are PHP frameworks the most ubiquitous of its competition. Knowing CakePHP or Codeigniter is more likely to guarantee you a job, in my opinion, than any of the other web frameworks.
- Many of these frameworks (eg, Cake PHP) are almost as mature as Rails, making them a nice medium between resource-availability and job security
- Every shared host out there supports PHP!
Cons
- PHP tends to pay less, from my dialog with recruiters and employers.
- There are a lot of Frameworks to choose from, which are constantly leap-frogging eachother -- so get ready for analysis paralysis!
Grails
![]()
[For Java/enterprise gurus thinking about salary and retirement]
Pros.
- Grails is more performant (it's compiled) and scalable (it's Java) than its competition.
- It tends to pay the highest and have the best job security, based on discusions I'd had with recruiters and employers, plus Indeed.com salary comparisons and Dice.com postings. I think this is because of its Spring/Hibernate underpinnings -- an enterprisey, $$ foundation
- I think the most important Pro is that it plugs into enterprise architecture, making it very attractive to big business. This way you can have your cake and eat it too, by having web MVC agility & syntax sugar, without sacrificing Java/enterprise libraries, architecture, scalability, and talent.
Cons
- Expensive to host. Shared hosting won't cut it -- you'll need a VPS or Dedicated to sport your servlet container (eg, Tomcat)
- Probably the least popular in this comparison -- meaning fewer jobs (though those jobs tend to pay higher).
Conclusion: I think Grails makes the most sense. As a San Francisco resident, Rails is a must-know; so here I am, programming two projects side-by-side -- one in Rails, one in Grails -- thinking that Grails is just a shoe-in, with so many more benefits. I'm curious what other people, with more experience in these other frameworks, think?
[Edit: sorry for the comment settings, everyone.. don't know why it was set to read-only :s ]



Technology is just technology.
Guys,
Why do we start quarelling on technology? Taking sides in terms of the tech.
I guess there are only two bottom lines; Money and People.
From the business side, it doesn't matter what technology is used as long as the application is good to make money.
On the implementation side, its just the people. If you have the right people, technology doesn't matter, they will get it done.
Yes, there would be some differences of one tech with the other, like performance, speed of development, costs of infrastruter, etc. But then it's is always a matter of juggling with all these. And who juggles better, the better people.
I guess for every project, you must choose the people first (the best you can find/afford) and then select the technology that helps those the best (notwithstanding other dimensions).
Do you agree?
Sorry, I don't agree. I think
Sorry, I don't agree.
I think if you have the right people in place, then they are doing their do diligence in finding the best product for the task. Not only that but a lot of the time the product effects money!!! (Anyone who decide to use VMWare with the current vTax can atest to this).
If you are starting a web page today and your employees we comfortable with old style j2ee developer, and started a new project that way, you are going to be wasting a lot of time and money b/c development is a lot speedier with newer tools!!!
IMHO I would rather have technically people who are agile and able to move with the times. So we can choose the best product to use (at work I write j2ee/spring/hibernate and it was easy for me to pick up b/c I have previously used Rails and some .Net) but I think if you are a good programmer changes languages isn't that bad.
Django 10 - Java 0
I'm working with Java/Spring/Hibernate and I also make many Django sites.
Well, no doubt, Django wins. And it's really fast : no needs to *massive* spring-mvc instrospection/hack.
Django evaluation
I haven't seen any feedback from Django users so far, so I will chip in with my 2c. Was previously a PHP and Java framework (Cocoon) user, and am now a happy Django developer. I picked Django because its Python-based and seems to have more traction (at present) than other Python frameworks.
I think your evaluation of Django is a little off. Firstly, I would split Fun/Hype/Community into two: Fun/Hype and Community. In the former, Django is OK or Meh, but in the latter it is certainly Great. Secondly, you yourself said Python has "more mature libraries than PHP or Ruby" (which is true), and there is also a flourishing ecosystem of apps that make it very simple to add new features to your base project. For this reason I would rate Libraries/Plugins as Great. I cannot comment on whether or not Rails is really great as well; but I've seen a number of blogs where people have pointed out deficiencies.
Finally, there are an increasing number of CMS built on Django, which I believe offers the best of both worlds - fast and easy deployment of a "standard" website, plus access to Django power under-the-hood if needed and then, at the next layer down, access to a vast array of Python libraries. See for example, http://www.djangopackages.com/grids/g/cms/ .
django is fast
I have been coding in java for nearly 12 years. In my experience ,it is easier and faster to use django..The docs at djangoproject.com is the best.It is terse but complete.If I was to work on a legacy java project may be I will go for spring or some j2ee framework..but for a brand new project I prefer django
-sajan
Grails: New, unproven, and fighting for mindshare
I'm not sure where you got your salary/number of jobs info from. Rails has many more jobs than the others: http://www.indeed.com/jobtrends?q=rails%2C+grails%2C+django%2C+cake-php&l=
Indeed reports that grails developers make more money, but a quick look at the underlying jobs shows that they require extensive Java/J2EE experience (which is beyond the typical Groovy/Grails knowledge necessary to build Grails apps). Basically, if your an experienced Java/J2EE developer who CAN ALSO write Grails apps - you'll make the salaries reported. If not, good luck.
One other area which you really skimmed over is enterprise integration. Ruby can be deployed on a J2EE stack, via JRuby. In fact, this is what Thoughtworks has done, building all of their internal offerings on Ruby/Rails - but deploying to JRuby and Tomcat to take advantage of the JVM.
Finally, you really have to consider the Java/J2EE mindshare/community that Grails is fighting for a place within. With so many other choices (JSF2, Struts2, Tapestry, Wicket, SpringMVC, etc) - how is Grails going to keep up? It has less than 50 contributors, and since it can only run on the JVM - it's always going to fight an uphill battle to entice the Java community over to it's side.
It's difficult to call Grails a winner (in this eclectic mix) simply because it's so new, unproven, and doesn't have the community backing that Rails has. Ruby/Rails: Proven, endorsed by people like Neil Ford, Martin Fowler, Stuart Halloway - and well tested/understood. At this point, Rails does so much more, better, and has the momentum.
3 years of Ruby/Rails at Thoughtworks: http://martinfowler.com/articles/rubyAtThoughtWorks.html
Genomes on Rails: http://www.slideshare.net/mza/genomes-on-rails-486498
(and seriously, I've not had any problems with Authentication - role based or not. That comment seems erronious)
Huh?
I'm not sure I follow. Grails is going to struggle against other J2EE frameworks, specifically because it only runs on a JVM?
My feedback
I am a big fan of Java, and have recently learned Grails, but I must admit, as compared to PHP for web 2.0 applications, here I feel Grails have a few downsides:
(1) Immature debugger, it is very difficult to debug in Grails, while PHP has a good debugger
(2) PHP support dynamic updates, by that what I mean is that in web 2.0 applications, the application should be live 24 by 7, so in PHP, you can easily update and add functionality without bringing down the server, while in the case of Grails, certain changes still require restart
(3) Lack of low-cost webhosting options for Grails. Which means Grails is best for enterprise, but for other web 2.0 applications, it means a high investment on dedicated servers just to launch a website.
Other than those factors, I feel that Grails is really great!
Let me try to understand
Let me try to understand this... your are trying to compare programming languages VS frameworks?
WTF? Srsly, you just can't compare a full featured framework against a plain language, it's just not fair, a framework is build on top of a language adding a bunch of librarys, APIs, best practices, etc. to the already available functions of the language.
If you're going to do a language AND a framework comparation you should take in account not only the language but also the focus of the framework, there are lots of frameworks for java: Spring, Struts, Tapestry... each one with it's own purpuse. Groovy it's not even a programming language, it's another Java framework.
And for PHP you got Symfony: agile, scalable and enterprise. There is also CakePHP, Zend and a bunch more, try using some of those before trying to rant on PHP.
Groovy is not a language???
Dude, seriously??? Groovy extends java.lang.Object. It's an extension of the java LANGUAGE. Groovy is Java and much, much more. Do some homework before publishing "WTF" statements in people's posts.
Now, along that line, Groovy is the primary language of the Grails framework, just like Ruby is the primary language of Rails. Grails also has the benefit of being able to run on the JVM. Now, Ruby can as well with JRuby, but Grails has the benefit of sharing a similar syntax as Java. This is pure speculation on my part, but I think the reason you don't see as many Grails jobs is because people are still waiting to make the jump from Java. However, it will happen. With Grails being built upon the Spring framework, it's only a matter of time before people realize what the Rails community already knows; Java is heavy and outdated. I just don't see enterprise sites dumping their java infrastructure to adopt Rails when Grails offers much less of a gap to bridge in terms of training and emotional commitment.
Ultimately, you're going to pick the right tool for the job, but when deciding which framework is going to lead the future, don't let personal biases cloud your vision. Companies are going to typically pick the path of least resistance when it comes to upgrading their stacks. In the enterprise world, this means Spring will transition to Grails with Groovy, Scala, or (I hope not) Java running the back end. I know people love Rails (I think it rocks too!), but I don't see CxO's throwing out years of infrastructure because the world thinks one framework is better than another. In the enterprise world, money talks...
You're totally right,
You're totally right, neo_rok. I was less versed when I wrote the article (sorry if I misled anyone), and I revised it since. Thanks for the feedback!
Grails is built on top of and
Grails is built on top of and is part of the Java platform meaning it's very easy to integrate with Java libraries, frameworks and existing code bases. The most prominent feature Grails offers in this area is the transparent integration of classes which are mapped with the Hibernate ORM framework. This means existing applications which use Hibernate can use Grails without recompiling the code or reconfiguring the Hibernate classes while using the dynamic persistence methods discussed above.
One consequence of this is that scaffolding can be configured for Java classes mapped with Hibernate. Another consequence is that the capabilities of the Grails web framework are fully available for these classes and the applications which use them.
Alex | Web Hosting Reviews | Hosting Coupons
asp.net
what about asp.net?
i've done my projects in rails and zend framework now for years. then i've started asp.net. i'm pretty shure after a few weeks working myself into asp.net 4.0 i won't use anything else anymore.
c# feels like a better java and the big plus is just the IDE. visual studio does everything for you!! you can focus on what you have to program and not how to do it.
cheers
asp.net ?!
Hey, ASP dude, you convinced me. Run your ASP on my Solaris now. But if you can't, go away or I will replace your miserable existence with a little shell script.
been smoking asp crack
seriously asp? what!
yeah lets get vendor lock in man, it rocks!
scalable hosting and a plethora of supported platforms, na choice sucks, its just more to think about!
open community and inovation, who needs that anyway, m$ will do what we want and get it right, inventively, surely, wont they?
choice of tools, ide's, scm options and open standards, visual studio is the best thing ever man, it like totally integrates with source crap who needs git and widely accepted industry standards anyway, m$ can make there own
yeah thats why I want to use asp.net
ASP.NET MVC +1
Don't knock it till you've tried. it.
ASP.NET MVC is Rock solid, great performance and the best tools in the business. Every GOOD hosting company provides windows as an option at the same price as Linux, it's supported on Amazon Web Services and Azure.
It WILL run on Linux on Mono.
It's not for everyone for sure, but don't go prejudicing yourselves just because of naive fanboyism.
MVC 5 years too late
Lets see it only took MS 8 years to figure out it needed MVC for web development while everyone else had it already? And their first version out of the gate is something from 10 years ago; you are using an MVC framework that I thought might have been useful in 2003... but by modern MVC standards of Rails, Grails, Django, etc, ASP MVC is archaic.
Seriously, get your old school stinky MS butt back to your GUI based development tool and start clicking those buttons before I beat your ass.
Schwarzenigger
Are you serious? You 've spent years doing grails and now you go to asp.net ??
What pills are you on ?
Both are great...
Both technologies are great - it just depends on what your requirements are...
There are places where .NET is the only environment you can use. Somewhere else you'll find people that when asked about .NET will throw up like you guys here. It all depends on what the company you're working in uses.
Or if you're writing some site for yourself go ahead with PHP and be happy :)
I'll stick to Grails for now - it rocks in productivity and ease and with the recent version of STS it also has very good IDE support :)