SlideShare a Scribd company logo
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Decomposing the Monolith using Microservices that don't give you pain
Also known as the Microservices Premium
Hybrid of
Front-end
Technologies
Multiple
patterns for the
same problems
Long compile
time
Large source
control
repositories
Long-running
unit tests
Too much
coupling
Limited
team scalability
Devs need to
know everything
NoIsolationProductivity
drops over time.
Decomposing the Monolith using Microservices that don't give you pain
• The network is reliable
• Latency is zero
• Bandwidth is infinite
• The network is secure
• Topology doesn't change
• There is one administrator
• Transport cost is zero
• The network is homogeneous.
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
The First Law of Distributed Computing
Very scalable,
very reliable
Very difficult to
debug
distributed
problems
Unreliable
network
requires
complicated
techniques
Requires
message
bus/broker
End-to-end
testing very
unpractical
Very mature
DevOps culture
is a prerequisite
Advanced
monitoring and
visualization is a
must
Security can not be an
afterthought
High operational
maintenance.
Can be
deployed/upgraded
independently.
Decomposing the Monolith using Microservices that don't give you pain
Monolith
Microservice
Microservice
Microservice
HTTP API
HTTP API
HTTP API
OWIN component
released through
MyGet/Nuget
No network I/O at all
Can have its own database
instance, shared with monolith,
or shared storage service
Microservice owns
the schema
Separate repos with
distinct owners.
Runs in-process, thus
easier debugging
New version
requires
redeployment of
the monolith.
Loose coupling
through HTTP
Less scalability
options
HTTP is not the
fastest
serialization
format
Relies on libraries,
not frameworks.
Decomposing the Monolith using Microservices that don't give you pain
Client
IIS
Console
WinSvc
Unit Test
HTTP
request
HTTP
response
Middleware
environment
handler
next
Middleware
IDictionary<string, object>
Func<IDictionary<string, object>, Task>
Task
Func<
Func<IDictionary<string, object>, Task>,
Func<IDictionary<string, object>, Task>
>
Monolith
Microservice
HTTP API
Service Registry
Contract
documented through
Swagger
Webhooks
Microservice
Microservice
Provides OWIN-
aware HttpClient to
connect to service
Event payload
exposed as Swagger
(e.g. SwaggerHub)
Subscribers register
URLs or in-process
OWIN message
handler
API/payload
consumers use liberal
JSON interpretation
Circuit Breaking to
handle unreliable
consumers
At-least-once payload
delivery
Subcribers can
request replays.
Payload includes ID
to help idempotency
Each request requires
correlation ID that flows
through all APIs, webhooks
and services
Decomposing the Monolith using Microservices that don't give you pain
Aggregates
Command Handlers
Queries
Commands
Events
Upconverters
Value Objects
Query
Handlers
Schema
Migrations
Projectors
Data
Importers
Query API
Jobs
Projections
HTML
CSS
JS
API
Controllers
Projectors
Projections
Registrations
Webhook API
Command
API
Event Storage
Payload
Definitions
Outer layers depend
on inner layers
Domain is persistency
ignorant
Can be tested
independently
For eventual
consistent business
rules
Master data
To support domain
queries
For microservices
that provide a
(partial) UI or
management screen
Based on Domain
Driven Design
Supported by LibLog,
TinyIoc
Designed according
to the 12 Factor
principles
UI / HTTP API
Command
Service
ChangeUser
EmailHandler
User
Unit of
Work
User
Projector
DAL
Read DB
Write DB
ChangeUserEmailCommand
Execute query
Get<User>(identity)
Invoke method
Event Store
Load(events)
Apply
Get changes
Dispatcher Events
Handle(UserEmailChangedEvent)
Submit changes
History
Dennis Doomen | @ddoomen | The Continuous Improver
Monolith
Microservice
HTTP API
Event Store
Events
Payload
Projector
Subscription
Request
Payload
‘event store’
Projectors use
LiquidProjections
Have their own
checkpoints
Projects fine-grained
events into payload
projections
Projector
Payload schema is
documented using
Swagger
Projector
Projector
Webhook Projectors
Separate
instance per
subscription
Subscriber
HTTP API
‘Project’ payload
‘event store’ into
HTTP calls
Projected Data
Uses the incoming
payloads as an ‘event
store’
Payload
Use Circuit Breakers
to handle
slow/unavailable
subscribers
SQL DB Schema
changes using
FluentMigrator
or using NoSQL
DB
Decomposing the Monolith using Microservices that don't give you pain
Domain
Event Store
Events
App
RDBMS
Events
Projection
EventsProjection
Projection
Projector
Optimized for
specific queries
Separate
projections
database NoSQL
Projector
Projection-specific
storage
Projector
HTML
Raw SQL or
Dapper
Run
asynchronously
Great for
sharding
Dennis Doomen | @ddoomen | The Continuous Improver
Events
Transaction 6
Transaction 5
Transaction 4
Transaction 3
Transaction 2
Transaction 1
Temporal
Projector
Read
Store
Time
Projected until
this point
Immutable, thus
auditable and SOX
compliance
Dennis Doomen | @ddoomen | The Continuous Improver
Domain
Event Store
Events
App
Events
Projection
EventsProjection
Projection
Projector
Application
projections
RDBMS
Reporting
Projector
Traditional
reporting model
Asynchronous
OLAP
Dennis Doomen | @ddoomen | The Continuous Improver
StreamId: User-Dedo, Rev: 5
Persisted State Changes
StreamId: User-Dedo, Rev: 4
Grant Role “Editor”
Change Password 2nd
StreamId: User-Dedo, Rev: 4
StreamId: User-Dedo, Rev: 3
Create User
Grant Role “Owner”
Add Phone Number
Change Password 1st
StreamId: User-Dedo, Rev: 5
Revoke Role “Owner”
StreamId: User-Dedo, Rev: 6
Grant Role “Editor”
Time
StreamId: User-Dedo, Rev: 7
Changed Password 2nd
Dennis Doomen | @ddoomen | The Continuous Improver
Events
1
2
3
6297
6298
6298
Projections
Documents
Groups
Users
Objects
Folders
Microservice
V2
Changes Queries
Events
1
2
3
6299
6300
6301
Projections
Documents
Groups
Users
Objects
Folders
Microservice
V1
ChangesQueries
Migration Process
Dennis Doomen | @ddoomen | The Continuous Improver
Events
Aggregate
Root
Entity
Entity
Value
Object
Aggregate
Root
Aggregate
Root
Aggregate
Root
Entity
Value
Object
Value
Object
Dennis Doomen | @ddoomen | The Continuous Improver
• Asynchronous projections
• Idempotency of projections
• Self-tracking
• Projection autonomy -> more
duplication
• Projection tracking and
prediction.
• Functional archiving
• Clear separation between critical
and auxiliary data -> prioritization
• Partitioning
• Dynamic rebuilding (after bugs,
schema changes, etc).
• Projections that crash
– Column constraints
– Changes in data invariants
– Unexpected projection dependencies
– Lookups vs stream dependencies.
• (Unexpected) projection dependencies
– Synchronous -> asynchronous and existing
bugs
– Aggregrate dependencies.
• Bugs
– Causing large event streams.
Decomposing the Monolith using Microservices that don't give you pain
Prerequisites
- Microservice owns ‘schema’
- Supports upgrading and downgrading
- NoSQL preferred, but RDBMS can
work too.
Rebuild schema in-place
– Rebuilding using event store
– Requires tracking API
– Involves down-time.
Disallow breaking changes
– Only new ‘columns’ and ‘tables’
– Partial rebuilding using event store
– Requires forwards compatibility.
Rebuild side-by-side
– Rebuilding using event store
– Requires tracking API
– Requires compatibility with
previous ‘schema’
– Previous ‘schema’ is removed in the
next release.
Decomposing the Monolith using Microservices that don't give you pain
Microservice
Bunch of classes that
should be used directly
X
No inheritance
Uses composition
over inheritance
internally
Convenience classes
that don’t hide the
magic
Library
Abstract Package
Interfaces
Delegates
DTOs
Only depend
on abstract
packages…
Stable Package
…or depend on more
stable packages
Auxiliary
Package
Classes that are not
used together do not
belong togetherOptional
Dependency
Dependency
Package
Consumers should
not be faced with
optional
dependencies
• Delegates
• Source-only Packages
• Merge dependencies
Decomposing the Monolith using Microservices that don't give you pain
Monolith
Microservice
Microservice
Microservice
HTTP API
HTTP API
HTTP API
Apply routing
conventions
Versioning
using Accept Headers,
Response Headers or
Routes
Optimize body using
AVRO or Protobuf
Cross-service tracing
using OpenTracing
Replace OWIN with
(upcoming) in-
process gRPC
Common contracts
for diagnostics,
monitoring
Add KPI dashboards,
e.g. Sumologic
Decomposing the Monolith using Microservices that don't give you pain
1 Build a (container-based) cloud
capability.
2 Deploy monolith to the cloud.
3 Automate your delivery pipeline.
4 Full end-to-end responsibility
5 Break-up delivery teams and code
6 Evaluate status-quo on micro-services
(products, platforms, etc)
7 Slide-and-dice microservices one-by-
one.
Decomposing the Monolith using Microservices that don't give you pain
• Liquid Projections – The Example
https://github.com/liquidprojections
• Bliki: MonolithFirst
https://dzone.com/articles/martin-fowler%E2%80%94bliki
• In-process gRPC
https://github.com/grpc/grpc-go/issues/906
• Protobuf in WebAPI
http://www.infoworld.com/article/2982579/application-
architecture/working-with-protocol-buffers-in-web-api.html
• Ingredients for well-design OWIN components
http://www.continuousimprover.com/search/label/OWIN%20Recip
es
• The good, the bad and the ugly of Event Sourcing
http://www.continuousimprover.com/search/label/event%20sourci
ng

More Related Content

What's hot (20)

PDF
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
PPTX
The Microservices world in. NET Core and. NET framework
Massimo Bonanni
 
PPTX
CICD Azure DevOps
Sergey Seletsky
 
PDF
Newspeak: Evolving Smalltalk for the Age of the Net
ESUG
 
PPTX
20160609 nike techtalks reactive applications tools of the trade
shinolajla
 
PDF
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
Jelastic Multi-Cloud PaaS
 
PDF
Spring 5 Project Reactor
Geoffrey Filippi
 
PPTX
Discovering the Service Fabric's actor model
Massimo Bonanni
 
PDF
Application Deployment and Management at Scale with 1&1 by Matt Baldwin
Docker, Inc.
 
PDF
Keeping your Kubernetes Cluster Secure
Gene Gotimer
 
PPTX
Cloud patterns
Nicolas De Loof
 
PDF
Just enough web ops for web developers
Datadog
 
PDF
Reactive Architecture (PHPCon PL 2015)
Marek Sokół
 
PDF
Microservices with spring boot
Mesut Can Gurle
 
PDF
Hacking into your containers, and how to stop it!
Eric Smalling
 
PDF
From Zero to Hero: Continuous Container Security in 4 Simple Steps
DevOps.com
 
PDF
Introduction to Resilience4j
Knoldus Inc.
 
PPTX
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
Nicolas Fränkel
 
PPTX
Containers jumpstart from a DevOps perspective
Matteo Emili
 
PPTX
An In-depth look at application containers
John Kinsella
 
Take a Look at Akka+Java (English version)
GlobalLogic Ukraine
 
The Microservices world in. NET Core and. NET framework
Massimo Bonanni
 
CICD Azure DevOps
Sergey Seletsky
 
Newspeak: Evolving Smalltalk for the Age of the Net
ESUG
 
20160609 nike techtalks reactive applications tools of the trade
shinolajla
 
From VMs to Containers: Decompose and Migrate Old Legacy JavaEE Application
Jelastic Multi-Cloud PaaS
 
Spring 5 Project Reactor
Geoffrey Filippi
 
Discovering the Service Fabric's actor model
Massimo Bonanni
 
Application Deployment and Management at Scale with 1&1 by Matt Baldwin
Docker, Inc.
 
Keeping your Kubernetes Cluster Secure
Gene Gotimer
 
Cloud patterns
Nicolas De Loof
 
Just enough web ops for web developers
Datadog
 
Reactive Architecture (PHPCon PL 2015)
Marek Sokół
 
Microservices with spring boot
Mesut Can Gurle
 
Hacking into your containers, and how to stop it!
Eric Smalling
 
From Zero to Hero: Continuous Container Security in 4 Simple Steps
DevOps.com
 
Introduction to Resilience4j
Knoldus Inc.
 
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
Nicolas Fränkel
 
Containers jumpstart from a DevOps perspective
Matteo Emili
 
An In-depth look at application containers
John Kinsella
 

Similar to Decomposing the Monolith using Microservices that don't give you pain (20)

PPTX
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
IT Arena
 
PPTX
Decomposing the Monolith (Riga Dev Days 2019)
Dennis Doomen
 
PDF
Streaming to a new Jakarta EE
Markus Eisele
 
PDF
Streaming to a New Jakarta EE
J On The Beach
 
PDF
Devtest Orchestration for SDN & NFV
Alex Henthorn-Iwane
 
PDF
Demystifying Containerization Principles for Data Scientists
Dr Ganesh Iyer
 
PDF
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
PPTX
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
PPTX
ma-formation-en-Docker-jlklk,nknkjn.pptx
imenhamada17
 
PPT
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
PDF
Microservices.pdf
SelmaJelovac1
 
PDF
Dockers and kubernetes
Dr Ganesh Iyer
 
PDF
Open shift and docker - october,2014
Hojoong Kim
 
PPTX
Reactive programming
SUDIP GHOSH
 
PPTX
DockerCon 2016 - Structured Container Delivery
Oscar Renalias
 
PDF
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
VMware Hyperic
 
PPTX
Private PaaS & Container-as-a-Service for ISVs and Enterprise - Use Cases and...
Dmitry Lazarenko
 
PDF
Streaming to a new Jakarta EE / JOTB19
Markus Eisele
 
PDF
Microservices Architecture
Lucian Neghina
 
PDF
Meteor South Bay Meetup - Kubernetes & Google Container Engine
Kit Merker
 
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
IT Arena
 
Decomposing the Monolith (Riga Dev Days 2019)
Dennis Doomen
 
Streaming to a new Jakarta EE
Markus Eisele
 
Streaming to a New Jakarta EE
J On The Beach
 
Devtest Orchestration for SDN & NFV
Alex Henthorn-Iwane
 
Demystifying Containerization Principles for Data Scientists
Dr Ganesh Iyer
 
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
ma-formation-en-Docker-jlklk,nknkjn.pptx
imenhamada17
 
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
Microservices.pdf
SelmaJelovac1
 
Dockers and kubernetes
Dr Ganesh Iyer
 
Open shift and docker - october,2014
Hojoong Kim
 
Reactive programming
SUDIP GHOSH
 
DockerCon 2016 - Structured Container Delivery
Oscar Renalias
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
VMware Hyperic
 
Private PaaS & Container-as-a-Service for ISVs and Enterprise - Use Cases and...
Dmitry Lazarenko
 
Streaming to a new Jakarta EE / JOTB19
Markus Eisele
 
Microservices Architecture
Lucian Neghina
 
Meteor South Bay Meetup - Kubernetes & Google Container Engine
Kit Merker
 
Ad

More from Dennis Doomen (20)

PDF
15 Years of Insights from a TDD Practitioner (NDC Oslo)
Dennis Doomen
 
PPTX
Using Boundary-Driven Development to beat code complexity
Dennis Doomen
 
PPTX
Getting a grip on your code dependencies (2023-10)
Dennis Doomen
 
PPTX
Tools and practices to help you deal with legacy code
Dennis Doomen
 
PPTX
What you can learn from an open-source project with 250 million downloads
Dennis Doomen
 
PPTX
Getting a grip on your code dependencies
Dennis Doomen
 
PPTX
My Laws of Test Driven Development (2023)
Dennis Doomen
 
PPTX
Design patterns for Event Sourcing in .NET
Dennis Doomen
 
PPTX
Automate Infrastructure with Pulumi and C#
Dennis Doomen
 
PPTX
What is the right unit in unit testing (UpdateConf 2022)
Dennis Doomen
 
PPTX
Slow Event Sourcing (re)projections - Just make them faster!
Dennis Doomen
 
PPTX
50 things software teams should not do.pptx
Dennis Doomen
 
PPTX
What is the right "unit" in unit testing and why it is not a class?
Dennis Doomen
 
PPTX
A lab around the principles and practices for writing maintainable code
Dennis Doomen
 
PPTX
How to Practice TDD Without Shooting Yourself in the Foot
Dennis Doomen
 
PPTX
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
PPTX
Event Sourcing from the Trenches (DDD Europe 2020)
Dennis Doomen
 
PPTX
Practical introduction to DDD, CQRS and Event Sourcing
Dennis Doomen
 
PPTX
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
PPTX
A lab around the principles and practices for writing maintainable code (2019)
Dennis Doomen
 
15 Years of Insights from a TDD Practitioner (NDC Oslo)
Dennis Doomen
 
Using Boundary-Driven Development to beat code complexity
Dennis Doomen
 
Getting a grip on your code dependencies (2023-10)
Dennis Doomen
 
Tools and practices to help you deal with legacy code
Dennis Doomen
 
What you can learn from an open-source project with 250 million downloads
Dennis Doomen
 
Getting a grip on your code dependencies
Dennis Doomen
 
My Laws of Test Driven Development (2023)
Dennis Doomen
 
Design patterns for Event Sourcing in .NET
Dennis Doomen
 
Automate Infrastructure with Pulumi and C#
Dennis Doomen
 
What is the right unit in unit testing (UpdateConf 2022)
Dennis Doomen
 
Slow Event Sourcing (re)projections - Just make them faster!
Dennis Doomen
 
50 things software teams should not do.pptx
Dennis Doomen
 
What is the right "unit" in unit testing and why it is not a class?
Dennis Doomen
 
A lab around the principles and practices for writing maintainable code
Dennis Doomen
 
How to Practice TDD Without Shooting Yourself in the Foot
Dennis Doomen
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
Event Sourcing from the Trenches (DDD Europe 2020)
Dennis Doomen
 
Practical introduction to DDD, CQRS and Event Sourcing
Dennis Doomen
 
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
A lab around the principles and practices for writing maintainable code (2019)
Dennis Doomen
 
Ad

Recently uploaded (20)

PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 

Decomposing the Monolith using Microservices that don't give you pain