Grails vs Rails vs Django -- Grails wins?

The web is built on three layers:

  1. Programming Languages (PHP, Java, Ruby, Python)
  2. Web Frameworks (Cake PHP, Grails, Ruby on Rails, Django)
  3. 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 ]

Comments

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.

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