SlideShare une entreprise Scribd logo
1  sur  29
Ratpack and Grails 3 
by Lari Hotari @lhotari 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Ratpack and Spring Boot 
by Lari Hotari @lhotari 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Agenda 
• Grails 3 and Ratpack - Why 
• Why async? 
• Modularity and micro service architectures 
3
Grails 3 
• Build on Spring Boot 
• Embrace Gradle 
• Abstract packaging / deployment 
• Reach outside the servlet container 
• App profiles: Netty, Servlet, Batch, Hadoop 
• Deployment with runnable JARs 
• Support micro services, remove bloat, reduce 
dependencies 
4
5
6
Why Netty / Ratpack? 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. 
Why async?
What is application performance about? 
• Latency of operations 
• Throughput of operations 
• Quality of operations - efficiency, usability, 
responsiveness, correctness, consistency, integrity, 
reliability, availability, resilience, robustness, 
recoverability, security, safety, maintainability 
8
Amdahl's law 
9
Little's law 
L = λW 
MeanNumberInSystem = MeanThroughput * MeanResponseTime 
10 
→ 
MeanThroughput = MeanNumberInSystem / MeanResponseTime
Cons of the thread-per-request model in the light of Little's law and 
Amdahl's law 
• From Little's law: MeanNumberInSystem = 
MeanThroughput * MeanResponseTime 
• In the thread-per-request model, the upper bound for 
MeanNumberInSystem is the maximum for the number of 
request handling threads. This might limit the throughput of 
the system, especially when the response time get higher 
or request handling threads get blocked and hang. 
• Shared locks and resources might set the upper bound to 
a very low value. Such problems get worse under error 
conditions. 
11
Advantages of thread-per-request model 
• We are used to debugging the thread-per-request model 
- adding breakpoints, attaching the debugger and going 
through the stack 
• The synchronous blocking procedural programming 
model is something that programmers are used to doing. 
• There is friction in switching to different programming 
models and paradigms. 
12
Declarative Programming model 
• Declarative programming expresses the logic of a 
computation without describing its control flow. 
• It's programming without the call stack, the 
programmer doesn't decide execution details. 
• Examples: functional and reactive programming, event 
/ message based execution, distributed parallel 
computation algorithms like Map/Reduce 
13
KillerApp for non-blocking async model 
• Responsive streaming of a high number of clients on a 
single box 
• continuously connected real-time apps where low-latency 
and high availablity is a requirement 
• limited resources (must be efficient/optimal) 
• Follow Pivotal's https://github.com/reactor/reactor 
project that provides a Reactive Streams 
(http://www.reactive-streams.org/) implementation 14
Hello world in Ratpack 
15 
1 import static ratpack.groovy.Groovy.ratpack 
2 
3 ratpack { 
4 handlers { 
5 get { 
6 render "Hello world" 
7 } 
8 } 
9 } 
https://github.com/lhotari/hello-ratpack/blob/master/src/ratpack/Ratpack.groovy
Ratpack applications 
• Ratpacks comes with Guice for dependency injection 
• Guice modules are also used as the plugin system for Ratpack 
• not actual "plugins" in a technical sense since there isn't a 
plugin API and the developer takes care of wiring modules to 
Ratpack applications. 
• Examples of Ratpack module contributions: 
• Integrations to RxJava and Reactor. Can be used for async 
composition and preventing "callback hell". 
• Integration to Netflix Hystrix for adding error resilience 
functionality . f.e., Circuit-breaker pattern impl. 16
Demo 
• https://github.com/lhotari/ratpack-gorm-example 
• Spring Boot embedded in Ratpack, running GORM 
• Uses Ratpack Spring Boot support (0.9.9-SNAPSHOT) 
• Grails 3 builds on Spring Boot 
17
Modularity and Microservices 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Modularity 
• logical partitioning of the "software design" 
• allows complex software to be manageable for the 
purpose of implementation and maintenance 
19
Coupling and Cohesion 
• Coupling and cohesion are measures for describing how 
easy it will be to change the behaviour of some element 
in a system 
• Modules are coupled if a change in one forces a change 
in a the other 
• A module's cohesion is a measure of whether it's 
responsibilities form a meaningful unit 
source: GOOS book 20
Optimal coupling and cohesion 
• Low coupling between modules ⟹ easier to change 
• High cohesion within module ⟹ single responsibility 
21
Microservice definition by James Lewis 
• Each application only does one thing 
• Small enough to fit in your head 
• Small enough that you can throw them away 
• Embedded web container 
• Packaged as a single executable jar 
• Use HTTP and HATEOAS to decouple services 
• Each app exposes metrics about itself 
22
Polyglot persistence 
• Common principle is that each service owns it's data - 
there is no shared database across multiple services. 
• If this principle is followed, it usually means switching to 
Hexagonal architecture, where persistence is an 
integration and not part of the core. 
• "Start with the events and behaviour instead of the 
database." 
• Data consistency models in distributed systems 
23
Brooks: "No silver bullet" 
• Essential complexity 
• complexity that you cannot escape 
• Accidental complexity 
• we could be adding complexity by bad design 
24
Modular applications 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Monoliths in systems-of-systems 
26 
μser 
vice 
A 
Single 
Page App 
in 
Browser 
API 
Gateway 
service 
SAAS 
Service A 
SAAS 
Service B 
μser 
vice 
B 
μser 
vice 
C 
μser 
vice 
D 
μser 
vice 
E 
μser 
vice 
F
Modular monoliths 
• Modular monoliths are composed of loosely coupled 
modules of single responsibility 
• Enabling the 3rd way (after monoliths and 
microservices) for building applications on the JVM 
across different libraries and frameworks 
• Modules can be turned into true micro services when 
needed - instead of introducing accidental complexity to 
projects that don't really require micro services in the 
beginning, but could benefit of them later 27
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. 
Questions?
Thanks! 
Lari Hotari @lhotari 
Pivotal Software, Inc. 
© 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.

Contenu connexe

Tendances

Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
Markus Eisele
 
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Todd Fritz
 

Tendances (18)

Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
Microservice message routing on Kubernetes
Microservice message routing on KubernetesMicroservice message routing on Kubernetes
Microservice message routing on Kubernetes
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
 
What next after microservices
What next after microservicesWhat next after microservices
What next after microservices
 
Dual write strategies for microservices
Dual write strategies for microservicesDual write strategies for microservices
Dual write strategies for microservices
 
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
 
Microservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereMicroservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got Here
 
Cloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful ServerlessCloudstate - Towards Stateful Serverless
Cloudstate - Towards Stateful Serverless
 
Real-Time Design Patterns
Real-Time Design PatternsReal-Time Design Patterns
Real-Time Design Patterns
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
 
What’s New with Flowable?
What’s New with Flowable?What’s New with Flowable?
What’s New with Flowable?
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
 
Detecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on KubernetesDetecting Real-Time Financial Fraud with Cloudflow on Kubernetes
Detecting Real-Time Financial Fraud with Cloudflow on Kubernetes
 
Revitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with MicroservicesRevitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with Microservices
 
MongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableMongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with Flowable
 
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails? Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
 
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
Organic Growth and A Good Night Sleep: Effective Kafka Operations at Pinteres...
 

Similaire à Ratpack and Grails 3 (and Spring Boot) SpringOne 2GX 2014

10 Key Steps for Moving from Legacy Infrastructure to the Cloud
10 Key Steps for Moving from Legacy Infrastructure to the Cloud10 Key Steps for Moving from Legacy Infrastructure to the Cloud
10 Key Steps for Moving from Legacy Infrastructure to the Cloud
NGINX, Inc.
 

Similaire à Ratpack and Grails 3 (and Spring Boot) SpringOne 2GX 2014 (20)

Reactive applications tools of the trade huff po
Reactive applications   tools of the trade huff poReactive applications   tools of the trade huff po
Reactive applications tools of the trade huff po
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...
 
Twelve Factor App With Lagom
Twelve Factor App With LagomTwelve Factor App With Lagom
Twelve Factor App With Lagom
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
 
Twelve-Factor application pattern with Spring Framework
Twelve-Factor application pattern with Spring FrameworkTwelve-Factor application pattern with Spring Framework
Twelve-Factor application pattern with Spring Framework
 
Best practices for application migration to public clouds interop presentation
Best practices for application migration to public clouds interop presentationBest practices for application migration to public clouds interop presentation
Best practices for application migration to public clouds interop presentation
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
 
[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
10 Key Steps for Moving from Legacy Infrastructure to the Cloud
10 Key Steps for Moving from Legacy Infrastructure to the Cloud10 Key Steps for Moving from Legacy Infrastructure to the Cloud
10 Key Steps for Moving from Legacy Infrastructure to the Cloud
 
Adopting the Cloud
Adopting the CloudAdopting the Cloud
Adopting the Cloud
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Comparison of Current Service Mesh Architectures
Comparison of Current Service Mesh ArchitecturesComparison of Current Service Mesh Architectures
Comparison of Current Service Mesh Architectures
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Study Notes - Using an API Gateway
Study Notes - Using an API GatewayStudy Notes - Using an API Gateway
Study Notes - Using an API Gateway
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
 
API Microservices with Node.js and Docker
API Microservices with Node.js and DockerAPI Microservices with Node.js and Docker
API Microservices with Node.js and Docker
 
Alluxio Use Cases and Future Directions
Alluxio Use Cases and Future DirectionsAlluxio Use Cases and Future Directions
Alluxio Use Cases and Future Directions
 

Dernier

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 

Ratpack and Grails 3 (and Spring Boot) SpringOne 2GX 2014

  • 1. Ratpack and Grails 3 by Lari Hotari @lhotari © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 2. Ratpack and Spring Boot by Lari Hotari @lhotari © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 3. Agenda • Grails 3 and Ratpack - Why • Why async? • Modularity and micro service architectures 3
  • 4. Grails 3 • Build on Spring Boot • Embrace Gradle • Abstract packaging / deployment • Reach outside the servlet container • App profiles: Netty, Servlet, Batch, Hadoop • Deployment with runnable JARs • Support micro services, remove bloat, reduce dependencies 4
  • 5. 5
  • 6. 6
  • 7. Why Netty / Ratpack? © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. Why async?
  • 8. What is application performance about? • Latency of operations • Throughput of operations • Quality of operations - efficiency, usability, responsiveness, correctness, consistency, integrity, reliability, availability, resilience, robustness, recoverability, security, safety, maintainability 8
  • 10. Little's law L = λW MeanNumberInSystem = MeanThroughput * MeanResponseTime 10 → MeanThroughput = MeanNumberInSystem / MeanResponseTime
  • 11. Cons of the thread-per-request model in the light of Little's law and Amdahl's law • From Little's law: MeanNumberInSystem = MeanThroughput * MeanResponseTime • In the thread-per-request model, the upper bound for MeanNumberInSystem is the maximum for the number of request handling threads. This might limit the throughput of the system, especially when the response time get higher or request handling threads get blocked and hang. • Shared locks and resources might set the upper bound to a very low value. Such problems get worse under error conditions. 11
  • 12. Advantages of thread-per-request model • We are used to debugging the thread-per-request model - adding breakpoints, attaching the debugger and going through the stack • The synchronous blocking procedural programming model is something that programmers are used to doing. • There is friction in switching to different programming models and paradigms. 12
  • 13. Declarative Programming model • Declarative programming expresses the logic of a computation without describing its control flow. • It's programming without the call stack, the programmer doesn't decide execution details. • Examples: functional and reactive programming, event / message based execution, distributed parallel computation algorithms like Map/Reduce 13
  • 14. KillerApp for non-blocking async model • Responsive streaming of a high number of clients on a single box • continuously connected real-time apps where low-latency and high availablity is a requirement • limited resources (must be efficient/optimal) • Follow Pivotal's https://github.com/reactor/reactor project that provides a Reactive Streams (http://www.reactive-streams.org/) implementation 14
  • 15. Hello world in Ratpack 15 1 import static ratpack.groovy.Groovy.ratpack 2 3 ratpack { 4 handlers { 5 get { 6 render "Hello world" 7 } 8 } 9 } https://github.com/lhotari/hello-ratpack/blob/master/src/ratpack/Ratpack.groovy
  • 16. Ratpack applications • Ratpacks comes with Guice for dependency injection • Guice modules are also used as the plugin system for Ratpack • not actual "plugins" in a technical sense since there isn't a plugin API and the developer takes care of wiring modules to Ratpack applications. • Examples of Ratpack module contributions: • Integrations to RxJava and Reactor. Can be used for async composition and preventing "callback hell". • Integration to Netflix Hystrix for adding error resilience functionality . f.e., Circuit-breaker pattern impl. 16
  • 17. Demo • https://github.com/lhotari/ratpack-gorm-example • Spring Boot embedded in Ratpack, running GORM • Uses Ratpack Spring Boot support (0.9.9-SNAPSHOT) • Grails 3 builds on Spring Boot 17
  • 18. Modularity and Microservices © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 19. Modularity • logical partitioning of the "software design" • allows complex software to be manageable for the purpose of implementation and maintenance 19
  • 20. Coupling and Cohesion • Coupling and cohesion are measures for describing how easy it will be to change the behaviour of some element in a system • Modules are coupled if a change in one forces a change in a the other • A module's cohesion is a measure of whether it's responsibilities form a meaningful unit source: GOOS book 20
  • 21. Optimal coupling and cohesion • Low coupling between modules ⟹ easier to change • High cohesion within module ⟹ single responsibility 21
  • 22. Microservice definition by James Lewis • Each application only does one thing • Small enough to fit in your head • Small enough that you can throw them away • Embedded web container • Packaged as a single executable jar • Use HTTP and HATEOAS to decouple services • Each app exposes metrics about itself 22
  • 23. Polyglot persistence • Common principle is that each service owns it's data - there is no shared database across multiple services. • If this principle is followed, it usually means switching to Hexagonal architecture, where persistence is an integration and not part of the core. • "Start with the events and behaviour instead of the database." • Data consistency models in distributed systems 23
  • 24. Brooks: "No silver bullet" • Essential complexity • complexity that you cannot escape • Accidental complexity • we could be adding complexity by bad design 24
  • 25. Modular applications © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 26. Monoliths in systems-of-systems 26 μser vice A Single Page App in Browser API Gateway service SAAS Service A SAAS Service B μser vice B μser vice C μser vice D μser vice E μser vice F
  • 27. Modular monoliths • Modular monoliths are composed of loosely coupled modules of single responsibility • Enabling the 3rd way (after monoliths and microservices) for building applications on the JVM across different libraries and frameworks • Modules can be turned into true micro services when needed - instead of introducing accidental complexity to projects that don't really require micro services in the beginning, but could benefit of them later 27
  • 28. © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission. Questions?
  • 29. Thanks! Lari Hotari @lhotari Pivotal Software, Inc. © 2014 SpringOne 2GX. All rights reserved. Do not distribute without permission.

Notes de l'éditeur

  1. Performance == Fast , Latency Performance == Efficiency , Throughput Performance == Correctness , Quality