Play vs. Grails: Which One Is Better Than Ruby on Rails?

by Kirill GrigorchukNovember 25, 2011
Overviewing the capabilities of the frameworks, the blog post provides a detailed analysis of Play and Grails, as well as compares them to Ruby on Rails.

In pursue of the latest technologies and trends, experts at Altoros came across Play, a framework used for building web applications with Java and Scala. Our developers dug into the technology’s capabilities and compared it with Grails, a Groovy-based web application framework built for a Java Virtual Machine (JVM). In addition, the article features some thoughts on using both frameworks vs. Ruby on Rails.


Comparing both frameworks


Play actively extends Java capabilities with third-party technologies.

  • There is no need in creating an internal domain-specific language in Java. To enhance the existing XML-based configuration, you can add a custom configuration format with Play.
  • To efficiently interact with Java command-line arguments, you can add a Python configuration.
  • The technology allows for developing your own object-relational mapping with standard SQL queries.
  • With Play, you can create a custom Java template engine.

The main difference between Play and Grails lies in their approaches. By contrast, Grails attempts to take over the existing Java technologies, such as Hibernate and Spring. The framework aims to build a Rails-like shell over ready-to-use Java libraries. As the technology operates on top of a JVM, you can freely use standard Java libraries.

Programming language

Grails is written in Groovy, while Play works with Java flavored with Groovy in the templates. You can also try Scala or Clojure as first languages. However, both frameworks require basic knowledge of Groovy. So, a Java developer will have to learn a Rails-like language.

In general, Grails seems to be more stable and enterprise-level due to its connection with Spring and a powerful community. Play is riskier for production-grade solutions, if compared to out-of-the-box Grails.


Both frameworks have strong communities behind them. Thus, most projects built on top of Play and Grails have plug-ins/modules for Redis, MongoDB, etc., satisfying all software standards.


Grails and Play vs. Ruby on Rails

Being ahead of the competitors, Ruby on Rails is hard to be compared to. A developer can use JRuby and, thus, switch to a JVM. If you need ready-to-use Java capabilities, go with JRuby instead of using Play or Grails. As both frameworks have Ruby-similar APIs and languages, it might be reasonable to start with Ruby on Rails.


Further reading


The post was written by Kirill Grigorchuk with assistance of Alexander Kuntsevich.