SlideShare a Scribd company logo
@crichardson
A pattern language for
microservices
Chris Richardson
Founder of the original CloudFoundry.com
Author of POJOs in Action
@crichardson
chris@chrisrichardson.net
http://plainoldobjects.com
http://microservices.io
http://eventuate.io
@crichardson
Presentation goal
Why patterns and pattern
languages?
A pattern language for
microservices
@crichardson
About Chris
@crichardson
About Chris
Consultant and trainer focusing
on microservices
(http://www.chrisrichardson.net/)
@crichardson
About Chris
Founder of a startup that is creating
a platform that makes it easy for
application developers write
microservices
(http://bit.ly/trialeventuate)
@crichardson
For more information
https://github.com/cer/event-sourcing-examples
http://microservices.io
http://plainoldobjects.com/
https://twitter.com/crichardson
http://eventuate.io/
@crichardson
Agenda
Why a pattern language for microservices?
Core patterns
Deployment patterns
Communication patterns
@crichardson
In 1986…
http://en.wikipedia.org/wiki/Fred_Brooks
@crichardson
Yet almost 30 years later
developers are still
passionately arguing over
“silver bullets”
@crichardson
Suck/Rock Dichotomy
Spring vs. Java EE
JavaScript vs. Java
Functional programming vs. Object-oriented
http://nealford.com/memeagora/2009/08/05/suck-rock-dichotomy.html
Containers vs. Virtual Machines
@crichardson
Gartner Hype Cycle
http://upload.wikimedia.org/wikipedia/commons/b/bf/Hype-Cycle-General.png
It’s
awesome
It’s not
awesome
Trade-offs
understood
@crichardson
How we make decisions
Decide
using
emotions
Rationalize with
our intellect
http://en.wikipedia.org/wiki/Mahout
@crichardson
We need a better way
to discuss and think
about technology
@crichardson
What’s a pattern?
Reusable solution
to a problem
occurring
in a particular context
@crichardson
The structure of a pattern
=
Great framework for discussing
and thinking about technology
@crichardson
The structure of a pattern
Resulting context
aka the situation
Name
Context
Problem
Related patterns
(conflicting) issues
etc to address
Forces
Solution
@crichardson
Resulting context
Benefits
Drawbacks
Issues to resolve
@crichardson
Related patterns
Alternative solutions
Solutions to problems
introduced by this pattern
Pattern language
A collection of related
patterns that solve problems
in a particular domain
Relationships
Pattern A results in a
context that has a problem
solved by Pattern B
Patterns A and B solve the
same problem
Pattern A is a
specialization of pattern B
http://en.wikipedia.org/wiki/A_Pattern_Language
Access to Water
Promenade
Local townhall
Intimacy gradient
Light on two sides
@crichardson
Meta-pattern
Problem: How to talk/reason about technology?
Solution: Use the pattern format
Benefit: More objective
Drawback: Less exciting
Context: Emotional software development culture
Related patterns: It’s awesome!
@crichardson
Monolithic
architecture
Microservice
architecture
API gateway
Client-side discovery
Server-side
discovery
Service registry
Self registration 3rd party registration
Multiple Services
per host
Single Service per
Host
Service-per-
Container
Deployment
Discovery
Core
Communication
Service-per-VM
Partitioning
Messaging
Remote Procedure
Invocation
Style
Motivating
Pattern
Solution
Pattern
Solution A Solution B
General Specific
Work
in
progress
http://microservices.io/
@crichardson
Agenda
Why a pattern language for microservices?
Core patterns
Deployment patterns
Communication patterns
@crichardson
@crichardson
Let’s imagine you are
building an online store
Browser/
Client
SQL
Database
Review Service
Product Info
Service
Recommendation
Service
StoreFrontUI
Order Service
HTML
REST/JSON
@crichardson
Problem: what’s the
deployment architecture?
@crichardson
Forces
There is a team of developers that must be productive
The application must be easy to understand and modify
Do continuous deployment
Run multiple instances for scalability and availability
Use emerging technologies (frameworks, programming
languages, etc)
@crichardson
Tomcat
Pattern: Monolithic
architecture
Browser/
Client
WAR/EAR
MySQL
Database
Review Service
Product Info
Service
Recommendation
Service
StoreFrontUI
Order Service
HTML
REST/JSON
develop
test
deploy
Simple to
scale
@crichardson
Examples everywhere
@crichardson
But when the application is
large …
@crichardson
Intimidates developers
@crichardson
Obstacle to frequent
deployments
Need to redeploy everything to change one component
Interrupts long running background (e.g. Quartz) jobs
Increases risk of failure
Fear of change
Updates will happen less often - really long QA cycles
e.g. Makes A/B testing UI really difficult
Eggs in
one basket
@crichardson
Overloads your IDE and
container
Slows down development
@crichardson
Lots of coordination and
communication required
Obstacle to scaling
development
I want to update
the UI
But
the backend is not working
yet!
@crichardson
Requires long-term commitment
to a technology stack
@crichardson
Pattern: Microservice
architecture
@crichardson
Apply functional
decomposition
X axis
- horizontal duplication
Z
axis
-data
partitioning
Y axis -
functional
decomposition
Scale
by
splitting
sim
ilar
things
Scale by
splitting
different things
@crichardson
Product Info
Microservice architecture
Product Info
Service
Recommendation
Service
Review
Service
Order
Service
Browse Products
UI
Checkout UI
Order management
UI
Account
management UI
Apply X-axis and Z-axis scaling
to each service independently
@crichardson
Examples
http://highscalability.com/amazon-architecture
http://techblog.netflix.com/
http://www.addsimplicity.com/downloads/
eBaySDForum2006-11-29.pdf
http://queue.acm.org/detail.cfm?id=1394128
~600 services
100-150 services to build a page
@crichardson
Benefits
Smaller, simpler apps
Easier to understand and develop
Less jar/classpath hell - who needs OSGI?
Faster to build and deploy
Scales development: develop, deploy and scale each service independently
Improves fault isolation
Eliminates long-term commitment to a single technology stack
System level architecture vs. service level architecture
Easily and safely experiment with new technologies
@crichardson
Drawbacks
Complexity of developing a distributed system
Implementing inter-process communication
Handling partial failures
Implementing business transactions that span multiple databases
(without 2PC)
Complexity of testing a distributed system
Complexity of deploying and operating a distributed system
Managing the development and deployment of features that span
multiple services
Fortunately solutions exists
@crichardson
The benefits typically
outweigh the drawbacks
for
large, complex applications
@crichardson
Issues to address
How to deploy the services?
How do the services communicate?
How do clients of the application communicate with the
services?
How to partition the system into services?
How to deal with distributed data management problems?
Come to tomorrow’s talk at 9am
….
@crichardson
Agenda
Why a pattern language for microservices?
Core patterns
Deployment patterns
Communication patterns
@crichardson
We have applied the
microservices pattern:
How to deploy the services?
@crichardson
Forces
Services are written using a variety of languages, frameworks, and
framework versions
Each service consists of multiple service instances for throughput and
availability
Building and deploying a service must be fast
Service must be deployed and scaled independently
Service instances need to be isolated
Resources consumed by a service must be constrained
Deployment must be cost-effective
@crichardson
@crichardson
Pattern: Multiple service
instances per host
Host (Physical or VM)
Service-A
Instance-1
Service-B
Instance-2
Service-C
Instance-2
Process
WAR
OSGI bundle
Benefits and drawbacks
Benefits
Efficient resource utilization
Fast deployment
Drawbacks
Poor/Terrible isolation
Poor visibility (with WAR/OSGI
deployment)
Difficult to limit resource utilization
Risk of dependency version
conflicts
Poor encapsulation of
implementation technology
@crichardson
Pattern: Service instance per
host
@crichardson
Pattern: Service per VM host
Service
VM
image
VM
Service
VM
Service
VM
Service
packaged as
deployed as
@crichardson
Example
http://techblog.netflix.com/
~600 services
packer.io is a great tool
Benefits and drawbacks
Benefits
Great isolation
Great manageability
VM encapsulates
implementation technology
Leverage AWS
infrastructure for
Autoscaling/Load balancing

Drawbacks
Less efficient resource
utilization
Slow deployment
@crichardson
VM
VM
Pattern: Service per Container
host
Service
Container
image
Container
Service
Container
Service
Container
Service
packaged as
deployed as
@crichardson
Examples
Benefits and drawbacks
Benefits
Great isolation
Great manageability
Container encapsulates
implementation technology
Efficient resource utilization
Fast deployment
Drawbacks
Immature infrastructure for
deploying containers
@crichardson
Agenda
Why a pattern language for microservices?
Core patterns
Deployment patterns
Communication patterns
@crichardson
Communication issues
System Client
Service A
Service B
Service C
The System
How do clients of the
system interact with the
services?
How do services
within the system
interact?
@crichardson
@crichardson
The problem of discovery
Service
Client
Service
Instance A
Service
Instance B
Service
Instance C
?
10.4.3.1:8756
10.4.3.99:4545
10.4.3.20:333
Client or API
gateway
Dynamically
changing
Service
Instance A
Service
Instance B
Service
Instance C
10.4.3.1:8756
10.4.3.99:4545
10.4.3.20:333
How to load
balance?
Dynamically
assigned
@crichardson
Pattern: Client-side discovery
Service
Client
Registry-
aware
HTTP
Client
Service
Registry
Service
Instance A
Service
Instance B
Service
Instance C
10.4.3.1:8756
10.4.3.99:4545
10.4.3.20:333
register
query
request
load
balance
@crichardson
Example: Netflix Eureka and Ribbon
https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance
https://github.com/Netflix/ribbon
Benefits and drawbacks
Benefits
Flexible, application-specific
load balancing
Fewer network hops and
moving parts compared to
Server-side discovery

Drawbacks
Couples the client to the
Service Registry
Need implement client-side
discovery and load balancing
logic in multiple languages/
frameworks
Service Registry is yet
another moving part to setup
and operate - highly available
@crichardson
Pattern: Server-side discovery
Service
Client
Router
Service
Registry
Service
Instance A
Service
Instance B
Service
Instance C
10.4.3.1:8756
10.4.3.99:4545
10.4.3.20:333
register
query
request
request
load
balance
@crichardson
Example
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/
DeveloperGuide/vpc-loadbalancer-types.html
Internal
ELB Internal
ELB
Public
ELB
Benefits and drawbacks
Benefits
Simpler client code
Built-in to some cloud/
container environments, e.g.
AWS ELB, Kubernetes,
Marathon
Drawbacks
Limited to (generic) load
balancing algorithms
provided by router
More network hops
Router and Service Registry
is yet another moving part
to setup and operate -
highly available
@crichardson
Summary: Patterns and pattern
languages are a great way to …
Think about technology
Discuss technology
Apply technology
@crichardson
Summary: The Microservices pattern
language is a great way to …
Think about microservices
Discuss microservices
Apply microservices (or not)
@crichardson
@crichardson chris@chrisrichardson.net
http://bit.ly/trialeventuate
http://plainoldobjects.com http://microservices.io
Questions?

More Related Content

PDF
A pattern language for microservices - June 2021
PDF
Code Freeze 2018: There is no such thing as a microservice!
PDF
#DevNexus202 Decompose your monolith
PDF
Using patterns and pattern languages to make better architectural decisions
DOCX
Training report
PPTX
DevOps Torino Meetup - DevOps Engineer, a role that does not exist but is muc...
PPTX
OpenSlava 2013 - Dynamic Languages
PDF
Enterprise serverless
A pattern language for microservices - June 2021
Code Freeze 2018: There is no such thing as a microservice!
#DevNexus202 Decompose your monolith
Using patterns and pattern languages to make better architectural decisions
Training report
DevOps Torino Meetup - DevOps Engineer, a role that does not exist but is muc...
OpenSlava 2013 - Dynamic Languages
Enterprise serverless

Viewers also liked (8)

PDF
A pattern language for microservices (#gluecon #gluecon2016)
PDF
Microservices + Events + Docker = A Perfect Trio (dockercon)
PDF
Developing microservices with aggregates (SpringOne platform, #s1p)
PDF
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
PDF
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
PDF
Stateless authentication for microservices
PDF
REST vs. Messaging For Microservices
PDF
Developing applications with a microservice architecture (SVforum, microservi...
A pattern language for microservices (#gluecon #gluecon2016)
Microservices + Events + Docker = A Perfect Trio (dockercon)
Developing microservices with aggregates (SpringOne platform, #s1p)
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Stateless authentication for microservices
REST vs. Messaging For Microservices
Developing applications with a microservice architecture (SVforum, microservi...
Ad

Similar to A pattern language for microservices - Chris Richardson (20)

PDF
A Pattern Language for Microservices (@futurestack)
PDF
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
PDF
Microservices pattern language (microxchg microxchg2016)
PDF
A pattern language for microservices
PDF
A pattern language for microservices (melbourne)
PDF
SVCC Microservices: Decomposing Applications for Testability and Deployability
PDF
Kong Summit 2018 - Microservices: decomposing applications for testability an...
PDF
Spring Days NYC - A pattern language for microservices
PDF
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
PDF
A Pattern Language for Microservices
PDF
RedisConf17 - A pattern language for microservices - Chris Richardson
PDF
Oracle Code Sydney - There is no such thing as a microservice!
PDF
Saturn2017: No such thing as a microservice!
PDF
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
PDF
A pattern language for microservices (#SFMicroservices)
PDF
The microservice architecture: what, why, when and how?
PDF
There is no such thing as a microservice! (oracle code nyc)
PDF
Developing applications with a microservice architecture (svcc)
PDF
Microservices: Decomposing Applications for Deployability and Scalability (ja...
PDF
#JaxLondon keynote: Developing applications with a microservice architecture
A Pattern Language for Microservices (@futurestack)
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
Microservices pattern language (microxchg microxchg2016)
A pattern language for microservices
A pattern language for microservices (melbourne)
SVCC Microservices: Decomposing Applications for Testability and Deployability
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Spring Days NYC - A pattern language for microservices
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
A Pattern Language for Microservices
RedisConf17 - A pattern language for microservices - Chris Richardson
Oracle Code Sydney - There is no such thing as a microservice!
Saturn2017: No such thing as a microservice!
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
A pattern language for microservices (#SFMicroservices)
The microservice architecture: what, why, when and how?
There is no such thing as a microservice! (oracle code nyc)
Developing applications with a microservice architecture (svcc)
Microservices: Decomposing Applications for Deployability and Scalability (ja...
#JaxLondon keynote: Developing applications with a microservice architecture
Ad

More from JAXLondon_Conference (20)

PDF
Cassandra and Spark - Tim Berglund
PPT
All change! How the new Economics of Cloud will make you think differently ab...
PDF
The Unit Test is dead. Long live the Unit Test! - Colin Vipurs
PDF
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
PDF
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
PDF
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
PPTX
Smoothing the continuous delivery path – a tale of two teams - Lyndsay Prewer
PDF
VC from the inside - a techie's perspective - Adrian Colyer
PDF
Use your type system; write less code - Samir Talwar
PPTX
Thinking fast and slow with software development - Daniel Bryant
PPTX
The java memory model and the mutability matrix of pain - Jamie Allen
PDF
The art of shifting perspectives - Rachel Davies
PDF
Spring Boot in the Web Tier - Dave Syer
PDF
Microservices from dream to reality in an hour - Dr. Holly Cummins
PPT
Love your architecture - Alexander von Zitzewitz
PPTX
Lambdas puzzler - Peter Lawrey
PDF
Java vs. Java Script for enterprise web applications - Chris Bailey
PDF
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
PDF
Java 8 best practices - Stephen Colebourne
PPTX
Intuitions for scaling data centric architectures - Benjamin Stopford
Cassandra and Spark - Tim Berglund
All change! How the new Economics of Cloud will make you think differently ab...
The Unit Test is dead. Long live the Unit Test! - Colin Vipurs
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Smoothing the continuous delivery path – a tale of two teams - Lyndsay Prewer
VC from the inside - a techie's perspective - Adrian Colyer
Use your type system; write less code - Samir Talwar
Thinking fast and slow with software development - Daniel Bryant
The java memory model and the mutability matrix of pain - Jamie Allen
The art of shifting perspectives - Rachel Davies
Spring Boot in the Web Tier - Dave Syer
Microservices from dream to reality in an hour - Dr. Holly Cummins
Love your architecture - Alexander von Zitzewitz
Lambdas puzzler - Peter Lawrey
Java vs. Java Script for enterprise web applications - Chris Bailey
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Java 8 best practices - Stephen Colebourne
Intuitions for scaling data centric architectures - Benjamin Stopford

Recently uploaded (20)

PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Digital Strategies for Manufacturing Companies
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 41
2025 Textile ERP Trends: SAP, Odoo & Oracle
Digital Strategies for Manufacturing Companies
How to Migrate SBCGlobal Email to Yahoo Easily
How Creative Agencies Leverage Project Management Software.pdf
Operating system designcfffgfgggggggvggggggggg
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Online Work Permit System for Fast Permit Processing
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Design an Analysis of Algorithms I-SECS-1021-03
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
VVF-Customer-Presentation2025-Ver1.9.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Odoo POS Development Services by CandidRoot Solutions

A pattern language for microservices - Chris Richardson