Posts Tagged ‘UberTracks’
[DevoxxFR2013] Play Framework vs. Grails Smackdown: A Head-to-Head Comparison Through Real-World Development
Lecturers
James Ward is a professional software developer since 1997, currently at AWS, dedicated to helping teams build effective applications. With experience across mountains of code and literal peaks, he shares discoveries through presentations, blogs, and demos. Previously a Technical Evangelist at Adobe and Typesafe, he focuses on scalable, reactive systems.
Matt Raible is a Java Champion and Developer Advocate, renowned for building web apps since the web’s dawn. Founder of AppFuse, author of Spring Live, and committer on Apache Roller and Struts, he has spoken globally on open-source adoption. His roles span UI Architect at LinkedIn, Evite.com, Time Warner Cable, and Oracle, emphasizing practical, performant solutions.
Abstract
James Ward and Matt Raible pit Play Framework against Grails in a comparative showdown, building identical “UberTracks” apps to evaluate productivity, performance, and ecosystem. Through lines of code, deployment simplicity, and scalability benchmarks, they dissect strengths: Grails’ convention-driven ORM versus Play’s reactive, stateless design. The session weighs server-side rendering, JavaScript integration, and backward compatibility, offering developers empirical guidance for framework choice in modern JVM web development.
Origins of the Smackdown: Hype Meets Hands-On Evaluation
Ward and Raible conceived this comparison amid hype surrounding full-stack JVM frameworks. Grails, leveraging Groovy’s conciseness, had dominated rapid development; Play, with Scala/Java options, promised superior performance and reactivity.
They built UberTracks—a music tracking app with user registration, OAuth, search, and social features—to benchmark real-world scenarios. This neutral app avoids framework biases, focusing on core web tasks.
Productivity Showdown: Lines of Code and Development Velocity
Grails shines in CRUD generation via scaffolding, minimizing boilerplate. Raible’s version clocked fewer lines overall, thanks to Groovy’s syntax sugar.
Play demands explicit controllers and views but excels in hot-reloading and type safety. Ward’s iteration emphasized Play’s compile-time checks, reducing runtime errors.
Both support rapid prototyping: Grails with grails generate-all, Play with activator new. Deployment to Heroku proved seamless for both, though Play’s statelessness eased scaling.
Performance and Scalability: Throughput Under Load
Benchmarks favored Play: higher requests/second in JMeter tests, lower memory footprint. Grails’ Hibernate sessions introduce state, complicating clustering; Play’s Akka integration enables reactive, non-blocking I/O.
Raible noted Grails’ plugin ecosystem for caching (Ehcache) mitigates issues, but Play’s built-in async support provides edge in high-concurrency scenarios.
Ecosystem and Community: Plugins, Documentation, and Job Market
Grails boasts 900+ plugins, covering security (Spring Security), search (ElasticSearch), and social (Spring Social). Documentation is exemplary, with books and tutorials abound.
Play’s ecosystem grows rapidly, emphasizing modularity via Typesafe Stack. Ward highlighted reactive manifesto alignment, fostering microservices.
Job trends show Grails’ maturity but Play’s ascent, particularly in startups.
JavaScript Integration and Modern Web Patterns
Both frameworks accommodate AngularJS or Backbone for SPAs. Raible’s Grails app used Grails-Asset-Pipeline for minification; Ward’s Play version leveraged WebJars.
Server-side templating—GSP in Grails, Twirl in Play—handles SEO-friendly rendering. Play’s JSON APIs pair naturally with client-side MV*.
Backward Compatibility and Maintenance Realities
AppFuse’s history informed this: Grails maintains smooth upgrades; Play 2.0 broke from 1.x, but migration guides exist. Raible praised Grails’ semantic versioning; Ward noted Play’s evolution prioritizes performance.
Conclusion: Contextual Winners in a Diverse Landscape
Raible and Ward conclude neither dominates universally. Grails suits data-heavy enterprise apps; Play excels in reactive, scalable services. Developers should prototype both, weighing team skills and requirements. The smackdown underscores JVM’s web strength, with both frameworks advancing the field.