SlideShare a Scribd company logo
1 of 55
Download to read offline
@crichardson
Dark energy, dark matter and
microservice architecture
collaboration patterns
Chris Richardson


Microservice architecture consultant and trainer


Founder of the original CloudFoundry.com


Author of POJOs in Action and Microservices Patterns


Founder of Eventuate.io


@crichardson


chris@chrisrichardson.net


http://adopt.microservices.io
Copyright © 2022. Chris Richardson Consulting, Inc. All rights reserved
@crichardson
Presentation goal
How to design system
operations that span multiple
services
@crichardson
About Chris
http://adopt.microservices.io
@crichardson
Discounts
35% discount


au35ric


$100 discount coupon


GBXCCPJD until July 11th
http://adopt.microservices.io
@crichardson
Agenda
Dark energy, dark matter and de
fi
ning a microservice
architecture


Overview of service collaboration patterns


Designing system commands


Designing system queries
@crichardson
How to de
fi
ne an
Architecture

Application
â‰Șsubdomain≫


Customer
management
â‰Șaggregate≫


Customer
â‰Șsubdomain≫


Order
management
â‰Șaggregate≫


Order
createCustomer()
createOrder()
fi
ndOrder()
fi
ndOrderHistory()
System operations
Distill
Requirements
Event storming
Functional requirements
As a consumer
I want to place an Order
So that I can 
.
As a Restaurant
I want to accept an Order
So that I can 
.
User stories
‱ SLA: Reliability/Latency


‱ Scalability


‱ 

System quality attributes
The “requests” that the
application implements
Customer Team
Order Team
About Subdomains
‱ Business capability/function/etc


‱ Logical view: packages and classes


‱ Team-sized


‱ Loosely coupled (Conways law)
1
2
@crichardson
Application

 how to de
fi
ne an
Architecture

Application
â‰Șsubdomain≫


Customer
â‰Șaggregate≫


Customer
â‰Șsubdomain≫


Order
â‰Șaggregate≫


Order
createCustomer()
createOrder()
fi
ndOrder()
fi
ndOrderHistory()
System operations
Component
â‰Șsubdomain≫
â‰Șsubdomain≫
â‰Șsubdomain≫
â‰Șsubdomain≫
How to group
subdomains
into
components*?
Component Component
* Component = deployable, executable, e.g. WAR
fi
le, executable JAR, 

3
Deployable, Executable,


e.g. WAR
fi
le, executable
JAR, 

@crichardson
Application

 how to de
fi
ne an
Architecture
createCustomer()
createOrder()
fi
ndOrder()
fi
ndOrderHistory()
System operations
Component
â‰Șsubdomain≫
â‰Șsubdomain≫
Component
â‰Șsubdomain≫
â‰Șsubdomain≫
Component
Design
collaborations*
Distributed
4
*Collaboration =
interactions via REST,
messages etc.
@crichardson
Grouping subdomains into
components: together or separate?
â‰Șsubdomain≫


Customer
â‰Șaggregate≫


Customer
â‰Șsubdomain≫


Order
â‰Șaggregate≫


Order
Attraction
Repulsion
Generated by
system operations
Simple components


Team-sized services


Fast deployment pipeline




Dark energy: an anti-
gravity that’s accelerating
the expansion of the
universe
Dark matter: an invisible
matter that has a
gravitational effect on stars
and galaxies.
https://www.nasa.gov/feature/goddard/2020/new-hubble-data-explains-missing-dark-matter
Simple interactions


Prefer ACID or BASE


Minimize runtime coupling




https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html
@crichardson
Dark energy: repulsive forces
subdomains in different services
https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html
Service
Service
«Subdomain» A
«Aggregate»
X
«Subdomain» B
«Aggregate»
Y
Simple components
Team autonomy
Fast deployment pipeline
Support multiple technology stacks
Cost eïŹ€ective scaling
Segregate regulated software
Segregate highly available components
@crichardson
Dark matter: attractive forces
subdomains in same service
https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html
Subdomain A
«Aggregate»
X
Subdomain B
«Aggregate»
Y
Service A Service B
Simple interactions
Prefer ACID over BASE
Minimize runtime coupling
EïŹƒcient communication
Minimize design time coupling
SystemOperation()
Generates
@crichardson
The role of the architect is to
balance con
fl
icting forces
Minimize attraction
Service
Subdomain
Subdomain
Minimize


repulsion
Service
Subdomain
Subdomain
Minimize


repulsion
Con
fl
icting goals
@crichardson
Balancing forces is an iterative process
Partition subdomains to
de
fi
ne services to resolve
dark energy forces
Design system operations


(service collaborations) to
resolve dark matter forces
Adjust service de
fi
nitions to enable
resolution of dark matter forces
@crichardson
Agenda
Dark energy, dark matter and de
fi
ning a microservice
architecture


Overview of service collaboration patterns


Designing system commands


Designing system queries
@crichardson
After partitioning subdomains into services:
‱ Simple interactions


‱ Prefer ACID over BASE


‱ Minimize runtime coupling


‱ Ef
fi
cient inter-service communication


‱ Minimize design time coupling
createCustomer()
Customer
Service
createOrder()
Order
Service
Restaurant
Service
Customer
Service
Collaboration
✅ ?
Local operation Distributed operation
â‰Șentity≫


Restaurant
â‰Șentity≫


Customer
â‰Șentity≫


Order
â‰Șentity≫


Customer
ACID transaction ??? transaction
Owned by
service
@crichardson
Distributed system operation =


ACID transaction
Customer
Service
Restaurant
Service
createOrder()
Order Service
Distributed ACID transaction
BEGIN transaction






COMMIT transaction
@crichardson
Pattern: Shared database schema
Order Service
Customer
Service
Order
table
Customer
table
createOrder()
ACID


Transaction


(Maybe 2PC)
https://microservices.io/patterns/data/shared-database.html
reserveCredit()
creditOrder()

 Service

 table
BEGIN transaction






COMMIT transaction
@crichardson
Bene
fi
ts and drawbacks: shared schema
Dark energy repulsive forces
Support multiple technology stacks ❌ DBs be able to participate in same transaction
Dark matter attractive forces
Simple interactions ✅ No service-service interaction!?
Prefer ACID over BASE ✅ ACID transaction
Minimize runtime coupling ❌ DB-level coupling/interference
Ef
fi
cient inter-service communication ✅ No service-service interaction!?
Minimize design time coupling
❌ Schema changes must be coordinated


❌ Duplicated business logic
@crichardson
Pattern: Private database schema
Order Service
Customer
Service
Order


table
Customer
table
API
createOrder()
2PC


Transaction
https://microservices.io/patterns/data/database-per-service.html
reserveCredit()
BEGIN transaction






COMMIT transaction
@crichardson
Private database + 2PC: Bene
fi
ts and drawbacks
Dark energy repulsive forces
Support multiple technology stacks


❌ Participants must use 2PC-
compatible technology
Dark matter attractive forces
Simple interactions ? Depends on operation
Prefer ACID over BASE


✅
Minimize runtime coupling ❌ all participants must be available
Ef
fi
cient inter-service communication ? Depends on operation
Minimize design time coupling ? Depends on operation
@crichardson
Distributed system operation =


Basically Available, Soft state, Eventually
consistent transaction
Service A
Transaction scope


=


service
distributedOperation()
BEGIN transaction






COMMIT transaction
Service B
BEGIN transaction






COMMIT transaction
Service C
BEGIN transaction






COMMIT transaction
@crichardson
ACID vs. BASE
2PC BASE
Dark energy repulsive forces
Support multiple technology stacks ❌ ✅
Dark matter attractive forces
Prefer ACID over BASE ✅ ❌
Minimize runtime coupling ❌ ✅ (Mostly)
@crichardson
Eventually consistent service
collaboration patterns
API Composition
Provider
Service
Service
query()
Composer
Provider
Service
Provider
Service
CQRS
Provider
Service
Service
query()
View
Provider
Service
Provider
Service
Event
Event
Event
Service
Service Service
Transaction
Compensating
transaction
Transaction
Compensating
transaction
Transaction
Compensating
transaction
command()
Saga
Service
Service
command()
Replica Source
Event
Command-side replica
Commands
Queries
@crichardson
Agenda
Dark energy, dark matter and de
fi
ning a microservice
architecture


Overview of service collaboration patterns


Designing system commands


Designing system queries
@crichardson
Let’s imagine that you are implementing
the createOrder() command

Service Operation Potential failure
Order Service Create Order Invalid quantities
Restaurant Service
Validate and price menu
items (Order subtotal)
Invalid menu items
Customer Service Reserve credit Insuf
fi
cient credit
Kitchen Service Create Ticket Out of stock ingredient
@crichardson
Command patterns
Service
Service Service
Transaction
Compensating
transaction
Transaction
Compensating
transaction
Transaction
Compensating
transaction
command()
Saga
Service
Service
command()
Replica Source
Event
Command-side replica
@crichardson
From a 1987 paper Service
Service Service
Transaction
Compensating
transaction
Transaction
Compensating
transaction
Transaction
Compensating
transaction
command()
Saga
@crichardson
Saga = sequence of local transactions
Service A
Local ACID


transaction
Service B
Local ACID


transaction
Service C
Local ACID


transaction
https://microservices.io/patterns/data/saga.html
@crichardson
The CreateOrderSaga
Step Participant Transaction
Compensating
transaction
1 Order Service createOrder() rejectOrder()
2 Restaurant Service validateAndPrice() -
3 Order Service updateSubtotal() -
4 Customer Service reserveCredit() releaseCredit()
5 Kitchen Service createTicket()
6 Order Service approveOrder() Can fail!
Undo
Lock
Unlock
Unlock
Semantic lock countermeasure = Semantic ACID
Can fail!
Need to rollback
@crichardson
Saga coordination =
sequencing of steps
Choreography: distributed decision making


vs.


Orchestration: centralized decision making
@crichardson
Choreography-based Create Order
Saga
Order Created
Credit Reserved
Create Order
Order


state


total




create()


Order events channel
Customer events channel
Order


Service
Customer


Service
Restaurant


Service
Restaurants events channel
Order total calculated
MenuItems Priced
Ticket Created
Kitchen


Service
Kitchen events channel
Order credit reserved
approve()
@crichardson
Order Service
CreateOrderSaga orchestrator
Restaurant
Service
Order


state


total

reserveCredit()
CreateOrder


Saga
OrderService
create()
create()


Items Priced
Restaurant command channel
Saga reply channel
Create Order Order ID
Customer Service
Customer command channel
validateAndPrice()
Credit Reserved
updateSubtotal()
Kitchen Service
Kitchen command channel
approve()
@crichardson
Bene
fi
ts and drawbacks of Sagas
Dark energy repulsive forces
Support multiple technology stacks


✅
Dark matter attractive forces
Simple interactions ? Depends on command
Prefer ACID over BASE ❌
Minimize runtime coupling ? Depends on command
Ef
fi
cient inter-service communication ? Depends on command
Minimize design time coupling ? Depends on command
Force: Prefer ACID over BASE ❌
No automatic undo =>
extra work to implement
compensating
transactions


Potential complexity of
undoing changes to data
that was changed by
another transaction
Create Order Saga Create Order Saga
Order Service:


createOrder()
Customer Service:


reserveCredit()
Order Service:


createOrder()
Customer Service:


reserveCredit()
Kitchen Service:


createTicket()
Customer Service:


releaseCredit()
FAILS!
Compensating transaction:


‱ Undoes change to available credit


‱ Fortunately: add/subtract commute
Updates


available credit
Force: Prefer ACID over BASE ❌
Sagas are ACD - lack I =
isolation => concurrent
execution => potential data
anomalies:


Dirty reads


Lost updates


Fuzzy reads


Must implement
countermeasures = application-
level ACID, e.g. Semantic lock
Cancel Order Saga Create Order Saga
Order Service:


cancelOrder()
Customer Service:


releaseCredit()
Order Service:


createOrder()
Customer Service:


reserveCredit()
Kitchen Service:


createTicket()
Customer Service:


reserveCredit()
Dirty read:
Exceeds customer
credit limit
FAILS!
Compensating transaction
@crichardson
Force: Minimize runtime coupling -
depends on when response is sent
Order
Service
createOrder()
Order Created
1
Response
2
3
✅
Order
Service
createOrder()
Ticket Created
1
Response
7
8
Self-Contained
Restaurant
Service
Customer
Service
Kitchen Service
Tightly coupled ❌
@crichardson
Force: minimize design-time
coupling
Order
Service
Restaurant
Service
Customer
Service
Order
Service
Restaurant
Service
Customer
Service
Choreography Orchestration
Participants depend on each other Orchestrator depends on participants
Inappropriate
knowledge of
Orders? Simple API
@crichardson
Sagas are potentially complex


BUT
They can be simple


It depends
Order Service
createOrder()
Ful
fi
llment Service
Order Created
@crichardson
Service
Service
command()
Replica Source
Event
Command-side replica
@crichardson
Using a command-side replica
Order Service
createOrder()
Restaurant
Service
Orders
Restaurants
Restaurant events
Replica
Validate and price line
items without invoking
Restaurant Service
Restaurant
MenuItem
MenuItem
createRestaurant()
@crichardson
Bene
fi
ts and drawbacks of Command-side replica
Dark energy repulsive forces
Support multiple technology stacks ✅ e.g. even different DBs
Dark matter attractive forces
Simple interactions
✅ Eliminates interaction with participant


❌ Other cmds must publish events
Prefer ACID over BASE ❌ Risk of stale/inconsistent data
Minimize runtime coupling
✅ Command does not interact with
participant
Ef
fi
cient inter-service communication
✅ Command is less distributed


❌ Cost of replication - storage + events
Minimize design time coupling
? Risk of tightly coupling view to
providers
@crichardson
Force: Minimize runtime coupling -
non-local but self-contained operation
Order Service
createOrder()
Orders
Restaurants
Response
Outcome of
validating and
pricing line
items
https://microservices.io/patterns/decomposition/self-contained-service.html
@crichardson
Agenda
Dark energy, dark matter and de
fi
ning a microservice
architecture


Overview of service collaboration patterns


Designing system commands


Designing system queries
@crichardson
Let’s imagine that you are
implementing the
fi
ndOrder() query
Service Operation
Order Service Status of order: line items
Kitchen Service Status of ticket: ready for pickup
Delivery Service Status of delivery: ETA
Accounting Service Status of payment: total including tax
@crichardson
Query patterns
API Composition
Provider
Service
Service
query()
Composer
Provider
Service
Provider
Service
CQRS
Provider
Service
Service
query()
View
Provider
Service
Provider
Service
Event
Event
Event
@crichardson
API Composition pattern
Order Service
Order
status
Delivery
Service
Delivery
Accounting
Service
Order
status
API Gateway
GET /orders/id
GET /orders?orderId=id
GET /orders/id
GET /deliveries?orderId=id
status


eta
Kitchen
Service
Ticket
status


prepareBy
GET /tickets?orderId=id
{
 response 
}
API
Composer
Providers
Composer
@crichardson
Bene
fi
ts and drawbacks of API Composition
Dark energy repulsive forces
Support multiple technology stacks


✅
Dark matter attractive forces
Simple interactions ? Possibility of many roundtrips
Prefer ACID over BASE
❌ Multiple queries - potential for inconsistencies


Minimize runtime coupling
❌ Use resiliency patterns (eg. Circuit breaker) to
reduce impact
Ef
fi
cient inter-service communication
? Parallelization can reduce latency
Possibility of many roundtrips or large data transfers
Minimize design time coupling ❌ Composer coupled to providers
@crichardson
Inef
fi
cient API composition:
fi
ndOrderHistory()
Order Service
Order
status
Delivery Service
Delivery
Accounting Service
Order
status
API Gateway
GET /orders?


consumerId=abc&


text=noodles&offset=ABC
GET /orders?


consumerId=abc&


text=noodles&offset=ABC
GET /deliveries?


consumerId=abc&


text=noodles&offset=ABC
GET /orders?


consumerId=abc&


text=noodles&offset=ABC
X X
No line items for text search


Different sort order
status


eta
Order


Line


Item
Composer
@crichardson
CQRS
Provider
Service
Service
query()
View
Provider
Service
Provider
Service
Event
Event
Event
@crichardson
Implementing a query using CQRS
Order
Service
Delivery
Service
Order events
Delivery events
fi
ndOrderHistory()
Order events channel
Delivery events channel
Order
History


Service
Replica
View
Database
https://microservices.io/patterns/data/cqrs.html

 Service

 events channel

 events
@crichardson
Bene
fi
ts and drawbacks of CQRS
Dark matter repulsive forces
Support multiple technology stacks


✅ View DB different than Provider DBs
Dark matter attractive forces
Simple interactions
✅ Query is local


❌ Other cmds must publish events
Prefer ACID over BASE ❌ Out of order events => Inconsistencies
Minimize runtime coupling ✅
Ef
fi
cient inter-service communication
✅ Query is self-contained


❌ Cost of replication - storage + events
Minimize design time coupling
? Risk of view being tightly coupled to
providers
@crichardson
Summary: a microservice architecture
must balance con
fl
icting forces
Service
Subdomain
Subdomain
Service
Subdomain
Subdomain
Minimize dark
energy repulsive
forces
Con
fl
icting
Minimize dark matter
attractive forces
systemOperation()
Minimize dark
energy repulsive
forces
generates
@crichardson
Summary: design system operations
using the collaboration patterns
API Composition
Provider
Service
Service
query()
Composer
Provider
Service
Provider
Service
CQRS
Provider
Service
Service
query()
View
Provider
Service
Provider
Service
Event
Event
Event
Service
Service Service
Transaction
Compensating
transaction
Transaction
Compensating
transaction
Transaction
Compensating
transaction
command()
Saga
Service
Service
command()
Replica Source
Event
Command-side replica
Distributed ACID transactions
X
@crichardson
Summary:


Adjust service boundaries if dark
matter forces cannot be suf
fi
ciently
resolved
@crichardson
@crichardson chris@chrisrichardson.net
http://adopt.microservices.io
Questions?
au35ric GBXCCPJD

More Related Content

Similar to Dark energy, dark matter and microservice architecture collaboration patterns

YOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous MicroservicesYOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous MicroservicesChris Richardson
 
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 ArchitectureChris Richardson
 
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...Chris Richardson
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Chris Richardson
 
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 (...Chris Richardson
 
Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Chris Richardson
 
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...Chris Richardson
 
A pattern language for microservices (#gluecon #gluecon2016)
A pattern language for microservices (#gluecon #gluecon2016)A pattern language for microservices (#gluecon #gluecon2016)
A pattern language for microservices (#gluecon #gluecon2016)Chris Richardson
 
Gluecon: Using sagas to maintain data consistency in a microservice architecture
Gluecon: Using sagas to maintain data consistency in a microservice architectureGluecon: Using sagas to maintain data consistency in a microservice architecture
Gluecon: Using sagas to maintain data consistency in a microservice architectureChris Richardson
 
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with SagasJavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with SagasChris Richardson
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled servicesChris Richardson
 
TU Delft Presentation - Cloud & Serverless
TU Delft Presentation - Cloud & ServerlessTU Delft Presentation - Cloud & Serverless
TU Delft Presentation - Cloud & ServerlessSander Knape
 
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 MicroservicesChris Richardson
 
Oracle Code One: Events and commands: developing asynchronous microservices
Oracle Code One: Events and commands: developing asynchronous microservicesOracle Code One: Events and commands: developing asynchronous microservices
Oracle Code One: Events and commands: developing asynchronous microservicesChris Richardson
 
agile microservices @scaibo
agile microservices @scaiboagile microservices @scaibo
agile microservices @scaiboCiro Donato Caiazzo
 
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...Chris Richardson
 
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.pdfChris Richardson
 
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 MicroservicesChris Richardson
 
microXchg: Managing data consistency in a microservice architecture using Sagas
microXchg: Managing data consistency in a microservice architecture using SagasmicroXchg: Managing data consistency in a microservice architecture using Sagas
microXchg: Managing data consistency in a microservice architecture using SagasChris Richardson
 
Dev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceDev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceChristina Lin
 

Similar to Dark energy, dark matter and microservice architecture collaboration patterns (20)

YOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous MicroservicesYOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: 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
 
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...
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 
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 (...
 
Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)
 
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...
 
A pattern language for microservices (#gluecon #gluecon2016)
A pattern language for microservices (#gluecon #gluecon2016)A pattern language for microservices (#gluecon #gluecon2016)
A pattern language for microservices (#gluecon #gluecon2016)
 
Gluecon: Using sagas to maintain data consistency in a microservice architecture
Gluecon: Using sagas to maintain data consistency in a microservice architectureGluecon: Using sagas to maintain data consistency in a microservice architecture
Gluecon: Using sagas to maintain data consistency in a microservice architecture
 
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with SagasJavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
 
TU Delft Presentation - Cloud & Serverless
TU Delft Presentation - Cloud & ServerlessTU Delft Presentation - Cloud & Serverless
TU Delft Presentation - Cloud & Serverless
 
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
 
Oracle Code One: Events and commands: developing asynchronous microservices
Oracle Code One: Events and commands: developing asynchronous microservicesOracle Code One: Events and commands: developing asynchronous microservices
Oracle Code One: Events and commands: developing asynchronous microservices
 
agile microservices @scaibo
agile microservices @scaiboagile microservices @scaibo
agile microservices @scaibo
 
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...
 
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
 
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
 
microXchg: Managing data consistency in a microservice architecture using Sagas
microXchg: Managing data consistency in a microservice architecture using SagasmicroXchg: Managing data consistency in a microservice architecture using Sagas
microXchg: Managing data consistency in a microservice architecture using Sagas
 
Dev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceDev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advance
 

More from Chris Richardson

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?Chris Richardson
 
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...Chris Richardson
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 Chris Richardson
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Chris Richardson
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...Chris Richardson
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Chris Richardson
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...Chris Richardson
 
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 applicationChris Richardson
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolithChris Richardson
 
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 MicroservicesChris Richardson
 
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)Chris Richardson
 
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...Chris Richardson
 
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...Chris Richardson
 
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 SagasChris Richardson
 
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...Chris Richardson
 
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...Chris Richardson
 

More from Chris Richardson (16)

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?
 
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...
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
 
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
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
 
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
 
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)
 
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...
 
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...
 
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
 
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...
 
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...
 

Recently uploaded

Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessEnvertis Software Solutions
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy LĂłpez
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 

Recently uploaded (20)

Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 

Dark energy, dark matter and microservice architecture collaboration patterns

  • 1. @crichardson Dark energy, dark matter and microservice architecture collaboration patterns Chris Richardson Microservice architecture consultant and trainer Founder of the original CloudFoundry.com Author of POJOs in Action and Microservices Patterns Founder of Eventuate.io @crichardson chris@chrisrichardson.net http://adopt.microservices.io Copyright © 2022. Chris Richardson Consulting, Inc. All rights reserved
  • 2. @crichardson Presentation goal How to design system operations that span multiple services
  • 4. @crichardson Discounts 35% discount au35ric $100 discount coupon GBXCCPJD until July 11th http://adopt.microservices.io
  • 5. @crichardson Agenda Dark energy, dark matter and de fi ning a microservice architecture Overview of service collaboration patterns Designing system commands Designing system queries
  • 6. @crichardson How to de fi ne an Architecture
 Application â‰Șsubdomain≫ Customer management â‰Șaggregate≫ Customer â‰Șsubdomain≫ Order management â‰Șaggregate≫ Order createCustomer() createOrder() fi ndOrder() fi ndOrderHistory() System operations Distill Requirements Event storming Functional requirements As a consumer I want to place an Order So that I can 
. As a Restaurant I want to accept an Order So that I can 
. User stories ‱ SLA: Reliability/Latency ‱ Scalability ‱ 
 System quality attributes The “requests” that the application implements Customer Team Order Team About Subdomains ‱ Business capability/function/etc ‱ Logical view: packages and classes ‱ Team-sized ‱ Loosely coupled (Conways law) 1 2
  • 7. @crichardson Application 
 how to de fi ne an Architecture
 Application â‰Șsubdomain≫ Customer â‰Șaggregate≫ Customer â‰Șsubdomain≫ Order â‰Șaggregate≫ Order createCustomer() createOrder() fi ndOrder() fi ndOrderHistory() System operations Component â‰Șsubdomain≫ â‰Șsubdomain≫ â‰Șsubdomain≫ â‰Șsubdomain≫ How to group subdomains into components*? Component Component * Component = deployable, executable, e.g. WAR fi le, executable JAR, 
 3 Deployable, Executable, e.g. WAR fi le, executable JAR, 

  • 8. @crichardson Application 
 how to de fi ne an Architecture createCustomer() createOrder() fi ndOrder() fi ndOrderHistory() System operations Component â‰Șsubdomain≫ â‰Șsubdomain≫ Component â‰Șsubdomain≫ â‰Șsubdomain≫ Component Design collaborations* Distributed 4 *Collaboration = interactions via REST, messages etc.
  • 9. @crichardson Grouping subdomains into components: together or separate? â‰Șsubdomain≫ Customer â‰Șaggregate≫ Customer â‰Șsubdomain≫ Order â‰Șaggregate≫ Order Attraction Repulsion Generated by system operations Simple components Team-sized services Fast deployment pipeline 
 Dark energy: an anti- gravity that’s accelerating the expansion of the universe Dark matter: an invisible matter that has a gravitational effect on stars and galaxies. https://www.nasa.gov/feature/goddard/2020/new-hubble-data-explains-missing-dark-matter Simple interactions Prefer ACID or BASE Minimize runtime coupling 
 https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html
  • 10. @crichardson Dark energy: repulsive forces subdomains in different services https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html Service Service «Subdomain» A «Aggregate» X «Subdomain» B «Aggregate» Y Simple components Team autonomy Fast deployment pipeline Support multiple technology stacks Cost eïŹ€ective scaling Segregate regulated software Segregate highly available components
  • 11. @crichardson Dark matter: attractive forces subdomains in same service https://chrisrichardson.net/post/microservices/2021/11/30/dark-matter-dark-energy.html Subdomain A «Aggregate» X Subdomain B «Aggregate» Y Service A Service B Simple interactions Prefer ACID over BASE Minimize runtime coupling EïŹƒcient communication Minimize design time coupling SystemOperation() Generates
  • 12. @crichardson The role of the architect is to balance con fl icting forces Minimize attraction Service Subdomain Subdomain Minimize repulsion Service Subdomain Subdomain Minimize repulsion Con fl icting goals
  • 13. @crichardson Balancing forces is an iterative process Partition subdomains to de fi ne services to resolve dark energy forces Design system operations (service collaborations) to resolve dark matter forces Adjust service de fi nitions to enable resolution of dark matter forces
  • 14. @crichardson Agenda Dark energy, dark matter and de fi ning a microservice architecture Overview of service collaboration patterns Designing system commands Designing system queries
  • 15. @crichardson After partitioning subdomains into services: ‱ Simple interactions ‱ Prefer ACID over BASE ‱ Minimize runtime coupling ‱ Ef fi cient inter-service communication ‱ Minimize design time coupling createCustomer() Customer Service createOrder() Order Service Restaurant Service Customer Service Collaboration ✅ ? Local operation Distributed operation â‰Șentity≫ Restaurant â‰Șentity≫ Customer â‰Șentity≫ Order â‰Șentity≫ Customer ACID transaction ??? transaction Owned by service
  • 16. @crichardson Distributed system operation = ACID transaction Customer Service Restaurant Service createOrder() Order Service Distributed ACID transaction BEGIN transaction 
 COMMIT transaction
  • 17. @crichardson Pattern: Shared database schema Order Service Customer Service Order table Customer table createOrder() ACID Transaction (Maybe 2PC) https://microservices.io/patterns/data/shared-database.html reserveCredit() creditOrder() 
 Service 
 table BEGIN transaction 
 COMMIT transaction
  • 18. @crichardson Bene fi ts and drawbacks: shared schema Dark energy repulsive forces Support multiple technology stacks ❌ DBs be able to participate in same transaction Dark matter attractive forces Simple interactions ✅ No service-service interaction!? Prefer ACID over BASE ✅ ACID transaction Minimize runtime coupling ❌ DB-level coupling/interference Ef fi cient inter-service communication ✅ No service-service interaction!? Minimize design time coupling ❌ Schema changes must be coordinated ❌ Duplicated business logic
  • 19. @crichardson Pattern: Private database schema Order Service Customer Service Order table Customer table API createOrder() 2PC Transaction https://microservices.io/patterns/data/database-per-service.html reserveCredit() BEGIN transaction 
 COMMIT transaction
  • 20. @crichardson Private database + 2PC: Bene fi ts and drawbacks Dark energy repulsive forces Support multiple technology stacks ❌ Participants must use 2PC- compatible technology Dark matter attractive forces Simple interactions ? Depends on operation Prefer ACID over BASE ✅ Minimize runtime coupling ❌ all participants must be available Ef fi cient inter-service communication ? Depends on operation Minimize design time coupling ? Depends on operation
  • 21. @crichardson Distributed system operation = Basically Available, Soft state, Eventually consistent transaction Service A Transaction scope = service distributedOperation() BEGIN transaction 
 COMMIT transaction Service B BEGIN transaction 
 COMMIT transaction Service C BEGIN transaction 
 COMMIT transaction
  • 22. @crichardson ACID vs. BASE 2PC BASE Dark energy repulsive forces Support multiple technology stacks ❌ ✅ Dark matter attractive forces Prefer ACID over BASE ✅ ❌ Minimize runtime coupling ❌ ✅ (Mostly)
  • 23. @crichardson Eventually consistent service collaboration patterns API Composition Provider Service Service query() Composer Provider Service Provider Service CQRS Provider Service Service query() View Provider Service Provider Service Event Event Event Service Service Service Transaction Compensating transaction Transaction Compensating transaction Transaction Compensating transaction command() Saga Service Service command() Replica Source Event Command-side replica Commands Queries
  • 24. @crichardson Agenda Dark energy, dark matter and de fi ning a microservice architecture Overview of service collaboration patterns Designing system commands Designing system queries
  • 25. @crichardson Let’s imagine that you are implementing the createOrder() command
 Service Operation Potential failure Order Service Create Order Invalid quantities Restaurant Service Validate and price menu items (Order subtotal) Invalid menu items Customer Service Reserve credit Insuf fi cient credit Kitchen Service Create Ticket Out of stock ingredient
  • 27. @crichardson From a 1987 paper Service Service Service Transaction Compensating transaction Transaction Compensating transaction Transaction Compensating transaction command() Saga
  • 28. @crichardson Saga = sequence of local transactions Service A Local ACID transaction Service B Local ACID transaction Service C Local ACID transaction https://microservices.io/patterns/data/saga.html
  • 29. @crichardson The CreateOrderSaga Step Participant Transaction Compensating transaction 1 Order Service createOrder() rejectOrder() 2 Restaurant Service validateAndPrice() - 3 Order Service updateSubtotal() - 4 Customer Service reserveCredit() releaseCredit() 5 Kitchen Service createTicket() 6 Order Service approveOrder() Can fail! Undo Lock Unlock Unlock Semantic lock countermeasure = Semantic ACID Can fail! Need to rollback
  • 30. @crichardson Saga coordination = sequencing of steps Choreography: distributed decision making vs. Orchestration: centralized decision making
  • 31. @crichardson Choreography-based Create Order Saga Order Created Credit Reserved Create Order Order state total 
 create() 
 Order events channel Customer events channel Order Service Customer Service Restaurant Service Restaurants events channel Order total calculated MenuItems Priced Ticket Created Kitchen Service Kitchen events channel Order credit reserved approve()
  • 32. @crichardson Order Service CreateOrderSaga orchestrator Restaurant Service Order state total
 reserveCredit() CreateOrder Saga OrderService create() create() 
 Items Priced Restaurant command channel Saga reply channel Create Order Order ID Customer Service Customer command channel validateAndPrice() Credit Reserved updateSubtotal() Kitchen Service Kitchen command channel approve()
  • 33. @crichardson Bene fi ts and drawbacks of Sagas Dark energy repulsive forces Support multiple technology stacks ✅ Dark matter attractive forces Simple interactions ? Depends on command Prefer ACID over BASE ❌ Minimize runtime coupling ? Depends on command Ef fi cient inter-service communication ? Depends on command Minimize design time coupling ? Depends on command
  • 34. Force: Prefer ACID over BASE ❌ No automatic undo => extra work to implement compensating transactions Potential complexity of undoing changes to data that was changed by another transaction Create Order Saga Create Order Saga Order Service: createOrder() Customer Service: reserveCredit() Order Service: createOrder() Customer Service: reserveCredit() Kitchen Service: createTicket() Customer Service: releaseCredit() FAILS! Compensating transaction: ‱ Undoes change to available credit ‱ Fortunately: add/subtract commute Updates available credit
  • 35. Force: Prefer ACID over BASE ❌ Sagas are ACD - lack I = isolation => concurrent execution => potential data anomalies: Dirty reads Lost updates Fuzzy reads Must implement countermeasures = application- level ACID, e.g. Semantic lock Cancel Order Saga Create Order Saga Order Service: cancelOrder() Customer Service: releaseCredit() Order Service: createOrder() Customer Service: reserveCredit() Kitchen Service: createTicket() Customer Service: reserveCredit() Dirty read: Exceeds customer credit limit FAILS! Compensating transaction
  • 36. @crichardson Force: Minimize runtime coupling - depends on when response is sent Order Service createOrder() Order Created 1 Response 2 3 ✅ Order Service createOrder() Ticket Created 1 Response 7 8 Self-Contained Restaurant Service Customer Service Kitchen Service Tightly coupled ❌
  • 37. @crichardson Force: minimize design-time coupling Order Service Restaurant Service Customer Service Order Service Restaurant Service Customer Service Choreography Orchestration Participants depend on each other Orchestrator depends on participants Inappropriate knowledge of Orders? Simple API
  • 38. @crichardson Sagas are potentially complex BUT They can be simple It depends Order Service createOrder() Ful fi llment Service Order Created
  • 40. @crichardson Using a command-side replica Order Service createOrder() Restaurant Service Orders Restaurants Restaurant events Replica Validate and price line items without invoking Restaurant Service Restaurant MenuItem MenuItem createRestaurant()
  • 41. @crichardson Bene fi ts and drawbacks of Command-side replica Dark energy repulsive forces Support multiple technology stacks ✅ e.g. even different DBs Dark matter attractive forces Simple interactions ✅ Eliminates interaction with participant ❌ Other cmds must publish events Prefer ACID over BASE ❌ Risk of stale/inconsistent data Minimize runtime coupling ✅ Command does not interact with participant Ef fi cient inter-service communication ✅ Command is less distributed ❌ Cost of replication - storage + events Minimize design time coupling ? Risk of tightly coupling view to providers
  • 42. @crichardson Force: Minimize runtime coupling - non-local but self-contained operation Order Service createOrder() Orders Restaurants Response Outcome of validating and pricing line items https://microservices.io/patterns/decomposition/self-contained-service.html
  • 43. @crichardson Agenda Dark energy, dark matter and de fi ning a microservice architecture Overview of service collaboration patterns Designing system commands Designing system queries
  • 44. @crichardson Let’s imagine that you are implementing the fi ndOrder() query Service Operation Order Service Status of order: line items Kitchen Service Status of ticket: ready for pickup Delivery Service Status of delivery: ETA Accounting Service Status of payment: total including tax
  • 46. @crichardson API Composition pattern Order Service Order status Delivery Service Delivery Accounting Service Order status API Gateway GET /orders/id GET /orders?orderId=id GET /orders/id GET /deliveries?orderId=id status eta Kitchen Service Ticket status prepareBy GET /tickets?orderId=id {
 response 
} API Composer Providers Composer
  • 47. @crichardson Bene fi ts and drawbacks of API Composition Dark energy repulsive forces Support multiple technology stacks ✅ Dark matter attractive forces Simple interactions ? Possibility of many roundtrips Prefer ACID over BASE ❌ Multiple queries - potential for inconsistencies Minimize runtime coupling ❌ Use resiliency patterns (eg. Circuit breaker) to reduce impact Ef fi cient inter-service communication ? Parallelization can reduce latency Possibility of many roundtrips or large data transfers Minimize design time coupling ❌ Composer coupled to providers
  • 48. @crichardson Inef fi cient API composition: fi ndOrderHistory() Order Service Order status Delivery Service Delivery Accounting Service Order status API Gateway GET /orders? consumerId=abc& text=noodles&offset=ABC GET /orders? consumerId=abc& text=noodles&offset=ABC GET /deliveries? consumerId=abc& text=noodles&offset=ABC GET /orders? consumerId=abc& text=noodles&offset=ABC X X No line items for text search Different sort order status eta Order Line Item Composer
  • 50. @crichardson Implementing a query using CQRS Order Service Delivery Service Order events Delivery events fi ndOrderHistory() Order events channel Delivery events channel Order History Service Replica View Database https://microservices.io/patterns/data/cqrs.html 
 Service 
 events channel 
 events
  • 51. @crichardson Bene fi ts and drawbacks of CQRS Dark matter repulsive forces Support multiple technology stacks ✅ View DB different than Provider DBs Dark matter attractive forces Simple interactions ✅ Query is local ❌ Other cmds must publish events Prefer ACID over BASE ❌ Out of order events => Inconsistencies Minimize runtime coupling ✅ Ef fi cient inter-service communication ✅ Query is self-contained ❌ Cost of replication - storage + events Minimize design time coupling ? Risk of view being tightly coupled to providers
  • 52. @crichardson Summary: a microservice architecture must balance con fl icting forces Service Subdomain Subdomain Service Subdomain Subdomain Minimize dark energy repulsive forces Con fl icting Minimize dark matter attractive forces systemOperation() Minimize dark energy repulsive forces generates
  • 53. @crichardson Summary: design system operations using the collaboration patterns API Composition Provider Service Service query() Composer Provider Service Provider Service CQRS Provider Service Service query() View Provider Service Provider Service Event Event Event Service Service Service Transaction Compensating transaction Transaction Compensating transaction Transaction Compensating transaction command() Saga Service Service command() Replica Source Event Command-side replica Distributed ACID transactions X
  • 54. @crichardson Summary: Adjust service boundaries if dark matter forces cannot be suf fi ciently resolved