grails and the world of tomorrow

33
Grails and the World of Tomorrow Peter Ledbrook VMware t: @pledbrook g: +PeterLedbrook e: [email protected]

Upload: peter-ledbrook

Post on 10-May-2015

2.368 views

Category:

Technology


3 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Grails and the World of Tomorrow

Grails and the World of Tomorrow

Peter LedbrookVMware

t: @pledbrookg: +PeterLedbrooke: [email protected]

Page 2: Grails and the World of Tomorrow

2

Cloud

NoSQL

CloudCloud

HTML5.js

SocialConcurrency

Page 3: Grails and the World of Tomorrow

HTML5.js

3

Web sites Applications

Server-side HTMLLow interactivityNo offline

Client-side HTMLHigh interactivityOffline

Wikipedia Twitter

Page 4: Grails and the World of Tomorrow

HTML5.js

4

Web sites Applications

Server-side HTMLLow interactivityNo offline

Client-side HTMLHigh interactivityOffline

We’re going this way!

REST + JSON

Backbone.js + Moustache

Is this the end for GSP?

Page 5: Grails and the World of Tomorrow

NoSQL

5

Data the way you want it!

Page 6: Grails and the World of Tomorrow

NoSQL

6

“Everyone has interesting data”Some guy

Page 7: Grails and the World of Tomorrow

Social

7

Page 8: Grails and the World of Tomorrow

Cloud

8

Ephemeral filesystems

Easy instance creation

Service-oriented architecture

Page 9: Grails and the World of Tomorrow

Concurrency

9

Responsiveness

Lots of concurrent users

What about all those cores?

Node.js/Vert.x & the Reactor pattern

Page 10: Grails and the World of Tomorrow

10

Page 11: Grails and the World of Tomorrow

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?

11

What can Grails do for me?

Page 12: Grails and the World of Tomorrow

A typical Grails app

12

Controller View

HTTP

Service

GORM/Hibernate

Database

Page 13: Grails and the World of Tomorrow

A typical Grails app

13

Controller View

HTTP

Service

GORM/Hibernate

Database

OSIVI

Domainobjects

Relational/object impedance mismatch

Domain class binding

Sticky sessions

Page 14: Grails and the World of Tomorrow

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

Page 15: Grails and the World of Tomorrow

A typical Grails app

15

Controller View

HTTP

Service

GORM/Hibernate

Database

Command objects?

Bind COs todomains?

importFrom(Domain)

Disable OSIVI?

Filtering and transforming

data

@Cacheable, not 2nd-level cache?

Don’t let HTTP session and Hibernate session

mix?

Page 16: Grails and the World of Tomorrow

Introducing CQRS

16

Updates

Views

Concurrency via event bus

Store changes

Separate data stores for queries

Page 17: Grails and the World of Tomorrow

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 grails.org

• Groovy good for data transformations

17

Conventions and framework support to make it easier!

Page 18: Grails and the World of Tomorrow

How can Grails help - Rich UIs?

18

URL mappings for REST

JSON & XML converters

Resources (for JS & CSS)

Plugins for different UI libraries

Page 19: Grails and the World of Tomorrow

How can Grails help - NoSQL?

19

GORM plugins

JSON handling

Schemaless + dynamic lang = good!

Page 20: Grails and the World of Tomorrow

How can Grails help - Social?

20

Spring Social plugin, etc.

Authentication via plugins

Page 21: Grails and the World of Tomorrow

How can Grails help - Cloud?

21

Simplified deployment with plugins

Plugins for PaaS services

Runtime config

Page 22: Grails and the World of Tomorrow

How can Grails help?

22

Page 23: Grails and the World of Tomorrow

How can Grails help?

23

Plugins

Page 24: Grails and the World of Tomorrow

How can Grails help?

24

Plugins

Page 25: Grails and the World of Tomorrow

How can Grails help?

25

Plugins

Page 26: Grails and the World of Tomorrow

How can Grails help?

26

Plugins

Page 27: Grails and the World of Tomorrow

Plugin platform

27

Events

Injection

Config

UI

Security

Conventions

Page 28: Grails and the World of Tomorrow

Plugin platform

28

Events Security

Page 29: Grails and the World of Tomorrow

Plugin platform

29

Events Security

• Event bus• Can integrate with AMQP• GORM events• App lifecycle events• Custom app events

• API + SPI• Service• Tags

https://github.com/Grailsrocks/grails-platform-core

Page 30: Grails and the World of Tomorrow

Event bus

30

Event Bus

Plugins ApplicationPluginsPlugins

Spring Integration AMQP

Save entity IndexUpdate

read DBsCall REST

service

Page 31: Grails and the World of Tomorrow

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

Page 32: Grails and the World of Tomorrow

More info

• w: http://grails.org/• f: http://grails.org/Mailing+Lists

• e: [email protected]• t: pledbrook• b: http://blog.springsource.com/author/peter-ledbrook/

32

Page 33: Grails and the World of Tomorrow

Q & A