SlideShare une entreprise Scribd logo
1  sur  85
Télécharger pour lire hors ligne
Microservices: Decomposing 
@crichardson 
Applications for 
Deployability and Scalability 
Chris Richardson 
Author of POJOs in Action 
Founder of the original CloudFoundry.com 
@crichardson 
chris@chrisrichardson.net 
http://plainoldobjects.com
Presentation goal 
How decomposing applications into 
@crichardson 
microservices 
improves deployability and scalability 
and 
simplifies the adoption of new 
technologies
@crichardson 
About Chris
@crichardson 
About Chris 
Founder of a buzzword compliant (stealthy, social, mobile, 
big data, machine learning, ...) startup 
Consultant helping organizations improve how they 
architect and deploy applications using cloud computing, 
micro services, polyglot applications, NoSQL, ...
@crichardson 
Agenda 
The (sometimes evil) monolith 
Decomposing applications into services 
Client ⇔ service interaction design 
Decentralized data management
@crichardson 
Let’s imagine you are 
building an online store
@crichardson 
Traditional application 
architecture 
StoreFrontUI 
Product Info 
Service 
Recommendation 
Service 
Tomcat 
Browser/ 
Client 
WAR/EAR 
MySQL 
Database 
Review Service 
Simple to 
develop 
test 
deploy 
Load 
balancer 
scale 
Spring MVC 
Spring 
Hibernate 
Order Service 
HTML 
REST/JSON
But large, complex, monolithic 
@crichardson 
applications 
⇒ 
problems
@crichardson 
Intimidates developers
@crichardson 
Obstacle to frequent 
deployments 
Need to redeploy everything to change one component 
Interrupts long running background (e.g. Quartz) jobs 
Increases risk of failure 
Fear of change 
Updates will happen less often - really long QA cycles 
e.g. Makes A/B testing UI really difficult 
Eggs in 
one basket
@crichardson 
Overloads your IDE and 
container 
Slows down development
@crichardson 
Obstacle to scaling 
development 
I want 
to update the UI 
But 
the backend is not working 
yet! 
Lots of coordination and 
communication required
Requires long-term commitment 
to a technology stack 
@crichardson
@crichardson 
Agenda 
The (sometimes evil) monolith 
Decomposing applications into services 
Client ⇔ service interaction design 
Decentralized data management
@crichardson
@crichardson 
The scale cube 
X axis 
- horizontal duplication 
Z axis - data partitioning 
Y axis - 
functional 
decomposition 
similar 
splitting by things 
Scale Scale by 
splitting 
different things
@crichardson 
Y-axis scaling - application level 
WAR 
Storefront UI 
Product Info 
Service 
Recommendation 
Service 
Review 
Service 
Order 
Service
@crichardson 
Y-axis scaling - application level 
Storefront UI 
Product Info 
Service 
Recommendation 
Service 
Review 
Service 
Order 
Service
@crichardson 
Y-axis scaling - application level 
Product Info 
Service 
Product Info 
Recommendation 
Service 
Review 
Service 
Order 
Service 
Browse Products 
UI 
Checkout UI 
Order management 
UI 
Account 
management UI 
Apply X-axis and Z-axis scaling 
to each service independently
Service deployment options 
@crichardson 
Isolation, manageability 
VM or Physical Machine 
Docker/Linux container 
JVM 
JAR/WAR/OSGI bundle/... 
Density/efficiency
@crichardson 
Partitioning strategies... 
Partition by noun, e.g. product info service 
Partition by verb, e.g. Checkout UI 
Single Responsibility Principle 
Unix utilities - do one focussed thing well
@crichardson 
Partitioning strategies 
Too few 
Drawbacks of the monolithic architecture 
Too many - a.k.a. Nano-service anti-pattern 
Runtime overhead 
Potential risk of excessive network hops 
Potentially difficult to understand system 
Something of an art
@crichardson 
Example micro-service
@crichardson 
More service, less micro 
But more realistically... 
Focus on building services that make 
development and deployment easier 
- not just tiny services
@crichardson 
Real world examples 
http://techblog.netflix.com/ 
~600 services 
http://highscalability.com/amazon-architecture 
100-150 services to build a page 
http://www.addsimplicity.com/downloads/ 
eBaySDForum2006-11-29.pdf 
http://queue.acm.org/detail.cfm?id=1394128
@crichardson 
There are many benefits
@crichardson 
Smaller, simpler apps 
Easier to understand and develop 
Less jar/classpath hell - who needs OSGI? 
Faster to build and deploy 
Reduced startup time - important for GAE
Scales development: 
develop, deploy and scale 
each service independently 
@crichardson
@crichardson 
Improves fault isolation
Eliminates long-term commitment 
to a single technology stack 
@crichardson 
Modular, polyglot, multi-framework 
applications
@crichardson 
Two levels of architecture 
System-level 
Services 
Inter-service glue: interfaces and communication mechanisms 
Slow changing 
Service-level 
Internal architecture of each service 
Each service could use a different technology stack 
Pick the best tool for the job 
Rapidly evolving
Easily try other technologies 
@crichardson 
... and fail safely
But there are drawbacks 
@crichardson
@crichardson 
Complexity
Complexity of developing a 
@crichardson 
distributed system 
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
@crichardson 
Multiple databases 
& 
Transaction management 
e.g. Fun with eventual consistency
@crichardson 
Complexity of testing a 
distributed system 
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
Complexity of deploying and 
operating a distributed 
@crichardson 
system 
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html 
You need a lot of automation
@crichardson 
Developing and deploying 
features that span multiple 
services requires careful 
coordination
@crichardson 
When to use it? 
In the beginning: 
•You don’t need it 
•It will slow you down 
Later on: 
•You need it 
•Refactoring is painful
@crichardson 
Agenda 
The (sometimes evil) monolith 
Decomposing applications into services 
Client ⇔ service interaction design 
Decentralized data management
Let’s imagine that you want to 
display a product’s details... 
Product 
Info Reviews 
Recommendations 
@crichardson
Directly connecting the front-end to the backend 
@crichardson 
View Controller 
Model 
Product Info 
service 
Recommendation 
Service 
Review 
service 
REST 
REST 
Thrift 
Traditional server-side 
web application 
View Controller 
Model 
Browser/Native App 
Chatty API 
Web unfriendly 
protocols
@crichardson 
Use an API gateway 
View Controller 
Model 
Product Info 
service 
Recommendation 
Service 
Review 
service 
REST 
REST 
Thrift 
API 
Gateway 
View Controller 
Model 
Browser/Native App 
Single entry point 
Client 
specific APIs 
Protocol 
translation 
Traditional server-side 
web application
@crichardson 
Optimized client-specific 
APIs 
Web 
application 
Mobile 
App 
NodeJS 
API 
Gateway 
REST 
proxy 
Event 
publishing 
Product Info 
service 
Recommendation 
Service 
Review 
service 
REST 
REST 
Thrift 
getProductInfo() 
getRecomm...() 
getReviews() 
getProductDetails()
@crichardson 
Netflix API Gateway 
http://techblog.netflix.com/2013/01/optimizing-netflix-api.html 
Device specific 
end points
@crichardson 
API gateway design 
challenges 
Performance and scalability 
Non-blocking I/O 
Asynchronous, concurrent code 
Handling partial failures 
.... 
http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
@crichardson 
Useful frameworks for 
building an API gateway 
JVM: 
Netty, Vertex 
Netflix Hystrix 
... 
Other: 
NodeJS
How does a browser 
interact with the partitioned 
@crichardson 
web application?
@crichardson 
Partitioned web app ⇒ no 
longer a single base URL 
/products 
Browse Products 
UI 
/checkout 
Checkout UI 
/orders 
Order management 
UI 
/account 
Account 
management UI 
Browser ?
The solution: single entry point 
that routes based on URL 
@crichardson 
/products 
Browse Products 
UI 
/checkout 
Checkout UI 
/orders 
Order management 
UI 
/account 
Account 
management UI 
http://acme.com/<service>/... 
Content 
Browser Router 
Hidden from 
browser 
Single entry 
point
@crichardson 
How do the services 
communicate?
Inter-service communication 
options 
@crichardson 
Synchronous HTTP ⇔ asynchronous AMQP 
Formats: JSON, XML, Protocol Buffers, Thrift, ... 
Asynchronous is preferred 
JSON is fashionable but binary format 
is more efficient
Pros and cons of messaging 
Pros 
Cons 
Decouples client from 
Additional complexity of 
server 
message broker 
Message broker buffers 
Request/reply-style 
messages 
communication is more 
Supports a variety of 
complex 
communication patterns
Pros and cons of HTTP 
Pros 
Simple and familiar 
Request/reply is easy 
Firewall friendly 
No intermediate broker 
Cons 
Only supports request/ 
reply 
Server must be 
available 
Client needs to 
discover URL(s) of 
server(s)
@crichardson 
Discovery option #1: 
Internal load balancer 
Load 
Balancer 
Product Info 
Service 
Product Info 
Service 
Product Info 
Service 
Product Info 
Service 
Client/ 
API gateway 
Services register 
with load balancer 
Client talks to 
load balancer 
Has a well-known 
location 
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/USVPC_creating_basic_lb.html
@crichardson 
Discovery option #2: 
client-side load balancing 
REST 
Client 
Product Info 
Service 
Product Info 
Service 
Product Info 
Service 
Product Info 
Service 
Client 
Service 
Registry 
Services register 
with registry 
Client polls 
registry 
http://techblog.netflix.com/2013/01/announcing-ribbon-tying-netflix-mid.html 
http://techblog.netflix.com/2012/09/eureka.html
@crichardson 
Lots of moving parts! 
PProrodducutc tIn Ifnofo 
Service 
Recommendation 
Service 
Review 
Service 
Order 
Service 
Browse Products UI 
Checkout UI 
Order management 
UI 
Account 
management UI 
API 
Gate 
way 
Service registry 
Content 
Router 
HTML 
Browser 
REST 
Client 
Ext. 
LB 
Ext. 
LB
@crichardson 
Agenda 
The (sometimes evil) monolith 
Decomposing applications into services 
Client ⇔ service interaction design 
Decentralized data management
@crichardson 
Decomposed services ⇒ 
decomposed databases 
Order management Customer management 
Order 
Database 
Customer 
Database 
Separate databases ⇒ less coupling
@crichardson 
Decomposed databases ⇒ 
polyglot persistence 
IEEE Software Sept/October 2010 - Debasish Ghosh / Twitter @debasishg
Untangling orders and customers 
Customer management 
@crichardson 
Order Service 
placeOrder() 
Order management 
Customer Service 
availableCredit() 
updateCustomer() 
Customer 
creditLimit 
... 
Order belongs to has orders 
total 
Invariant: 
sum(order.total) <= creditLimit 
available credit= creditLimit - 
Trouble! sum(order.total)
@crichardson 
Problems 
Reads 
Service A needs to read data owned by service B 
e.g. OrderService needs customer’s credit limit 
e.g Customer Service needs outstanding order total 
Updates 
“Business transaction” must update data owned by 
multiple services 
e.g Creating a User => Create their ShoppingCart
You could use two-phase 
commit (2PC) but ... 
@crichardson
@crichardson 
Use an event-driven 
architecture
UpdateCreditLimitCommand 
@crichardson 
Event-driven architecture 
Customer Service 
updateCustomer() 
CustomerCreditLimitUpdatedEvent 
Message Broker 
Order management 
Order 
total 
Customer’ 
creditLimit 
CustomerCreditLimitUpdatedEvent(...) 
Customer management 
Customer 
creditLimit 
...
Benefits and drawbacks of 
an event-driven architecture 
Benefits: 
Simple infrastructure, e.g. a message broker 
Better availability (than using 2PC) 
Drawbacks: 
Application has to handle eventually consistent data 
Application has to handle duplicate events 
@crichardson
How do services publish 
@crichardson 
events?
@crichardson 
To maintain consistency the 
application must 
atomically publish an event 
whenever 
a domain object changes
@crichardson 
How to generate events 
reliably? 
Database triggers 
Hibernate event listener 
Ad hoc event publishing code mixed into business logic 
Domain events - “formal” modeling of events 
Event Sourcing
Atomically publishing events 
Use distributed transactions to update database and publish 
to message 
Database and message broker must support 2PC 
2PC is best avoided 
Use eventual consistency mechanism: 
1. Update database: new entity state & event to publish 
2. Publish event & mark event as published 
• Difficult to implement when using a NoSQL database :-( 
@crichardson
@crichardson 
Event sourcing 
An event-centric approach to designing domain models 
Request becomes a command that is sent to an Aggregate 
Aggregates handle commands by generating events 
Apply events to an aggregate to update state 
Persist events NOT state 
Replay events to recreate the current state of an aggregate 
Event Store ≃ database + message broker
Request handling in an event-sourced application 
@crichardson 
HTTP 
Handler 
Event 
Store 
pastEvents = findEvents(entityId) 
Account 
new() 
applyEvents(pastEvents) 
newEvents = processCmd(SomeCmd) 
saveEvents(newEvents) 
Microservice A
@crichardson 
Event Store publishes events - 
consumed by other services 
Event 
Store 
Microservice B 
Event 
Subscriber 
subscribe(EventTypes) 
publish(event) 
publish(event) 
Aggregate 
NoSQL 
materialized 
view 
update() 
update()
UpdateCreditLimitCommand 
@crichardson 
Using event sourcing 
Customer Service 
updateCustomer() 
CustomerCreditLimitUpdatedEvent 
Event Store 
Order management 
Order 
total 
Customer’ 
creditLimit 
CustomerCreditLimitUpdatedEvent(...) 
Customer management 
Customer 
creditLimit 
...
@crichardson 
Customer aggregate 
case class Customer(customerId: String, creditLimit: BigDecimal) 
extends ValidatingAggregate[Customer, CustomerCommands.CustomerCommand] { 
def this() = this(null, null) 
override def processCommand = { 
case CreateCustomerCommand(customerId, creditLimit) => 
Seq(CustomerCreatedEvent(customerId, creditLimit)) 
case UpdateCreditLimitCommand(newLimit) if newLimit >= 0 => 
Seq(CustomerCreditLimitUpdatedEvent(newLimit)) 
} 
override def applyEvent = { 
case CustomerCreatedEvent(customerId, creditLimit) => 
copy(customerId=customerId, creditLimit=creditLimit) 
case CustomerCreditLimitUpdatedEvent(newLimit) => 
copy(creditLimit=newLimit) 
} 
} 
Command 
⇒ 
Events 
Event 
⇒ 
Updated 
state
@crichardson 
EventStore API 
trait EventStore { 
def save[T](entityId: Id, events: Seq[Event]): T 
def update[T](entityId: Id, 
version: EntityVersion, events: Seq[Event]): T 
def load[T](entityType: Class[T], entityId: EntityId): T 
def subscribe(...) : ... 
.. 
}
Unfamiliar but it solves many 
problems 
@crichardson 
Eliminates O/R mapping problem 
Supports both SQL and NoSQL databases 
Publishes events reliably 
Reliable eventual consistency framework 
...
@crichardson 
Summary
Monolithic applications are 
simple to develop and deploy 
@crichardson 
BUT have significant 
drawbacks
@crichardson 
Apply the scale cube 
Modular, polyglot, and 
scalable applications 
Services developed, 
deployed and scaled 
independently
Use a modular, polyglot architecture 
View Controller Product Info 
@crichardson 
Model 
service 
Recommendation 
Service 
Review 
service 
REST 
REST 
AMQP 
API 
Gateway 
Server-side web 
application 
View Controller 
Model 
Browser/Native 
application
@crichardson 
Use an event-driven 
architecture
@crichardson 
Start refactoring your 
monolith 
Monolith Anti-corruption Service 
layer 
Glue code 
Pristine
@crichardson chris@chrisrichardson.net 
@crichardson 
Questions? 
http://plainoldobjects.com http://microservices.io

Contenu connexe

Tendances

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 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
 
Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...Chris Richardson
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate PlatformChris Richardson
 
Decomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxDecomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxChris Richardson
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Chris Richardson
 
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 coreChris 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
 
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...Chris Richardson
 
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)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
 
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
 
Code Freeze 2018: There is no such thing as a microservice!
Code Freeze 2018: There is no such thing as a microservice!Code Freeze 2018: There is no such thing as a microservice!
Code Freeze 2018: There is no such thing as a microservice!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
 
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
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Chris Richardson
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled servicesChris Richardson
 
Microservices: Decomposing Applications for Deployability and Scalability (ja...
Microservices: Decomposing Applications for Deployability and Scalability (ja...Microservices: Decomposing Applications for Deployability and Scalability (ja...
Microservices: Decomposing Applications for Deployability and Scalability (ja...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
 
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)Chris Richardson
 

Tendances (20)

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 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...
 
Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
 
Decomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gxDecomposing applications for deployability and scalability #springone2gx #s12gx
Decomposing applications for deployability and scalability #springone2gx #s12gx
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)
 
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
 
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
 
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
 
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
Decompose that WAR? A pattern language for microservices (@QCON @QCONSP)
 
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...
 
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...
 
Code Freeze 2018: There is no such thing as a microservice!
Code Freeze 2018: There is no such thing as a microservice!Code Freeze 2018: There is no such thing as a microservice!
Code Freeze 2018: There is no such thing as a microservice!
 
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...
 
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
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
 
Microservices: Decomposing Applications for Deployability and Scalability (ja...
Microservices: Decomposing Applications for Deployability and Scalability (ja...Microservices: Decomposing Applications for Deployability and Scalability (ja...
Microservices: Decomposing Applications for Deployability and Scalability (ja...
 
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
 
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)
 

En vedette

MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Microservices at Spotify
Microservices at SpotifyMicroservices at Spotify
Microservices at SpotifyKevin Goldsmith
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture PatternsAmazon Web Services
 
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Sander Hoogendoorn
 
MicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scaleMicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scaleSudhir Tonse
 
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
 
Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Adrian Cockcroft
 
Microservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and moreMicroservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and moreMitoc Group
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocitySam Newman
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureIzzet Mustafaiev
 
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...Kevin Goldsmith
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Microservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software DevelopmentMicroservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software DevelopmentEberhard Wolff
 
A Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiA Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiGrowth Intelligence
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overviewcornelia davis
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...Chris Richardson
 

En vedette (20)

MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices at Spotify
Microservices at SpotifyMicroservices at Spotify
Microservices at Spotify
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns
 
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...
 
MicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scaleMicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scale
 
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...
 
From SOA to MSA
From SOA to MSAFrom SOA to MSA
From SOA to MSA
 
Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016
 
Microservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and moreMicroservices Architecture for Web Applications using AWS Lambda and more
Microservices Architecture for Web Applications using AWS Lambda and more
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
How Spotify Builds Products (Organization. Architecture, Autonomy, Accountabi...
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Microservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software DevelopmentMicroservices: Architecture for Agile Software Development
Microservices: Architecture for Agile Software Development
 
A Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiA Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with Luigi
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 

Similaire à Developing applications with a microservice architecture (svcc)

Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonJAXLondon2014
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Chris Richardson
 
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...Chris Richardson
 
SVCC Microservices: Decomposing Applications for Testability and Deployability
SVCC Microservices: Decomposing Applications for Testability and Deployability SVCC Microservices: Decomposing Applications for Testability and Deployability
SVCC Microservices: Decomposing Applications for Testability and Deployability Chris Richardson
 
Decomposing applications for deployability and scalability(SpringSource webinar)
Decomposing applications for deployability and scalability(SpringSource webinar)Decomposing applications for deployability and scalability(SpringSource webinar)
Decomposing applications for deployability and scalability(SpringSource webinar)Chris Richardson
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Chris Richardson
 
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?!Chris Richardson
 
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)Chris Richardson
 
Microservices and Redis #redisconf Keynote
Microservices and Redis #redisconf KeynoteMicroservices and Redis #redisconf Keynote
Microservices and Redis #redisconf KeynoteChris Richardson
 
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...Chris Richardson
 
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Docker, Inc.
 
Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Chris Richardson
 
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! Chris Richardson
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
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
 
A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)Chris Richardson
 
A pattern language for microservices
A pattern language for microservicesA pattern language for microservices
A pattern language for microservicesVMware Tanzu
 
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 microservicesChris Richardson
 
Azure Overview Csco
Azure Overview CscoAzure Overview Csco
Azure Overview Cscorajramab
 
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra DeploymentsBattery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra DeploymentsDataStax Academy
 

Similaire à Developing applications with a microservice architecture (svcc) (20)

Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris Richardson
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
 
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...
 
SVCC Microservices: Decomposing Applications for Testability and Deployability
SVCC Microservices: Decomposing Applications for Testability and Deployability SVCC Microservices: Decomposing Applications for Testability and Deployability
SVCC Microservices: Decomposing Applications for Testability and Deployability
 
Decomposing applications for deployability and scalability(SpringSource webinar)
Decomposing applications for deployability and scalability(SpringSource webinar)Decomposing applications for deployability and scalability(SpringSource webinar)
Decomposing applications for deployability and scalability(SpringSource webinar)
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
 
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?!
 
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)
 
Microservices and Redis #redisconf Keynote
Microservices and Redis #redisconf KeynoteMicroservices and Redis #redisconf Keynote
Microservices and Redis #redisconf Keynote
 
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...
 
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
 
Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)
 
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!
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
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...
 
A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)A pattern language for microservices (melbourne)
A pattern language for microservices (melbourne)
 
A pattern language for microservices
A pattern language for microservicesA pattern language for microservices
A pattern language for microservices
 
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
 
Azure Overview Csco
Azure Overview CscoAzure Overview Csco
Azure Overview Csco
 
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra DeploymentsBattery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
 

Plus de 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
 
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-patternChris 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
 
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 patternsChris 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
 
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 Chris Richardson
 
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...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
 
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
 
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
 
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
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolithChris 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
 
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
 
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
 

Plus de Chris Richardson (17)

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 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
 
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
 
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...
 
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
 
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...
 
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...
 
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...
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
 
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...
 
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
 
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
 

Dernier

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
 
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
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
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
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
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
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 

Dernier (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)
 
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...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
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
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
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
 
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...
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 

Developing applications with a microservice architecture (svcc)

  • 1. Microservices: Decomposing @crichardson Applications for Deployability and Scalability Chris Richardson Author of POJOs in Action Founder of the original CloudFoundry.com @crichardson chris@chrisrichardson.net http://plainoldobjects.com
  • 2. Presentation goal How decomposing applications into @crichardson microservices improves deployability and scalability and simplifies the adoption of new technologies
  • 4. @crichardson About Chris Founder of a buzzword compliant (stealthy, social, mobile, big data, machine learning, ...) startup Consultant helping organizations improve how they architect and deploy applications using cloud computing, micro services, polyglot applications, NoSQL, ...
  • 5. @crichardson Agenda The (sometimes evil) monolith Decomposing applications into services Client ⇔ service interaction design Decentralized data management
  • 6. @crichardson Let’s imagine you are building an online store
  • 7. @crichardson Traditional application architecture StoreFrontUI Product Info Service Recommendation Service Tomcat Browser/ Client WAR/EAR MySQL Database Review Service Simple to develop test deploy Load balancer scale Spring MVC Spring Hibernate Order Service HTML REST/JSON
  • 8. But large, complex, monolithic @crichardson applications ⇒ problems
  • 10. @crichardson Obstacle to frequent deployments Need to redeploy everything to change one component Interrupts long running background (e.g. Quartz) jobs Increases risk of failure Fear of change Updates will happen less often - really long QA cycles e.g. Makes A/B testing UI really difficult Eggs in one basket
  • 11. @crichardson Overloads your IDE and container Slows down development
  • 12. @crichardson Obstacle to scaling development I want to update the UI But the backend is not working yet! Lots of coordination and communication required
  • 13. Requires long-term commitment to a technology stack @crichardson
  • 14. @crichardson Agenda The (sometimes evil) monolith Decomposing applications into services Client ⇔ service interaction design Decentralized data management
  • 16. @crichardson The scale cube X axis - horizontal duplication Z axis - data partitioning Y axis - functional decomposition similar splitting by things Scale Scale by splitting different things
  • 17. @crichardson Y-axis scaling - application level WAR Storefront UI Product Info Service Recommendation Service Review Service Order Service
  • 18. @crichardson Y-axis scaling - application level Storefront UI Product Info Service Recommendation Service Review Service Order Service
  • 19. @crichardson Y-axis scaling - application level Product Info Service Product Info Recommendation Service Review Service Order Service Browse Products UI Checkout UI Order management UI Account management UI Apply X-axis and Z-axis scaling to each service independently
  • 20. Service deployment options @crichardson Isolation, manageability VM or Physical Machine Docker/Linux container JVM JAR/WAR/OSGI bundle/... Density/efficiency
  • 21. @crichardson Partitioning strategies... Partition by noun, e.g. product info service Partition by verb, e.g. Checkout UI Single Responsibility Principle Unix utilities - do one focussed thing well
  • 22. @crichardson Partitioning strategies Too few Drawbacks of the monolithic architecture Too many - a.k.a. Nano-service anti-pattern Runtime overhead Potential risk of excessive network hops Potentially difficult to understand system Something of an art
  • 24. @crichardson More service, less micro But more realistically... Focus on building services that make development and deployment easier - not just tiny services
  • 25. @crichardson Real world examples http://techblog.netflix.com/ ~600 services http://highscalability.com/amazon-architecture 100-150 services to build a page http://www.addsimplicity.com/downloads/ eBaySDForum2006-11-29.pdf http://queue.acm.org/detail.cfm?id=1394128
  • 26. @crichardson There are many benefits
  • 27. @crichardson Smaller, simpler apps Easier to understand and develop Less jar/classpath hell - who needs OSGI? Faster to build and deploy Reduced startup time - important for GAE
  • 28. Scales development: develop, deploy and scale each service independently @crichardson
  • 30. Eliminates long-term commitment to a single technology stack @crichardson Modular, polyglot, multi-framework applications
  • 31. @crichardson Two levels of architecture System-level Services Inter-service glue: interfaces and communication mechanisms Slow changing Service-level Internal architecture of each service Each service could use a different technology stack Pick the best tool for the job Rapidly evolving
  • 32. Easily try other technologies @crichardson ... and fail safely
  • 33. But there are drawbacks @crichardson
  • 35. Complexity of developing a @crichardson distributed system http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
  • 36. @crichardson Multiple databases & Transaction management e.g. Fun with eventual consistency
  • 37. @crichardson Complexity of testing a distributed system http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
  • 38. Complexity of deploying and operating a distributed @crichardson system http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html You need a lot of automation
  • 39. @crichardson Developing and deploying features that span multiple services requires careful coordination
  • 40. @crichardson When to use it? In the beginning: •You don’t need it •It will slow you down Later on: •You need it •Refactoring is painful
  • 41. @crichardson Agenda The (sometimes evil) monolith Decomposing applications into services Client ⇔ service interaction design Decentralized data management
  • 42. Let’s imagine that you want to display a product’s details... Product Info Reviews Recommendations @crichardson
  • 43. Directly connecting the front-end to the backend @crichardson View Controller Model Product Info service Recommendation Service Review service REST REST Thrift Traditional server-side web application View Controller Model Browser/Native App Chatty API Web unfriendly protocols
  • 44. @crichardson Use an API gateway View Controller Model Product Info service Recommendation Service Review service REST REST Thrift API Gateway View Controller Model Browser/Native App Single entry point Client specific APIs Protocol translation Traditional server-side web application
  • 45. @crichardson Optimized client-specific APIs Web application Mobile App NodeJS API Gateway REST proxy Event publishing Product Info service Recommendation Service Review service REST REST Thrift getProductInfo() getRecomm...() getReviews() getProductDetails()
  • 46. @crichardson Netflix API Gateway http://techblog.netflix.com/2013/01/optimizing-netflix-api.html Device specific end points
  • 47. @crichardson API gateway design challenges Performance and scalability Non-blocking I/O Asynchronous, concurrent code Handling partial failures .... http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
  • 48. @crichardson Useful frameworks for building an API gateway JVM: Netty, Vertex Netflix Hystrix ... Other: NodeJS
  • 49. How does a browser interact with the partitioned @crichardson web application?
  • 50. @crichardson Partitioned web app ⇒ no longer a single base URL /products Browse Products UI /checkout Checkout UI /orders Order management UI /account Account management UI Browser ?
  • 51. The solution: single entry point that routes based on URL @crichardson /products Browse Products UI /checkout Checkout UI /orders Order management UI /account Account management UI http://acme.com/<service>/... Content Browser Router Hidden from browser Single entry point
  • 52. @crichardson How do the services communicate?
  • 53. Inter-service communication options @crichardson Synchronous HTTP ⇔ asynchronous AMQP Formats: JSON, XML, Protocol Buffers, Thrift, ... Asynchronous is preferred JSON is fashionable but binary format is more efficient
  • 54. Pros and cons of messaging Pros Cons Decouples client from Additional complexity of server message broker Message broker buffers Request/reply-style messages communication is more Supports a variety of complex communication patterns
  • 55. Pros and cons of HTTP Pros Simple and familiar Request/reply is easy Firewall friendly No intermediate broker Cons Only supports request/ reply Server must be available Client needs to discover URL(s) of server(s)
  • 56. @crichardson Discovery option #1: Internal load balancer Load Balancer Product Info Service Product Info Service Product Info Service Product Info Service Client/ API gateway Services register with load balancer Client talks to load balancer Has a well-known location http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/USVPC_creating_basic_lb.html
  • 57. @crichardson Discovery option #2: client-side load balancing REST Client Product Info Service Product Info Service Product Info Service Product Info Service Client Service Registry Services register with registry Client polls registry http://techblog.netflix.com/2013/01/announcing-ribbon-tying-netflix-mid.html http://techblog.netflix.com/2012/09/eureka.html
  • 58. @crichardson Lots of moving parts! PProrodducutc tIn Ifnofo Service Recommendation Service Review Service Order Service Browse Products UI Checkout UI Order management UI Account management UI API Gate way Service registry Content Router HTML Browser REST Client Ext. LB Ext. LB
  • 59. @crichardson Agenda The (sometimes evil) monolith Decomposing applications into services Client ⇔ service interaction design Decentralized data management
  • 60. @crichardson Decomposed services ⇒ decomposed databases Order management Customer management Order Database Customer Database Separate databases ⇒ less coupling
  • 61. @crichardson Decomposed databases ⇒ polyglot persistence IEEE Software Sept/October 2010 - Debasish Ghosh / Twitter @debasishg
  • 62. Untangling orders and customers Customer management @crichardson Order Service placeOrder() Order management Customer Service availableCredit() updateCustomer() Customer creditLimit ... Order belongs to has orders total Invariant: sum(order.total) <= creditLimit available credit= creditLimit - Trouble! sum(order.total)
  • 63. @crichardson Problems Reads Service A needs to read data owned by service B e.g. OrderService needs customer’s credit limit e.g Customer Service needs outstanding order total Updates “Business transaction” must update data owned by multiple services e.g Creating a User => Create their ShoppingCart
  • 64. You could use two-phase commit (2PC) but ... @crichardson
  • 65. @crichardson Use an event-driven architecture
  • 66. UpdateCreditLimitCommand @crichardson Event-driven architecture Customer Service updateCustomer() CustomerCreditLimitUpdatedEvent Message Broker Order management Order total Customer’ creditLimit CustomerCreditLimitUpdatedEvent(...) Customer management Customer creditLimit ...
  • 67. Benefits and drawbacks of an event-driven architecture Benefits: Simple infrastructure, e.g. a message broker Better availability (than using 2PC) Drawbacks: Application has to handle eventually consistent data Application has to handle duplicate events @crichardson
  • 68. How do services publish @crichardson events?
  • 69. @crichardson To maintain consistency the application must atomically publish an event whenever a domain object changes
  • 70. @crichardson How to generate events reliably? Database triggers Hibernate event listener Ad hoc event publishing code mixed into business logic Domain events - “formal” modeling of events Event Sourcing
  • 71. Atomically publishing events Use distributed transactions to update database and publish to message Database and message broker must support 2PC 2PC is best avoided Use eventual consistency mechanism: 1. Update database: new entity state & event to publish 2. Publish event & mark event as published • Difficult to implement when using a NoSQL database :-( @crichardson
  • 72. @crichardson Event sourcing An event-centric approach to designing domain models Request becomes a command that is sent to an Aggregate Aggregates handle commands by generating events Apply events to an aggregate to update state Persist events NOT state Replay events to recreate the current state of an aggregate Event Store ≃ database + message broker
  • 73. Request handling in an event-sourced application @crichardson HTTP Handler Event Store pastEvents = findEvents(entityId) Account new() applyEvents(pastEvents) newEvents = processCmd(SomeCmd) saveEvents(newEvents) Microservice A
  • 74. @crichardson Event Store publishes events - consumed by other services Event Store Microservice B Event Subscriber subscribe(EventTypes) publish(event) publish(event) Aggregate NoSQL materialized view update() update()
  • 75. UpdateCreditLimitCommand @crichardson Using event sourcing Customer Service updateCustomer() CustomerCreditLimitUpdatedEvent Event Store Order management Order total Customer’ creditLimit CustomerCreditLimitUpdatedEvent(...) Customer management Customer creditLimit ...
  • 76. @crichardson Customer aggregate case class Customer(customerId: String, creditLimit: BigDecimal) extends ValidatingAggregate[Customer, CustomerCommands.CustomerCommand] { def this() = this(null, null) override def processCommand = { case CreateCustomerCommand(customerId, creditLimit) => Seq(CustomerCreatedEvent(customerId, creditLimit)) case UpdateCreditLimitCommand(newLimit) if newLimit >= 0 => Seq(CustomerCreditLimitUpdatedEvent(newLimit)) } override def applyEvent = { case CustomerCreatedEvent(customerId, creditLimit) => copy(customerId=customerId, creditLimit=creditLimit) case CustomerCreditLimitUpdatedEvent(newLimit) => copy(creditLimit=newLimit) } } Command ⇒ Events Event ⇒ Updated state
  • 77. @crichardson EventStore API trait EventStore { def save[T](entityId: Id, events: Seq[Event]): T def update[T](entityId: Id, version: EntityVersion, events: Seq[Event]): T def load[T](entityType: Class[T], entityId: EntityId): T def subscribe(...) : ... .. }
  • 78. Unfamiliar but it solves many problems @crichardson Eliminates O/R mapping problem Supports both SQL and NoSQL databases Publishes events reliably Reliable eventual consistency framework ...
  • 80. Monolithic applications are simple to develop and deploy @crichardson BUT have significant drawbacks
  • 81. @crichardson Apply the scale cube Modular, polyglot, and scalable applications Services developed, deployed and scaled independently
  • 82. Use a modular, polyglot architecture View Controller Product Info @crichardson Model service Recommendation Service Review service REST REST AMQP API Gateway Server-side web application View Controller Model Browser/Native application
  • 83. @crichardson Use an event-driven architecture
  • 84. @crichardson Start refactoring your monolith Monolith Anti-corruption Service layer Glue code Pristine
  • 85. @crichardson chris@chrisrichardson.net @crichardson Questions? http://plainoldobjects.com http://microservices.io