Grails and the World of Tomorrow


Published on

A look at the changing development landscape and how we may have to rearchitect our Grails applications.

Also looks at existing, new, or potential Grails features that can help navigate this new world order.

Published in: Technology

Grails and the World of Tomorrow

  1. 1. Grails and the World of TomorrowPeter LedbrookVMwaret: @pledbrookg: +PeterLedbrooke:
  2. 2. NoSQL HTML5.js Concurrency SocialCloud 2
  3. 3. HTML5.jsWeb sites ApplicationsServer-side HTML Client-side HTMLLow interactivity High interactivityNo offline Offline Wikipedia Twitter 3
  4. 4. HTML5.js We’re going this way!Web sites ApplicationsServer-side HTML Client-side HTMLLow interactivity High interactivityNo offline Offline REST + JSON Backbone.js + Moustache Is this the end for GSP? 4
  5. 5. NoSQLData the way you want it! 5
  6. 6. NoSQL “Everyone has interesting data” Some guy 6
  7. 7. Social 7
  8. 8. Cloud Ephemeral Easy instance filesystems creation Service-oriented architecture 8
  9. 9. Concurrency Responsiveness Lots of concurrent users What about all those cores? Node.js/Vert.x & the Reactor pattern 9
  10. 10. 10
  11. 11. Where do we go from here?• Has CRUD still got legs?• Does even MVC still make sense?• Or do we need to fundamentally change the way we write apps? What can Grails do for me? 11
  12. 12. A typical Grails app HTTP Controller View Service GORM/Hibernate Database 12
  13. 13. A typical Grails app HTTP Sticky sessions OSIVI Controller ViewDomain class binding Domain Service objects GORM/Hibernate Relational/object Database impedance mismatch 13
  14. 14. Fit for purpose?• CRUD has its place – Admin UIs – Quick UIs for complex domain models• CRUD = dynamic scaffolding• But beyond CRUD...• ... what about MVC + ORM? – Rich UIs + REST don’t need views – Do UI forms match domain classes? – Do views require the same information as updates? – How do we track changes to data? – Where should validation occur? 14
  15. 15. A typical Grails app HTTP Disable OSIVI? Controller View Command objects? Don’t let HTTP session and Hibernate session mix? Bind COs to Service @Cacheable, not domains? 2nd-level cache?importFrom(Domain) GORM/Hibernate Filtering and transforming data Database 15
  16. 16. Introducing CQRSUpdates Store changes Concurrency via event bus Views Separate data stores for queries 16
  17. 17. Is it too complex?• PaaS makes it easy to use multiple data stores• Event bus allows for decoupling – Easier to understand than Hibernate events – Search “mirroring” would work! – Easily extended to external message broker – Synchronise multiple instances of same app on PaaS• Querying and updating already separated – PluginService & PluginUpdateService in• Groovy good for data transformations Conventions and framework support to make it easier! 17
  18. 18. How can Grails help - Rich UIs? URL mappings for REST JSON & XML converters Resources (for JS & CSS) Plugins for different UI libraries 18
  19. 19. How can Grails help - NoSQL? GORM plugins JSON handling Schemaless + dynamic lang = good! 19
  20. 20. How can Grails help - Social? Spring Social plugin, etc. Authentication via plugins 20
  21. 21. How can Grails help - Cloud? Simplified deployment with plugins Plugins for PaaS services Runtime config 21
  22. 22. How can Grails help? 22
  23. 23. How can Grails help? Plugins 23
  24. 24. How can Grails help? Plugins 24
  25. 25. How can Grails help? Plugins 25
  26. 26. How can Grails help? Plugins 26
  27. 27. Plugin platform Events Security UI Injection Conventions Config 27
  28. 28. Plugin platform Events Security 28
  29. 29. Plugin platform Events Security • Event bus • API + SPI • Can integrate with AMQP • Service • GORM events • Tags • App lifecycle events • Custom app events 29
  30. 30. Event bus Update Call REST Save entity Index read DBs serviceSpring Integration Event Bus AMQP Plugins Plugins Plugins Application 30
  31. 31. Summary• The way applications are architected will change – Websites will still be built (GSP not gone yet) – Not everyone will need the same architecture – Project archetypes and scaffolding!• Grails already has many of the features we need• Plugins can add those• Plugin platform provides more powerful integration – Event bus will enable more interesting architectures 31
  32. 32. More info• w:• f:• e:• t: pledbrook• b: 32
  33. 33. Q&A