SlideShare a Scribd company logo
@crichardson
A pattern language for
microservices
Chris Richardson
Founder of Eventuate.io
Founder of the original CloudFoundry.com
Author of POJOs in Action
@crichardson
chris@chrisrichardson.net
http://learnmicroservices.io
Copyright © 2017. Chris Richardson Consulting, Inc. All rights reserved
@crichardson
Presentation goal
Overview of the microservice
architecture pattern language
and
how to use it to architect an
application
@crichardson
About Chris
@crichardson
About Chris
Consultant and trainer
focusing on modern
application architectures
including microservices
(http://www.chrisrichardson.net/)
@crichardson
About Chris
Founder of a startup that is creating
an open-source/SaaS platform
that simpliïŹes the development of
transactional microservices
(http://eventuate.io)
@crichardson
About Chris
http://learnmicroservices.io
@crichardson
Agenda
Why microservices?
BeneïŹts of the microservice architecture
Microservices != silver bullet
The microservice pattern language
Applying the microservice pattern language
@crichardson
Modern software development: moving
fast and not breaking things!
46x
440x
24x
5x lower
Amazon: ~0.001%
NetïŹ‚ix: 16 minutes
@crichardson
How to move fast and not
break things?
Architecture:
Process:
Small,
autonomous teams
????
DevOps/Continuous delivery/deployment
Organization:
@crichardson
The monolithic architecture
Tomcat
Browser
WAR
SQL
database
HTML
REST/JSON
Client
App
Simple to 
.
Develop
Test
Deploy
Scale
Catalog
Module
Reviews
Module
Orders
Module
StoreFront UI
Module
@crichardson
But successful
applications keep
growing

.
@crichardson

 and modularity breaks down

http://www.laputan.org/mud/
“Shantytowns
are squalid,
sprawling
slums.”
@crichardson
Monolithic hell
Agile development and
deployment
becomes impossible
By John Martin, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3353638
@crichardson
Monolithic hell:
Technology stack becomes
increasingly obsolete
BUT a rewrite is not feasible
The microservice architecture is an
architectural style that
structures an application as a
set of loosely coupled, services
organized around business
capabilities
@crichardson
The Microservice architecture
tackles complexity through
modularization
Improved scalability is secondary
*
@crichardson
Microservice architecture
Browser
Mobile
Device
Content
Router
API
Gateway
Catalog
Service
Review
Service
Order
Service


Service
Catalog
Database
Review
Database
Order
Database


Database
HTTP
/HTML
REST
REST
Browse &
Search WebApp
Product Detail
WebApp

.
@crichardson
Agenda
Why microservices?
BeneïŹts of the microservice architecture
Microservices != silver bullet
The microservice pattern language
Applying the microservice pattern language
@crichardson
Microservices enable
continuous delivery/deployment
Process:
Continuous delivery/deployment
Organization:
Small, agile, autonomous,
cross functional teams
Architecture:
Microservice architecture
Enables
Enables
Enables
Successful
Software
Development
Services
=
testability
and
deployability
Teams own services
@crichardson
Smaller, simpler applications
Easier to understand, develop and test
Less jar/classpath hell - who needs OSGI?
Faster to build, test and deploy
Reduced startup time - improves MTTR
Scales development: develop, deploy
and scale each service independently
Small, autonomous teams
Clearly deïŹned
responsibilities
Catalog
Service
Review
Service
Order
Service


Service
Catalog
Team
Review
Team
Order
Team


Team
Responsible
for
@crichardson
Easier to scale
@crichardson
Improves fault isolation
@crichardson
Easily evolve your technology
stack
... and fail safely
@crichardson
Agenda
Why microservices?
BeneïŹts of the microservice architecture
Microservices != silver bullet
The microservice pattern language
Applying the microservice pattern language
@crichardson
No silver bullets
http://en.wikipedia.org/wiki/Fred_Brooks
@crichardson
Complexity
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
@crichardson
Complexity of developing a
distributed system
@crichardson
Multiple databases
&
Transaction management
Must use event-driven
eventual consistency
@crichardson
Complexity of testing a
distributed system
@crichardson
Complexity of deploying and
operating a distributed system
You need a lot of
automation: VM/container
orchestration or PaaS
@crichardson
Developing and deploying features that
span multiple services requires careful
coordination
@crichardson
Agenda
Why microservices?
BeneïŹts of the microservice architecture
Microservices != silver bullet
The microservice pattern language
Applying the microservice pattern language
@crichardson
Are microservices a good ïŹt
for my application?
@crichardson
When using microservices:
How to decompose an application into services?
How to deploy an application’s services?
How to handle cross cutting concerns?
Which communication mechanisms to use?
How do external clients communicate with the services?
How does a client discover the network location of a service instance?
How to prevent a network or service failure from cascading to other services?
How to maintain data consistency and implement queries?
How to make testing easier?
How to understand the behavior of an application and troubleshoot problems?
How to implement a UI screen or page that displays data from multiple services?
@crichardson
Microservice pattern language
=
collection of patterns
that solve these
architecture, design, development and
operational problems
@crichardson
What’s a pattern?
Reusable solution
to a problem
occurring
in a particular context
@crichardson
The structure of a pattern
encourages objectivity
Resulting context
The situationName
Context
Problem
Related patterns
The issues that
must be addressed
Forces
Solution BeneïŹts
Drawbacks
IssuesPatterns that are alternative
solutions
Patterns that address the issues
@crichardson
Microservice architecture pattern
Context Developing large, complex architecture
Problem What’s the runtime architecture?
BeneïŹts Faster development
Easy adopt new technologies
Drawbacks Complexity of a distributed system
Issues Decomposition
Distributed system issues: IPC, discovery, 

Alternative patterns Monolithic architecture
Successor patterns Service Registry, API Gateway, 

@crichardsonMicroservice patterns
Communication patterns
Core
Cross-cutting concerns Security
Deployment
Maintaining data consistency
Database architecture
External API
Reliability
Discovery
Communication style
Testing
Observability
UI
Decomposition
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
Service-per-VM
Messaging
Remote Procedure
Invocation
Database per
Service
Event-driven
architectureShared
database
Microservice
Chassis
Backend for front end
Event
sourcing
Transaction
log tailing
Database
triggers
Application
events
Monolithic
architecture
Microservice
architecture
CQRS
Motivating
Pattern
Solution
Pattern
Solution A Solution B
General SpeciïŹc
Serverless
deployment
Circuit BreakerAccess Token
Domain-speciïŹc
Externalized
conïŹguration
Service Integration
Contract Test
Service
Component Test
Exception
tracking
Distributed
tracing
Audit logging
Application
metrics
Log
aggregation
Health check
API
Service deployment
platform
Server-side page
fragment
composition
Client-side UI
composition
Decompose by
business capability
Decompose by
subdomain
Application patterns
Infrastructure patterns
Application Infrastructure patterns
Microservices pattern language: http://microservices.io
@crichardson
Agenda
Why microservices?
BeneïŹts of the microservice architecture
Microservices != silver bullet
The microservice pattern language
Applying the microservice pattern language
@crichardson
The pattern language guides you
when developing an architecture
What architectural decisions you must make
For each decision:
Available options
Trade-offs of each option
@crichardson
Key patterns
Issue: What’s the deployment
architecture?
Forces
Maintainability
Deployability
Testability
Extensibility


Monolithic
architecture
Microservice
architecture
Single deployable/
executable OR
Tightly coupled services
Multiple loosely coupled
services
Issue: How to decompose an
application into services?
Forces
Stability
Cohesive
Loosely coupled
Not too large
Decompose by
business capability
Decompose by
subdomain
Organize around
business capabilities
Organize around DDD
subdomains
@crichardson
Issue: how to maintain data
consistency?
Event-driven
architecture
Event
sourcing
Transaction
log tailing
Database
triggers
Application
events
Context
‱ Each service has its own
database
‱ Data is private to a service
Forces
Transactional data consistency
must be maintained across
multiple services
2PC is not an option
@crichardson
Issue: how to perform
queries?
CQRS
Context
Each service has its own
database
Forces
Queries must join data
from multiple services
Data is private to a service
Maintain query views by
subscribing to events
@crichardson
Issue: How do services
communicate?
Messaging
Remote Procedure
Invocation
Domain-speciïŹc
Forces
Services must
communicate
Usually processes on
different machines


@crichardson
The rest are generic technical
architecture patterns
=
Undifferentiated heavy lifting!
@crichardson
Issue: How to handle cross
cutting concerns?
Microservice
Chassis
Forces
Every service must
implement logging;
externalize conïŹguration;
health check endpoint;
metrics; 

Issue: How to deploy an
application’s services?
Multiple Services
per host
Single Service per
Host
Service-per-
Container
Service-per-VM
Serverless
deployment
Service deployment
platform
Forces
Multiple languages
Isolated
Constrained
Monitor-able
Reliable
EfïŹcient
@crichardson
Issue: How to discover a service
instance’s network location?
Client-side discovery
Server-side
discovery
Service registry
Self registration
3rd party registration
Forces
Client needs IP address of
service instance
Dynamic IP addresses
Dynamically provisioned
instances
@crichardson
Issue: how to monitor the
behavior of your application?
Exception
tracking
Distributed
tracing
Audit logging
Application
metrics
Log
aggregation
Health check
API
@crichardson
Summary
The monolithic architecture is a good choice for small/simple
applications
Use the microservice architecture for large/complex
applications
Microservice architecture != silver bullet
Use the microservice architecture pattern language to guide
your decision making
@crichardson
@crichardson chris@chrisrichardson.net
http://learnmicroservices.io
Thank you!

More Related Content

PDF
Kong Summit 2018 - Microservices: decomposing applications for testability an...
PDF
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
PDF
A Pattern Language for Microservices
PDF
There is no such thing as a microservice! (oracle code nyc)
PDF
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
PDF
Oracle Code Sydney - There is no such thing as a microservice!
PDF
Microservices and Redis #redisconf Keynote
PDF
Saturn2017: No such thing as a microservice!
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
A Pattern Language for Microservices
There is no such thing as a microservice! (oracle code nyc)
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
Oracle Code Sydney - There is no such thing as a microservice!
Microservices and Redis #redisconf Keynote
Saturn2017: No such thing as a microservice!

What's hot (20)

PDF
microXchg: Managing data consistency in a microservice architecture using Sagas
PDF
Developing microservices with aggregates (melbourne)
PDF
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
PDF
A pattern language for microservices (#gluecon #gluecon2016)
PDF
Mucon: Not Just Events: Developing Asynchronous Microservices
PDF
Solving distributed data management problems in a microservice architecture (...
PDF
SVCC Developing Asynchronous, Message-Driven Microservices
PDF
Microservices in Java and Scala (sfscala)
PDF
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
PDF
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
PDF
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
PDF
Events to the rescue: solving distributed data problems in a microservice arc...
PDF
Developing event-driven microservices with event sourcing and CQRS (london Ja...
PDF
Gluecon: Using sagas to maintain data consistency in a microservice architecture
PDF
YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...
PDF
Oracle Code One: Events and commands: developing asynchronous microservices
PDF
MicroCPH - Managing data consistency in a microservice architecture using Sagas
PDF
Events on the outside, on the inside and at the core (jfokus jfokus2016)
PDF
A pattern language for microservices (melbourne)
PDF
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
microXchg: Managing data consistency in a microservice architecture using Sagas
Developing microservices with aggregates (melbourne)
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
A pattern language for microservices (#gluecon #gluecon2016)
Mucon: Not Just Events: Developing Asynchronous Microservices
Solving distributed data management problems in a microservice architecture (...
SVCC Developing Asynchronous, Message-Driven Microservices
Microservices in Java and Scala (sfscala)
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
Events to the rescue: solving distributed data problems in a microservice arc...
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Gluecon: Using sagas to maintain data consistency in a microservice architecture
YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...
Oracle Code One: Events and commands: developing asynchronous microservices
MicroCPH - Managing data consistency in a microservice architecture using Sagas
Events on the outside, on the inside and at the core (jfokus jfokus2016)
A pattern language for microservices (melbourne)
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
Ad

Similar to Spring Days NYC - A pattern language for microservices (20)

PDF
Code Freeze 2018: There is no such thing as a microservice!
PDF
RedisConf17 - A pattern language for microservices - Chris Richardson
PDF
SVCC Microservices: Decomposing Applications for Testability and Deployability
PDF
Microservices pattern language (microxchg microxchg2016)
PDF
A pattern language for microservices
PDF
A Pattern Language for Microservices (@futurestack)
PDF
A pattern language for microservices - Chris Richardson
PDF
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
PDF
The microservice architecture: what, why, when and how?
PDF
A pattern language for microservices - June 2021
PDF
A pattern language for microservices (#SFMicroservices)
PDF
Using patterns and pattern languages to make better architectural decisions
PDF
Microservices - an architecture that enables DevOps (T Systems DevOps day)
PDF
The top 6 microservices patterns
PPTX
Introduction to Microservices
PDF
Dark Energy, Dark Matter and the Microservices Patterns?!
PDF
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
PPTX
Micro service session 1
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
PDF
Decompose your monolith: Six principles for refactoring a monolith to microse...
Code Freeze 2018: There is no such thing as a microservice!
RedisConf17 - A pattern language for microservices - Chris Richardson
SVCC Microservices: Decomposing Applications for Testability and Deployability
Microservices pattern language (microxchg microxchg2016)
A pattern language for microservices
A Pattern Language for Microservices (@futurestack)
A pattern language for microservices - Chris Richardson
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
The microservice architecture: what, why, when and how?
A pattern language for microservices - June 2021
A pattern language for microservices (#SFMicroservices)
Using patterns and pattern languages to make better architectural decisions
Microservices - an architecture that enables DevOps (T Systems DevOps day)
The top 6 microservices patterns
Introduction to Microservices
Dark Energy, Dark Matter and the Microservices Patterns?!
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
Micro service session 1
Understanding MicroSERVICE Architecture with Java & Spring Boot
Decompose your monolith: Six principles for refactoring a monolith to microse...
Ad

More from Chris Richardson (16)

PDF
More the merrier: a microservices anti-pattern
PDF
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
PDF
Dark energy, dark matter and microservice architecture collaboration patterns
PDF
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
PDF
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
PDF
Designing loosely coupled services
PDF
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
PDF
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
PDF
Overview of the Eventuate Tram Customers and Orders application
PDF
An overview of the Eventuate Platform
PDF
#DevNexus202 Decompose your monolith
PDF
JFokus: Cubes, Hexagons, Triangles, and More: Understanding Microservices
PDF
Decompose your monolith: strategies for migrating to microservices (Tide)
PDF
Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...
PDF
GotoChgo 2019: Not Just Events: Developing Asynchronous Microservices
PDF
YOW2018 - Events and Commands: Developing Asynchronous Microservices
More the merrier: a microservices anti-pattern
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
Dark energy, dark matter and microservice architecture collaboration patterns
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Designing loosely coupled services
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
Overview of the Eventuate Tram Customers and Orders application
An overview of the Eventuate Platform
#DevNexus202 Decompose your monolith
JFokus: Cubes, Hexagons, Triangles, and More: Understanding Microservices
Decompose your monolith: strategies for migrating to microservices (Tide)
Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...
GotoChgo 2019: Not Just Events: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous Microservices

Recently uploaded (20)

PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
System and Network Administraation Chapter 3
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
AI in Product Development-omnex systems
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
history of c programming in notes for students .pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
PDF
top salesforce developer skills in 2025.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPT
Introduction Database Management System for Course Database
PPTX
Transform Your Business with a Software ERP System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03
System and Network Administraation Chapter 3
Wondershare Filmora 15 Crack With Activation Key [2025
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
AI in Product Development-omnex systems
Odoo POS Development Services by CandidRoot Solutions
history of c programming in notes for students .pptx
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY
top salesforce developer skills in 2025.pdf
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
How Creative Agencies Leverage Project Management Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction Database Management System for Course Database
Transform Your Business with a Software ERP System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

Spring Days NYC - A pattern language for microservices