SlideShare a Scribd company logo
1 of 41
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Mortgage Application
Proofing Documents
Loan Officer
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…all proofing documents must have been signed before the mortgage
application can be approved
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Use a foreign key
constraint to
prevent removing
signatures
Transaction
boundary to
prevent tampering
with proof
concurrently.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
No way to remove
a signature.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Aggregate
boundary
Protects the
signatures
Uses the Ubiquitous
Language
Bounded context
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…reading should be fast and collaboration is low
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
HTTP API
Domain
OR/M
RDBMS
Web App
Tables
(Materialized)
Views
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
HTTP API
Domain
NOSQL
Web App
Documents Indexes
Elastic Search
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Command Handlers
Commands
Domain
App
Query HTTP API Command HTTP API
NOSQL
DocumentsIndexes
Elastic Search
Data Access
Data Access
Use Ubiquitous
Language
Captures business
processes
Indexes are
typically eventually
consistent.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…changes have to be audited
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Command Handlers
Commands
Domain
App
Query HTTP API Command HTTP API
NOSQL
DocumentsIndexes
Elastic Search
Data Access
Data Access
Audit Trail
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…many folks work on the same documents concurrently
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Command Handlers
Commands
Domain Model
Event Store
Events
App
Query
Store
Data Access
Projectors
Events
Query HTTP API
Projections
Events
Command HTTP API
Great unit
of testing
Great unit
of testing
Auditability
comes for
free
Can look at
the state in
the past
Can be scaled
independently
Autonomous
projections
Aligns well
with Event
Storming
Forces you to
understand your
domain
thorogoughly
No relational
table
structure
anymore
Can replay old
data against
new rules
More difficult
to envisage
domain
relationships
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous ImproverDennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Application
Domain
NoSQL / RDBMS
OR/M / DAL
Web UI, HTTP API,
etc
Lucene Index
Document Projector
Web UI, HTTP
API, etc
Web UI, HTTP API, etc
Domain
Commands
Events
Event StoreProjections
Projectors
Uses Event
Sourcing
Uses traditional
CRUD
architecture
Indexing-based
architecture
Subcribe
to
webhooks
Coarse-
grained
HTTP
requests.
Bus
Subscribe
Publish coarse-
grained event
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…list of proofing documents with state, mortgage number and last
loan officer that signed it.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
App
Query Store
Data Access
Mortgage Proof
Projector Subscription
Query HTTP API
Mortgage Proof
Projection
Loan Officer
Projector
Loan Officer
Projection
Joins the tables
while querying
Load
Officers
Proofing
Documents
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
App
Query Store
Data Access
Mortgage Proof
Projector Events
Query HTTP API
Mortgage Proof Projection
Processes events
from the mortgage
and loan officer
aggregates
Proofing Document
Projections
Contains state,
mortgage number
and loan officer info
Autonomous
Can be
asynchronous
Can be stale. Now
what?
Can be anything.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…a new version requires a schema change?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Projector
Application Application
Network Load Balancer
Event Store
Version 1 Version 2
events
Projection
Projector
Projection
bring off-line
Returns HTTP 503
(Service Unavailable)
Returns HTTP 503
(Service Unavailable)
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Projector
Application
Version 2
Owns schema
Version 1
X
Involves down-time until
projections are rebuild
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…the terminology changes?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
HTTP Command API
Some Command
Handler
Customer #123
Event Store
Customer Created
Event
Get<Customer>(“123”)
Customer
Created Event
Converter
Customer Enrolled
Event
May split or
merge events
Can also run as
part of migration
May change the
identity
Unaffected Events
Dennis Doomen | @ddoomen | The Continuous Improver
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…there’s a bug in a projection?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…rebuilding a projection is slow?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Projector Projector
RDBMS
Subscribe
Subscribe
Document
DB
Projector
RDBMS
Subscribe
Raw SQLNHibernate RavenDB
Autonomous &
independent
Storage technique
optimized for
projection
Use aggressive
caching during
rebuilds.
Caching strategy
optimized for
projector
Stream-by-stream
projections during
rebuilds.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…we have 4 years of data and rebuilding is still too slow?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Document #1
Created Event
Event Store
Graph
Projector
Document #1
Closed Event
(other events)
Projector with
active
projections
Archiving
Projector
Start archiving
Document #1
Marked As
Archivable Event
Mark all events
as archivable
Tracks dependencies
between documents
Deletes projections
related to Document
#1
Can skip all
archivable events
during next rebuild.
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Lucene Projector
Document #1
Marked As
Archivable Event
Allows projectors
to clean up
Lucene Index
Take snapshot
Purge events
Tombstone
$tombstone
stream
Application
Document
Projector
Search.
Tracks deleted streams
for future references
Stream Tombstoned
Event
Search
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…need to capture the original name of a loan officer while signing?
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Projector
Subscription
Projection
Subscribes to events
from loan officers
and documents
Loan
Officer
Lookup
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Event Store
Projector
Project loan officer events
Subscription
Subscription
Storage
(persistent)
Lookup
Event
Modifier
Modifies events with
lookup data
Receives
modified events
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
…then ping me at @ddoomen
…or email me at dennis.doomen@avivasolutions.nl

More Related Content

What's hot

Serverless Computing in Azure
Serverless Computing in AzureServerless Computing in Azure
Serverless Computing in AzureDaniel Toomey
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basicsSourabh Saxena
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi DevelopmentPaul Fiore
 
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandracodecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with CassandraDataStax Academy
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitectureAshwini Kuntamukkala
 
Dockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesDockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesAdrian Cockcroft
 
Breaking the cyber kill chain!
Breaking the cyber kill chain!Breaking the cyber kill chain!
Breaking the cyber kill chain!Nahidul Kibria
 
Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?Johnny Miller
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
iceberg introduction.pptx
iceberg introduction.pptxiceberg introduction.pptx
iceberg introduction.pptxDori Waldman
 
Migrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMigrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMongoDB
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architectureBishal Khanal
 
SQL Server High Availability and Disaster Recovery
SQL Server High Availability and Disaster RecoverySQL Server High Availability and Disaster Recovery
SQL Server High Availability and Disaster RecoveryMichael Poremba
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOI Goo Lee
 

What's hot (20)

Serverless Computing in Azure
Serverless Computing in AzureServerless Computing in Azure
Serverless Computing in Azure
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
 
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandracodecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Introduction to Amazon Redshift
Introduction to Amazon RedshiftIntroduction to Amazon Redshift
Introduction to Amazon Redshift
 
How to Design Indexes, Really
How to Design Indexes, ReallyHow to Design Indexes, Really
How to Design Indexes, Really
 
Dockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesDockercon State of the Art in Microservices
Dockercon State of the Art in Microservices
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Breaking the cyber kill chain!
Breaking the cyber kill chain!Breaking the cyber kill chain!
Breaking the cyber kill chain!
 
Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?Why does my choice of storage matter with cassandra?
Why does my choice of storage matter with cassandra?
 
Cqrs api v2
Cqrs api v2Cqrs api v2
Cqrs api v2
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
iceberg introduction.pptx
iceberg introduction.pptxiceberg introduction.pptx
iceberg introduction.pptx
 
Migrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMigrating to MongoDB: Best Practices
Migrating to MongoDB: Best Practices
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
SQL Server High Availability and Disaster Recovery
SQL Server High Availability and Disaster RecoverySQL Server High Availability and Disaster Recovery
SQL Server High Availability and Disaster Recovery
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 

Similar to Practical introduction to DDD, CQRS and Event Sourcing

Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDennis Doomen
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing Dennis Doomen
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Dennis Doomen
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Dennis Doomen
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDennis Doomen
 
Enterprise Disaster Recovery Strategies by CloudEndure
Enterprise Disaster Recovery Strategies by CloudEndureEnterprise Disaster Recovery Strategies by CloudEndure
Enterprise Disaster Recovery Strategies by CloudEndureAmazon Web Services
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeDennis Doomen
 
DDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running servicesDDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running servicesBernd Ruecker
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsDennis Doomen
 
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...Amazon Web Services
 
The Four Keys - Measuring DevOps Success
The Four Keys - Measuring DevOps SuccessThe Four Keys - Measuring DevOps Success
The Four Keys - Measuring DevOps SuccessDina Graves Portman
 
BusinessIntelligenze - On Cloud BI (English)
BusinessIntelligenze - On Cloud BI (English)BusinessIntelligenze - On Cloud BI (English)
BusinessIntelligenze - On Cloud BI (English)BusinessIntelligenze
 
City Clerk Demonstration 4 27 09
City Clerk  Demonstration 4 27 09City Clerk  Demonstration 4 27 09
City Clerk Demonstration 4 27 09dvickers2000
 
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuest
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuestDisaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuest
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuestAmazon Web Services
 
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...Vadim Zendejas
 
Enterprise DevOps and the Modern Mainframe Webcast Presentation
Enterprise DevOps and the Modern Mainframe Webcast PresentationEnterprise DevOps and the Modern Mainframe Webcast Presentation
Enterprise DevOps and the Modern Mainframe Webcast PresentationCompuware
 

Similar to Practical introduction to DDD, CQRS and Event Sourcing (20)

Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NET
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservices
 
Enterprise Disaster Recovery Strategies by CloudEndure
Enterprise Disaster Recovery Strategies by CloudEndureEnterprise Disaster Recovery Strategies by CloudEndure
Enterprise Disaster Recovery Strategies by CloudEndure
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy code
 
Prabhakaran sekar
Prabhakaran sekarPrabhakaran sekar
Prabhakaran sekar
 
DDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running servicesDDD Belgium Meetup 2017: Events, flows and long running services
DDD Belgium Meetup 2017: Events, flows and long running services
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloads
 
Resume ujjwal
Resume ujjwalResume ujjwal
Resume ujjwal
 
Connect Bridge Presentation
Connect Bridge PresentationConnect Bridge Presentation
Connect Bridge Presentation
 
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...
Disaster Recovery Best Practices and Customer Use Cases: CGS and Health Quest...
 
The Four Keys - Measuring DevOps Success
The Four Keys - Measuring DevOps SuccessThe Four Keys - Measuring DevOps Success
The Four Keys - Measuring DevOps Success
 
Hestia Presentation
Hestia PresentationHestia Presentation
Hestia Presentation
 
BusinessIntelligenze - On Cloud BI (English)
BusinessIntelligenze - On Cloud BI (English)BusinessIntelligenze - On Cloud BI (English)
BusinessIntelligenze - On Cloud BI (English)
 
City Clerk Demonstration 4 27 09
City Clerk  Demonstration 4 27 09City Clerk  Demonstration 4 27 09
City Clerk Demonstration 4 27 09
 
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuest
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuestDisaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuest
Disaster Recovery Best Practices and Customer Use Cases: CGS and HealthQuest
 
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
 
Enterprise DevOps and the Modern Mainframe Webcast Presentation
Enterprise DevOps and the Modern Mainframe Webcast PresentationEnterprise DevOps and the Modern Mainframe Webcast Presentation
Enterprise DevOps and the Modern Mainframe Webcast Presentation
 

More from Dennis Doomen

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Dennis Doomen
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependenciesDennis Doomen
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Dennis Doomen
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)Dennis Doomen
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptxDennis Doomen
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
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
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeDennis Doomen
 
How to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootHow to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootDennis Doomen
 
Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Dennis Doomen
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footDennis Doomen
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)Dennis Doomen
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentDennis Doomen
 
How To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootHow To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootDennis Doomen
 
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Dennis Doomen
 
Strengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionStrengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionDennis Doomen
 
Build Libraries That People Love To use
Build Libraries That People Love To useBuild Libraries That People Love To use
Build Libraries That People Love To useDennis Doomen
 
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDecomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDennis Doomen
 
Build Libraries, Not Frameworks
Build Libraries, Not FrameworksBuild Libraries, Not Frameworks
Build Libraries, Not FrameworksDennis Doomen
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event SourcingThe Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event SourcingDennis Doomen
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footDennis Doomen
 

More from Dennis Doomen (20)

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependencies
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptx
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?
 
A lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable code
 
How to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the FootHow to Practice TDD Without Shooting Yourself in the Foot
How to Practice TDD Without Shooting Yourself in the Foot
 
Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)Event Sourcing from the Trenches (DDD Europe 2020)
Event Sourcing from the Trenches (DDD Europe 2020)
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software development
 
How To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootHow To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The Foot
 
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
 
Strengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionStrengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injection
 
Build Libraries That People Love To use
Build Libraries That People Love To useBuild Libraries That People Love To use
Build Libraries That People Love To use
 
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDecomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you pain
 
Build Libraries, Not Frameworks
Build Libraries, Not FrameworksBuild Libraries, Not Frameworks
Build Libraries, Not Frameworks
 
The Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event SourcingThe Good, The Bad and The Ugly of Event Sourcing
The Good, The Bad and The Ugly of Event Sourcing
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
 

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Practical introduction to DDD, CQRS and Event Sourcing

  • 1. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
  • 2.
  • 3.
  • 4.
  • 5. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Mortgage Application Proofing Documents Loan Officer
  • 6. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
  • 7. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …all proofing documents must have been signed before the mortgage application can be approved
  • 8. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Use a foreign key constraint to prevent removing signatures Transaction boundary to prevent tampering with proof concurrently.
  • 9. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver No way to remove a signature.
  • 10. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Aggregate boundary Protects the signatures Uses the Ubiquitous Language Bounded context
  • 11.
  • 12. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …reading should be fast and collaboration is low
  • 13. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver HTTP API Domain OR/M RDBMS Web App Tables (Materialized) Views
  • 14. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver HTTP API Domain NOSQL Web App Documents Indexes Elastic Search
  • 15. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Command Handlers Commands Domain App Query HTTP API Command HTTP API NOSQL DocumentsIndexes Elastic Search Data Access Data Access Use Ubiquitous Language Captures business processes Indexes are typically eventually consistent.
  • 16. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …changes have to be audited
  • 17. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Command Handlers Commands Domain App Query HTTP API Command HTTP API NOSQL DocumentsIndexes Elastic Search Data Access Data Access Audit Trail
  • 18. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …many folks work on the same documents concurrently
  • 19. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Command Handlers Commands Domain Model Event Store Events App Query Store Data Access Projectors Events Query HTTP API Projections Events Command HTTP API Great unit of testing Great unit of testing Auditability comes for free Can look at the state in the past Can be scaled independently Autonomous projections Aligns well with Event Storming Forces you to understand your domain thorogoughly No relational table structure anymore Can replay old data against new rules More difficult to envisage domain relationships
  • 20. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
  • 21. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous ImproverDennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Application Domain NoSQL / RDBMS OR/M / DAL Web UI, HTTP API, etc Lucene Index Document Projector Web UI, HTTP API, etc Web UI, HTTP API, etc Domain Commands Events Event StoreProjections Projectors Uses Event Sourcing Uses traditional CRUD architecture Indexing-based architecture Subcribe to webhooks Coarse- grained HTTP requests. Bus Subscribe Publish coarse- grained event
  • 22.
  • 23. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …list of proofing documents with state, mortgage number and last loan officer that signed it.
  • 24. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store App Query Store Data Access Mortgage Proof Projector Subscription Query HTTP API Mortgage Proof Projection Loan Officer Projector Loan Officer Projection Joins the tables while querying Load Officers Proofing Documents
  • 25. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store App Query Store Data Access Mortgage Proof Projector Events Query HTTP API Mortgage Proof Projection Processes events from the mortgage and loan officer aggregates Proofing Document Projections Contains state, mortgage number and loan officer info Autonomous Can be asynchronous Can be stale. Now what? Can be anything.
  • 26.
  • 27. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …a new version requires a schema change?
  • 28. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Projector Application Application Network Load Balancer Event Store Version 1 Version 2 events Projection Projector Projection bring off-line Returns HTTP 503 (Service Unavailable) Returns HTTP 503 (Service Unavailable)
  • 29. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Projector Application Version 2 Owns schema Version 1 X Involves down-time until projections are rebuild
  • 30. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …the terminology changes?
  • 31. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver HTTP Command API Some Command Handler Customer #123 Event Store Customer Created Event Get<Customer>(“123”) Customer Created Event Converter Customer Enrolled Event May split or merge events Can also run as part of migration May change the identity Unaffected Events Dennis Doomen | @ddoomen | The Continuous Improver
  • 32. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …there’s a bug in a projection?
  • 33. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …rebuilding a projection is slow?
  • 34. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Projector Projector RDBMS Subscribe Subscribe Document DB Projector RDBMS Subscribe Raw SQLNHibernate RavenDB Autonomous & independent Storage technique optimized for projection Use aggressive caching during rebuilds. Caching strategy optimized for projector Stream-by-stream projections during rebuilds.
  • 35. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …we have 4 years of data and rebuilding is still too slow?
  • 36. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Document #1 Created Event Event Store Graph Projector Document #1 Closed Event (other events) Projector with active projections Archiving Projector Start archiving Document #1 Marked As Archivable Event Mark all events as archivable Tracks dependencies between documents Deletes projections related to Document #1 Can skip all archivable events during next rebuild.
  • 37. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Lucene Projector Document #1 Marked As Archivable Event Allows projectors to clean up Lucene Index Take snapshot Purge events Tombstone $tombstone stream Application Document Projector Search. Tracks deleted streams for future references Stream Tombstoned Event Search
  • 38. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …need to capture the original name of a loan officer while signing?
  • 39. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Projector Subscription Projection Subscribes to events from loan officers and documents Loan Officer Lookup
  • 40. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver Event Store Projector Project loan officer events Subscription Subscription Storage (persistent) Lookup Event Modifier Modifies events with lookup data Receives modified events
  • 41. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver …then ping me at @ddoomen …or email me at dennis.doomen@avivasolutions.nl