SlideShare a Scribd company logo
1 of 68
Download to read offline
@crichardson
The microservice architecture:
enabling rapid, reliable, frequent
and sustainable development
Chris Richardson
Founder of Eventuate.io
Founder of the original CloudFoundry.com
Author of POJOs in Action and Microservices Patterns
@crichardson
chris@chrisrichardson.net
http://adopt.microservices.io
Copyright ยฉ 2020. Chris Richardson Consulting, Inc. All rights reserved
Presentation goal
Microservice architecture:
โ€ข Trends driving adoption
โ€ข Essential characteristics
โ€ข Bene๏ฌts and drawbacks
@crichardson
About Chris
http://adopt.microservices.io
@crichardson
For slides, more information, raf๏ฌ‚e,
discounts, โ€ฆ
Raf๏ฌ‚e: 5 ebooks
+
40% discount
Raf๏ฌ‚e: 2 free spots
+
20% discount
https://bit.ly/tdc-2020-msa
Agenda
The need to deliver software rapidly, frequently and reliably
Developing long-lived applications
The monolithic architecture is not an anti-pattern
Overview of the microservice architecture
Architecting loosely coupled services
@crichardson
Software
https://www.wsj.com/articles/SB10001424053111903480904576512250915629460
@crichardson
The Marketplace is
Volatile
Uncertain
Complex
Ambiguous
@crichardson
https://www.ft.com/content/f9356bdc-3102-11ea-a329-0bcf87a328f2
https://www.ft.com/content/3f498e64-1aa6-11ea-97df-cc63de1d73f4
https://techcrunch.com/2019/06/18/the-rise-of-the-gig-economy-helps-london-based-insurtech-zego-to-raise-42m/
O
VID
-19
@crichardson
Businesses must be nimble,
agile, and innovate faster
IT must deliver software
rapidly, frequently and reliably
@crichardson
Quantifying rapid, frequent
and reliable delivery
Velocity
Lead time - time from commit to deploy
Deployment frequency - deploys per
developer per day
Reliability
Mean time to recover from a
deployment failure (MTTR)
Change failure rate - % of deployments
that cause an outage
Key Lean*
principles
* Inspired by the Toyota Production System
@crichardson
Modern software development: rapid and
reliable
Faster
More reliable
The research showsโ€ฆ
Software Delivery
Performance
Lead time, Deployment
frequency, Mean Time To
Restore, Change Fail %
Organizational
Performance
Pro๏ฌtability, Productivity,
Market share
$
Impacts
@crichardson
Process: Lean/DevOps/Continuous Delivery & Deployment
Organization: Small, long-
lived, product-centric,
autonomous teams
Architecture: ???
Deliver changes to
long-lived
applications rapidly,
frequently and reliably
What is DevOps?
Set of practices where
developers, testers
(dev) and IT operations
(ops) collaborate and
communicate to deliver
software rapidly,
frequently, and reliably
http://itrevolution.com/devops-handbook
Key DevOps practices
ApplicationAutomated deployment pipeline
Repository
Production
Frequent
Commits
Code and
con๏ฌguration
Reliable and frequent
deployments
Fast and reliable
automated tests
DevOps practices: hypothesis
driven development and A/B testing
A requirement is a
hypothesis thatโ€™s often
wrong
Validate by quickly getting
feedback for real users
Eric Ries. The Lean Startup (p. 75).
increase in revenue = frequency of experiments x
idea success rate x idea impact
High performance
organization: team of teams
5-9 people - promotes trust
Long-lived - enables trust and high
performance
Cross functional/autonomous -
eliminates time consuming hand-offs
Owns suitably sized software
โ€œcomponentโ€
Promotes long-term sustainable
development
Prevents cognitive overload
@crichardson
Case study: amazon.com
Amazon reorganized itself into long-
lived, product-centric, loosely coupled,
autonomous, two pizza teams that
developed microservices.
By 2015, they were deployingย 130,000
times/day!
This ability to delivery software rapidly
frequently and reliably enables them to
dominate retail as well as cloud
computing.
Rossman, John. Think Like Amazon: 50 1/2 Ideas to Become a
Digital Leader
DevOps Handbook, Kim et all
Development in high performing
organizations
โ€œComplete their work without communicating and
coordinating with people outside their teamโ€
โ€œMake large-scale changes to the design of their system
without depending on other teams to make changes in
their systems or creating signi๏ฌcant work for other teamsโ€
โ€œWe can do most of our testing without requiring an
integrated environment.โ€
โ€œWe can and do deploy or release our application
independently of other applications/services it depends
on.โ€
Required architectural quality
attributes (a.k.a. -ilities)
โ€œComplete their work without
communicating and coordinating with
people outside their teamโ€
โ€œMake large-scale changes to the design
of their system without depending on
other teams to make changes in their
systems or creating signi๏ฌcant work for
other teamsโ€
โ€œWe can do most of our testing without
requiring an integrated environment.โ€
โ€œWe can and do deploy or release our
application independently of other
applications/services it depends on.โ€
Loosely coupled
(Conwayโ€™s law)
Modular
Testable
Deployable
API encapsulates design decisions
Agenda
The need to deliver software rapidly, frequently and reliably
Developing long-lived applications
The monolithic architecture is not an anti-pattern
Overview of the microservice architecture
Architecting loosely coupled services
@crichardson
Successful applications live for a long time, e.g. 10 years,
20 years, โ€ฆ
BUT
Technology changes: Programming languages,
frameworks, โ€ฆ
Time
Technology A Technology B
V1 V2 V3 Vโ€ฆ
Importance
The importance of a technology changes over time
@crichardson
An organizationโ€™s technology must
be aligned with the marketplace
Murer, Stephan,Bruno Bonati Consulting, Bruno Bonati. Managed Evolution: A Strategy for
Very Large Information Systems
Relying on technology that is unimportant to market
Not using technology that is important to the market
@crichardson
Must be able to upgrade the
technology stack
@crichardson
Required architectural quality
attributes (a.k.a. -ilities)
Long-lived applications
Modularity
Incrementally upgrade the technology
stack
API encapsulates the
technology stack
@crichardson
Architecting for rapid, frequent,
reliable and sustainable development
Loosely coupled
(Conwayโ€™s law) Modular
Testable
Deployable
API encapsulates
โ€ข design decisions
โ€ข technology stack
Agenda
The need to deliver software rapidly, frequently and reliably
Developing long-lived applications
The monolithic architecture is not an anti-pattern
Overview of the microservice architecture
Architecting loosely coupled services
@crichardson
Tomcat/App. Server
Food To Go: Monolithic
architecture
Browser/
Client
WAR/EAR
MySQL
Database
Delivery
management
Order
Management
Kitchen
Management
Web UI
Restaurant
Management
HTML
REST/JSON
The application
The monolithic architecture
is an architectural style
that structures the
application
as a single executable/
deployable component
-ilities of small monoliths
Testability
Deployability
Maintainability
Modularity
Evolvability
โœ…
โœ…
โœ…
โœ…
โœ…
@crichardson
Rapid, frequent and reliable delivery
eventually becomes impossible
Time
Maintainability
Testability
Deployability
Modularity
Evolvability
Size/
Complexity
-ilities required to be competitive
Risk of
disruption
@crichardson
MyApp.war
Modular monolith = single classpath
No guarantee of composability
Orders.jar Customers.jar
Orders.jar Customers.jar
Test
independently
Still work?
+ dependencies + dependencies
@crichardson
Technology stack becomes
increasingly obsolete
BUT a rewrite is not feasible
@crichardson
Many decisions are global and canโ€™t be
changed incrementally Donโ€™t change
Programming language
Application framework
Library and framework version
โ€ฆ
@crichardson
Monolithic hell
By John Martin, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3353638
Agenda
The need to deliver software rapidly, frequently and reliably
Developing long-lived applications
The monolithic architecture is not an anti-pattern
Overview of the microservice architecture
Architecting loosely coupled services
The microservice architecture is
an architectural style
that structures an application as a
set of services that are
Highly maintainable and testable
Minimal lead time
Loosely coupled
Independently deployable
Implements a business capability
Owned/developed/tested/deployed by a small team
@crichardson
Food to Go: Microservice
architecture
Browser
Mobile
Application
Content
Router
API
Gateway
Order
Service
Restaurant
Service
Delivery
Service
โ€ฆ
Service
Order
Database
Restaurant
Database
Delivery
Database
โ€ฆ
Database
HTTP
/HTML
REST
REST
Browse &
Search WebApp
Restaurant
Detail WebApp
โ€ฆ.
JavaScript
Message
Broker
@crichardson
API
The structure of a service
Operations
Event
Publisher
Commands
Queries
Synchronous
REST/gRPC
Asynchronous
Messaging
Events
Event
Subscriber
API
Client
Invokes
Operations
Events
Service
Database
Private!
@crichardson
Service architecture โ€œmirrorsโ€
the business
FTGO business
Kitchen Service
Delivery Service
Order Taking
Kitchen
Delivery
Accounting
โ€ฆ.
โ€ฆ.
Service
Order Service
Accounting Service
Maps to
Maps to
Maps to
Maps to
Maps to
Area of the business,
a.k.a.
Subdomain or Business Capability
@crichardson
Goal is team autonomy one
service per team
Service
https://microservices.io/patterns/decomposition/service-per-team.html
Owned by a
team
Owns one
service
Not to exceed
cognitive capacity of
team
@crichardson
Split service only to solve a
problem
Team become two large split team, split service
Deployment pipeline takes too long split into two services
that can be developed/tested independently
Polyglot development: e.g. Python ML model in a Java
application
Split for fault tolerance - isolate HA parts of the application
โ€ฆ
Bene๏ฌts of microservices
Improved maintainability
Each service ๏ฌts in the heads of the
development team = Easier to
understand and change
Preserves modularity since a service is a
well-de๏ฌned module with an
impermeable API
Improved testability:
Each service is easier to test and faster
to test
Improved evolvability - evolve each serviceโ€™s
technology stack independently
Improved deployability
Each service can be deployed
independently
Easier to scale application
Each service can be scaled
independently
Improves availability/fault isolation and
latency
Critical services are isolated from less
critical services: separate processes and
infrastructure
Separate deployments reduces risk of
change based failure
@crichardson
Process: Lean + DevOps/Continuous Delivery & Deployment
Architecture:
microservices
Testability
Deployability
Modularity
Deliver changes to
long-lived
applications rapidly,
frequently and reliably
Organization: Small, long-
lived, product-centric,
autonomous teams
@crichardson
Loosely coupled teams and
services
Order
Service
Orders
Team
Automated deployment pipeline
Source code repository
Kitchen
Service
Kitchen
Team
Automated deployment pipeline
Source code repository
Delivery
Service
Delivery
Team
Automated deployment pipeline
Source code repository
Working independently > 80% of the time
@crichardson
Microservices experiment safely
and evolve the technology stack
Java
Java
Java
Java
Java
Golang
โ€œGoLang
is cool!โ€
Java
Java
Java
โ€œKotlin
is better!โ€
Java
Kotlin
@crichardson
Drawbacks of microservices
Complexity
Development: IPC, partial failure, distributed data
Testing: Integration, end to end, โ€ฆ
Deployment
โ€ฆ
@crichardson
โ€ฆDrawbacks of microservices
Correctly identifying service boundaries and avoiding the
distributed monolith anti-pattern
Refactoring a monolithic application to a microservice
architecture
@crichardson
If you are
developing a long-lived, large/complex
application
AND
you need to deliver it rapidly, frequently
and reliably
THEN
the Microservice Architecture is often a
good choice
Agenda
The need to deliver software rapidly, frequently and reliably
Developing long-lived applications
The monolithic architecture is not an anti-pattern
Overview of the microservice architecture
Architecting loosely coupled services
@crichardson
About Conwayโ€™s Law
โ€œorganizations which design
systems ... are constrained to
produce designs which are
copies of the communication
structures of these
organizations.โ€
http://melconway.com/Home/Home.html
Loosely coupled teams require a
loosely coupled architecture
@crichardson
Loose coupling is essential
Services collaborate, e.g. Order Service must
reserve customer credit
Coupling is inevitable
BUT
Services must be loosely coupled
API
Order
Service
Customer
Service
reserveCredit()
Runtime coupling
Order Service cannot respond to a synchronous request
(e.g. HTTP POST) until Customer Service responds
VS
Design time coupling
Change Customer Service change Order Service
@crichardson
Loose coupling - design time
Design-time coupling requires coordination between teams:
e.g. Meetings to discuss API changes
Slows down development
Essential to minimize design time coupling:
Use well-designed, stable APIs
Be careful with shared libraries - best for utilities
Design iceberg services
Implementation
DB
API
Small, stable
API
Large, complex
implementation Change
Whatโ€™s hidden can
easily be changed
Avoid shared libraries containing
business logic
Shared utility libraries โœ…
Shared libraries containing
business logic that changes
requires multiple services
to change in lock step โŒ
Service A
Library
Service B
Library
Service โ€ฆ
Library
Change
Avoid shared database tables
Order
Service
Customer
Service
Database
Customer
table
Tight design-
time/runtime
coupling
Order
Service
Customer
Service
Order database
Order
table
Customer database
Customer
table
APIs
only
@crichardson
Loose runtime coupling
@crichardson
The trouble with synchronous IPC :
runtime coupling => reduced availability
Order
Service
Customer
Service
PUT /customer/id/credit
availability(createOrder) =
availability(OrderService) x
availability(CustomerService)
POST /order
๐Ÿ˜ข
Order Customer
creditLimit
availableCredit
Problem:
Developers treat services as if they are programming
language-level modules (that communicate via HTTP)
Consequences:
IPC is relatively expensive high latency
Synchronous communication temporal coupling
reduced availability - serviceAvailabilitynumber of services
Anti-pattern: Distribution is
free
@crichardson
Self-contained service:
Can handle a synchronous
request without waiting for a
response from another service
https://microservices.io/patterns/decomposition/self-contained-service.html
@crichardson
Order
Service
Order Management
Customer Management
Improving availability: replace
service with module
POST /order
Order
Customer
creditLimit
availableCredit
availability(createOrder) =
availability(OrderService)
More available ๐Ÿ˜„
Larger service/
team ๐Ÿ˜ข
Response =
validation
outcome ๐Ÿ˜„
@crichardson
messaging system
Use asynchronous messaging
Sender Recipient
Message
Channel
Payload
Header
http://bit.ly/books-eip
Channel types:
โ€ข Point-to-point
โ€ข Publish/Subscribe
@crichardson
Improving availability: sagas
Order
Service
Customer
Service
availability(createOrder) =
availability(OrderService)
POST /order
Credit Reserved
More available ๐Ÿ˜„
Complexity of sagas ๐Ÿ˜ข
Order created
Response =! Validation
outcome ๐Ÿ˜ข
Order events
Customer events
https://microservices.io/patterns/data/saga.html
@crichardson
Improving availability: CQRS
Order
Service Customer
Service
availability(createOrder) =
availability(OrderService)
POST /order
Customer
Created
More available ๐Ÿ˜„
Complex/Costly ๐Ÿ˜ข
Response =
validation
outcome ๐Ÿ˜„
Customer
creditLimit
availableCredit
Replicated
Owned
Customer
creditLimit
availableCredit
Credit Limit
Changed
https://microservices.io/patterns/data/cqrs.html
@crichardson
Summary:
@crichardson
Summary: What is the microservice
architecture?
The microservice architecture is
an architectural style
that structures an application as a
set of services that are
โ€ข Highly maintainable and testable
โ€ข Minimal lead time
โ€ข High deployment frequency
โ€ข Loosely coupled
โ€ข Independently deployable
โ€ข Implements a business capability
โ€ข Owned/developed/tested/deployed by a small team
@crichardson
Summary: 	Why should you care
about the microservice architecture?
Process: Lean + DevOps/Continuous Delivery & Deployment
Architecture:
microservices
Testability
Deployability
Modularity
Modularity
Evolvability
Maintainability
Availability
Deliver changes to
long-lived
applications rapidly,
frequently and
reliably
Organization: Small, long-
lived, product-centric,
autonomous teams
Organizational
Performance
@crichardson
@crichardson chris@chrisrichardson.net
https://bit.ly/tdc-2020-msa
Questions?

More Related Content

What's hot

Events on the outside, on the inside and at the core - Chris Richardson
Events on the outside, on the inside and at the core - Chris RichardsonEvents on the outside, on the inside and at the core - Chris Richardson
Events on the outside, on the inside and at the core - Chris Richardson
JAXLondon_Conference
ย 

What's hot (20)

Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...
ย 
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Developing event-driven microservices with event sourcing and CQRS (Shanghai)Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
ย 
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
Melbourne Jan 2019 - Microservices adoption anti-patterns: Obstacles to decom...
ย 
Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...
ย 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
ย 
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
ย 
SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices  SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices
ย 
Events on the outside, on the inside and at the core - Chris Richardson
Events on the outside, on the inside and at the core - Chris RichardsonEvents on the outside, on the inside and at the core - Chris Richardson
Events on the outside, on the inside and at the core - Chris Richardson
ย 
Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...
Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...
Oracle CodeOne 2019: Decompose Your Monolith: Strategies for Migrating to Mic...
ย 
Saturn2017: No such thing as a microservice!
Saturn2017: No such thing as a microservice! Saturn2017: No such thing as a microservice!
Saturn2017: No such thing as a microservice!
ย 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
ย 
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
Oracle CodeOne 2019: Descending the Testing Pyramid: Effective Testing Strate...
ย 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
ย 
Oracle Code Sydney - There is no such thing as a microservice!
Oracle Code Sydney - There is no such thing as a microservice! Oracle Code Sydney - There is no such thing as a microservice!
Oracle Code Sydney - There is no such thing as a microservice!
ย 
OReilly SACON2018 - Events on the outside, on the inside, and at the core
OReilly SACON2018 - Events on the outside, on the inside, and at the coreOReilly SACON2018 - Events on the outside, on the inside, and at the core
OReilly SACON2018 - Events on the outside, on the inside, and at the core
ย 
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
ย 
Mucon: Not Just Events: Developing Asynchronous Microservices
Mucon: Not Just Events: Developing Asynchronous MicroservicesMucon: Not Just Events: Developing Asynchronous Microservices
Mucon: Not Just Events: Developing Asynchronous Microservices
ย 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
ย 
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Developing event-driven microservices with event sourcing and CQRS (london Ja...Developing event-driven microservices with event sourcing and CQRS (london Ja...
Developing event-driven microservices with event sourcing and CQRS (london Ja...
ย 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...
ย 

Similar to TDC2020 - The microservice architecture: enabling rapid, reliable, frequent and sustainable development

Similar to TDC2020 - The microservice architecture: enabling rapid, reliable, frequent and sustainable development (20)

Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
ย 
There is no such thing as a microservice! (oracle code nyc)
There is no such thing as a microservice! (oracle code nyc)There is no such thing as a microservice! (oracle code nyc)
There is no such thing as a microservice! (oracle code nyc)
ย 
JFokus: Cubes, Hexagons, Triangles, and More: Understanding Microservices
JFokus: Cubes, Hexagons, Triangles, and More: Understanding MicroservicesJFokus: Cubes, Hexagons, Triangles, and More: Understanding Microservices
JFokus: Cubes, Hexagons, Triangles, and More: Understanding Microservices
ย 
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...
ย 
YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...
YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...
YOW! Perth: Cubes, Hexagons, Triangles, and More: Understanding the Microserv...
ย 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions
ย 
Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...
ย 
Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...
ย 
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
A Guide on What Are Microservices: Pros, Cons, Use Cases, and MoreA Guide on What Are Microservices: Pros, Cons, Use Cases, and More
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
ย 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)
ย 
A pattern language for microservices
A pattern language for microservicesA pattern language for microservices
A pattern language for microservices
ย 
Building cloud-ready Microservices
Building cloud-ready MicroservicesBuilding cloud-ready Microservices
Building cloud-ready Microservices
ย 
The Reality of Managing Microservices in Your CD Pipeline
The Reality of Managing Microservices in Your CD PipelineThe Reality of Managing Microservices in Your CD Pipeline
The Reality of Managing Microservices in Your CD Pipeline
ย 
A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)
ย 
Spring Days NYC - A pattern language for microservices
Spring Days NYC - A pattern language for microservicesSpring Days NYC - A pattern language for microservices
Spring Days NYC - A pattern language for microservices
ย 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
ย 
Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...
ย 
Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...
ย 
A Pattern Language for Microservices
A Pattern Language for MicroservicesA Pattern Language for Microservices
A Pattern Language for Microservices
ย 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
ย 

More from Chris Richardson

More from Chris Richardson (11)

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?
ย 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-pattern
ย 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
ย 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!
ย 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patterns
ย 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
ย 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders application
ย 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
ย 
Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)Decompose your monolith: strategies for migrating to microservices (Tide)
Decompose your monolith: strategies for migrating to microservices (Tide)
ย 
MicroCPH - Managing data consistency in a microservice architecture using Sagas
MicroCPH - Managing data consistency in a microservice architecture using SagasMicroCPH - Managing data consistency in a microservice architecture using Sagas
MicroCPH - Managing data consistency in a microservice architecture using Sagas
ย 
GotoChgo 2019: Not Just Events: Developing Asynchronous Microservices
GotoChgo 2019: Not Just Events: Developing Asynchronous MicroservicesGotoChgo 2019: Not Just Events: Developing Asynchronous Microservices
GotoChgo 2019: Not Just Events: Developing Asynchronous Microservices
ย 

Recently uploaded

CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
anilsa9823
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
ย 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
ย 

Recently uploaded (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
ย 
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
ย 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
ย 
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-...
ย 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
ย 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
ย 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
ย 
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS LiveVip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
ย 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
ย 

TDC2020 - The microservice architecture: enabling rapid, reliable, frequent and sustainable development

  • 1. @crichardson The microservice architecture: enabling rapid, reliable, frequent and sustainable development Chris Richardson Founder of Eventuate.io Founder of the original CloudFoundry.com Author of POJOs in Action and Microservices Patterns @crichardson chris@chrisrichardson.net http://adopt.microservices.io Copyright ยฉ 2020. Chris Richardson Consulting, Inc. All rights reserved
  • 2. Presentation goal Microservice architecture: โ€ข Trends driving adoption โ€ข Essential characteristics โ€ข Bene๏ฌts and drawbacks
  • 4. @crichardson For slides, more information, raf๏ฌ‚e, discounts, โ€ฆ Raf๏ฌ‚e: 5 ebooks + 40% discount Raf๏ฌ‚e: 2 free spots + 20% discount https://bit.ly/tdc-2020-msa
  • 5. Agenda The need to deliver software rapidly, frequently and reliably Developing long-lived applications The monolithic architecture is not an anti-pattern Overview of the microservice architecture Architecting loosely coupled services
  • 9. @crichardson Businesses must be nimble, agile, and innovate faster IT must deliver software rapidly, frequently and reliably
  • 10. @crichardson Quantifying rapid, frequent and reliable delivery Velocity Lead time - time from commit to deploy Deployment frequency - deploys per developer per day Reliability Mean time to recover from a deployment failure (MTTR) Change failure rate - % of deployments that cause an outage Key Lean* principles * Inspired by the Toyota Production System
  • 11. @crichardson Modern software development: rapid and reliable Faster More reliable
  • 12. The research showsโ€ฆ Software Delivery Performance Lead time, Deployment frequency, Mean Time To Restore, Change Fail % Organizational Performance Pro๏ฌtability, Productivity, Market share $ Impacts
  • 13. @crichardson Process: Lean/DevOps/Continuous Delivery & Deployment Organization: Small, long- lived, product-centric, autonomous teams Architecture: ??? Deliver changes to long-lived applications rapidly, frequently and reliably
  • 14. What is DevOps? Set of practices where developers, testers (dev) and IT operations (ops) collaborate and communicate to deliver software rapidly, frequently, and reliably http://itrevolution.com/devops-handbook
  • 15. Key DevOps practices ApplicationAutomated deployment pipeline Repository Production Frequent Commits Code and con๏ฌguration Reliable and frequent deployments Fast and reliable automated tests
  • 16. DevOps practices: hypothesis driven development and A/B testing A requirement is a hypothesis thatโ€™s often wrong Validate by quickly getting feedback for real users Eric Ries. The Lean Startup (p. 75). increase in revenue = frequency of experiments x idea success rate x idea impact
  • 17. High performance organization: team of teams 5-9 people - promotes trust Long-lived - enables trust and high performance Cross functional/autonomous - eliminates time consuming hand-offs Owns suitably sized software โ€œcomponentโ€ Promotes long-term sustainable development Prevents cognitive overload
  • 18. @crichardson Case study: amazon.com Amazon reorganized itself into long- lived, product-centric, loosely coupled, autonomous, two pizza teams that developed microservices. By 2015, they were deployingย 130,000 times/day! This ability to delivery software rapidly frequently and reliably enables them to dominate retail as well as cloud computing. Rossman, John. Think Like Amazon: 50 1/2 Ideas to Become a Digital Leader DevOps Handbook, Kim et all
  • 19. Development in high performing organizations โ€œComplete their work without communicating and coordinating with people outside their teamโ€ โ€œMake large-scale changes to the design of their system without depending on other teams to make changes in their systems or creating signi๏ฌcant work for other teamsโ€ โ€œWe can do most of our testing without requiring an integrated environment.โ€ โ€œWe can and do deploy or release our application independently of other applications/services it depends on.โ€
  • 20. Required architectural quality attributes (a.k.a. -ilities) โ€œComplete their work without communicating and coordinating with people outside their teamโ€ โ€œMake large-scale changes to the design of their system without depending on other teams to make changes in their systems or creating signi๏ฌcant work for other teamsโ€ โ€œWe can do most of our testing without requiring an integrated environment.โ€ โ€œWe can and do deploy or release our application independently of other applications/services it depends on.โ€ Loosely coupled (Conwayโ€™s law) Modular Testable Deployable API encapsulates design decisions
  • 21. Agenda The need to deliver software rapidly, frequently and reliably Developing long-lived applications The monolithic architecture is not an anti-pattern Overview of the microservice architecture Architecting loosely coupled services
  • 22. @crichardson Successful applications live for a long time, e.g. 10 years, 20 years, โ€ฆ BUT Technology changes: Programming languages, frameworks, โ€ฆ Time Technology A Technology B V1 V2 V3 Vโ€ฆ Importance The importance of a technology changes over time
  • 23. @crichardson An organizationโ€™s technology must be aligned with the marketplace Murer, Stephan,Bruno Bonati Consulting, Bruno Bonati. Managed Evolution: A Strategy for Very Large Information Systems Relying on technology that is unimportant to market Not using technology that is important to the market
  • 24. @crichardson Must be able to upgrade the technology stack
  • 25. @crichardson Required architectural quality attributes (a.k.a. -ilities) Long-lived applications Modularity Incrementally upgrade the technology stack API encapsulates the technology stack
  • 26. @crichardson Architecting for rapid, frequent, reliable and sustainable development Loosely coupled (Conwayโ€™s law) Modular Testable Deployable API encapsulates โ€ข design decisions โ€ข technology stack
  • 27. Agenda The need to deliver software rapidly, frequently and reliably Developing long-lived applications The monolithic architecture is not an anti-pattern Overview of the microservice architecture Architecting loosely coupled services
  • 28. @crichardson Tomcat/App. Server Food To Go: Monolithic architecture Browser/ Client WAR/EAR MySQL Database Delivery management Order Management Kitchen Management Web UI Restaurant Management HTML REST/JSON The application The monolithic architecture is an architectural style that structures the application as a single executable/ deployable component
  • 29. -ilities of small monoliths Testability Deployability Maintainability Modularity Evolvability โœ… โœ… โœ… โœ… โœ…
  • 30. @crichardson Rapid, frequent and reliable delivery eventually becomes impossible Time Maintainability Testability Deployability Modularity Evolvability Size/ Complexity -ilities required to be competitive Risk of disruption
  • 31. @crichardson MyApp.war Modular monolith = single classpath No guarantee of composability Orders.jar Customers.jar Orders.jar Customers.jar Test independently Still work? + dependencies + dependencies
  • 32. @crichardson Technology stack becomes increasingly obsolete BUT a rewrite is not feasible
  • 33. @crichardson Many decisions are global and canโ€™t be changed incrementally Donโ€™t change Programming language Application framework Library and framework version โ€ฆ
  • 34. @crichardson Monolithic hell By John Martin, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3353638
  • 35. Agenda The need to deliver software rapidly, frequently and reliably Developing long-lived applications The monolithic architecture is not an anti-pattern Overview of the microservice architecture Architecting loosely coupled services
  • 36. The microservice architecture is an architectural style that structures an application as a set of services that are Highly maintainable and testable Minimal lead time Loosely coupled Independently deployable Implements a business capability Owned/developed/tested/deployed by a small team
  • 37. @crichardson Food to Go: Microservice architecture Browser Mobile Application Content Router API Gateway Order Service Restaurant Service Delivery Service โ€ฆ Service Order Database Restaurant Database Delivery Database โ€ฆ Database HTTP /HTML REST REST Browse & Search WebApp Restaurant Detail WebApp โ€ฆ. JavaScript Message Broker
  • 38. @crichardson API The structure of a service Operations Event Publisher Commands Queries Synchronous REST/gRPC Asynchronous Messaging Events Event Subscriber API Client Invokes Operations Events Service Database Private!
  • 39. @crichardson Service architecture โ€œmirrorsโ€ the business FTGO business Kitchen Service Delivery Service Order Taking Kitchen Delivery Accounting โ€ฆ. โ€ฆ. Service Order Service Accounting Service Maps to Maps to Maps to Maps to Maps to Area of the business, a.k.a. Subdomain or Business Capability
  • 40. @crichardson Goal is team autonomy one service per team Service https://microservices.io/patterns/decomposition/service-per-team.html Owned by a team Owns one service Not to exceed cognitive capacity of team
  • 41. @crichardson Split service only to solve a problem Team become two large split team, split service Deployment pipeline takes too long split into two services that can be developed/tested independently Polyglot development: e.g. Python ML model in a Java application Split for fault tolerance - isolate HA parts of the application โ€ฆ
  • 42. Bene๏ฌts of microservices Improved maintainability Each service ๏ฌts in the heads of the development team = Easier to understand and change Preserves modularity since a service is a well-de๏ฌned module with an impermeable API Improved testability: Each service is easier to test and faster to test Improved evolvability - evolve each serviceโ€™s technology stack independently Improved deployability Each service can be deployed independently Easier to scale application Each service can be scaled independently Improves availability/fault isolation and latency Critical services are isolated from less critical services: separate processes and infrastructure Separate deployments reduces risk of change based failure
  • 43. @crichardson Process: Lean + DevOps/Continuous Delivery & Deployment Architecture: microservices Testability Deployability Modularity Deliver changes to long-lived applications rapidly, frequently and reliably Organization: Small, long- lived, product-centric, autonomous teams
  • 44. @crichardson Loosely coupled teams and services Order Service Orders Team Automated deployment pipeline Source code repository Kitchen Service Kitchen Team Automated deployment pipeline Source code repository Delivery Service Delivery Team Automated deployment pipeline Source code repository Working independently > 80% of the time
  • 45. @crichardson Microservices experiment safely and evolve the technology stack Java Java Java Java Java Golang โ€œGoLang is cool!โ€ Java Java Java โ€œKotlin is better!โ€ Java Kotlin
  • 46. @crichardson Drawbacks of microservices Complexity Development: IPC, partial failure, distributed data Testing: Integration, end to end, โ€ฆ Deployment โ€ฆ
  • 47. @crichardson โ€ฆDrawbacks of microservices Correctly identifying service boundaries and avoiding the distributed monolith anti-pattern Refactoring a monolithic application to a microservice architecture
  • 48. @crichardson If you are developing a long-lived, large/complex application AND you need to deliver it rapidly, frequently and reliably THEN the Microservice Architecture is often a good choice
  • 49. Agenda The need to deliver software rapidly, frequently and reliably Developing long-lived applications The monolithic architecture is not an anti-pattern Overview of the microservice architecture Architecting loosely coupled services
  • 50. @crichardson About Conwayโ€™s Law โ€œorganizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations.โ€ http://melconway.com/Home/Home.html Loosely coupled teams require a loosely coupled architecture
  • 51. @crichardson Loose coupling is essential Services collaborate, e.g. Order Service must reserve customer credit Coupling is inevitable BUT Services must be loosely coupled API Order Service Customer Service reserveCredit()
  • 52. Runtime coupling Order Service cannot respond to a synchronous request (e.g. HTTP POST) until Customer Service responds VS Design time coupling Change Customer Service change Order Service
  • 53. @crichardson Loose coupling - design time Design-time coupling requires coordination between teams: e.g. Meetings to discuss API changes Slows down development Essential to minimize design time coupling: Use well-designed, stable APIs Be careful with shared libraries - best for utilities
  • 54. Design iceberg services Implementation DB API Small, stable API Large, complex implementation Change Whatโ€™s hidden can easily be changed
  • 55. Avoid shared libraries containing business logic Shared utility libraries โœ… Shared libraries containing business logic that changes requires multiple services to change in lock step โŒ Service A Library Service B Library Service โ€ฆ Library Change
  • 56. Avoid shared database tables Order Service Customer Service Database Customer table Tight design- time/runtime coupling Order Service Customer Service Order database Order table Customer database Customer table APIs only
  • 58. @crichardson The trouble with synchronous IPC : runtime coupling => reduced availability Order Service Customer Service PUT /customer/id/credit availability(createOrder) = availability(OrderService) x availability(CustomerService) POST /order ๐Ÿ˜ข Order Customer creditLimit availableCredit
  • 59. Problem: Developers treat services as if they are programming language-level modules (that communicate via HTTP) Consequences: IPC is relatively expensive high latency Synchronous communication temporal coupling reduced availability - serviceAvailabilitynumber of services Anti-pattern: Distribution is free
  • 60. @crichardson Self-contained service: Can handle a synchronous request without waiting for a response from another service https://microservices.io/patterns/decomposition/self-contained-service.html
  • 61. @crichardson Order Service Order Management Customer Management Improving availability: replace service with module POST /order Order Customer creditLimit availableCredit availability(createOrder) = availability(OrderService) More available ๐Ÿ˜„ Larger service/ team ๐Ÿ˜ข Response = validation outcome ๐Ÿ˜„
  • 62. @crichardson messaging system Use asynchronous messaging Sender Recipient Message Channel Payload Header http://bit.ly/books-eip Channel types: โ€ข Point-to-point โ€ข Publish/Subscribe
  • 63. @crichardson Improving availability: sagas Order Service Customer Service availability(createOrder) = availability(OrderService) POST /order Credit Reserved More available ๐Ÿ˜„ Complexity of sagas ๐Ÿ˜ข Order created Response =! Validation outcome ๐Ÿ˜ข Order events Customer events https://microservices.io/patterns/data/saga.html
  • 64. @crichardson Improving availability: CQRS Order Service Customer Service availability(createOrder) = availability(OrderService) POST /order Customer Created More available ๐Ÿ˜„ Complex/Costly ๐Ÿ˜ข Response = validation outcome ๐Ÿ˜„ Customer creditLimit availableCredit Replicated Owned Customer creditLimit availableCredit Credit Limit Changed https://microservices.io/patterns/data/cqrs.html
  • 66. @crichardson Summary: What is the microservice architecture? The microservice architecture is an architectural style that structures an application as a set of services that are โ€ข Highly maintainable and testable โ€ข Minimal lead time โ€ข High deployment frequency โ€ข Loosely coupled โ€ข Independently deployable โ€ข Implements a business capability โ€ข Owned/developed/tested/deployed by a small team
  • 67. @crichardson Summary: Why should you care about the microservice architecture? Process: Lean + DevOps/Continuous Delivery & Deployment Architecture: microservices Testability Deployability Modularity Modularity Evolvability Maintainability Availability Deliver changes to long-lived applications rapidly, frequently and reliably Organization: Small, long- lived, product-centric, autonomous teams Organizational Performance