SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven DesignDavid Berliner
 
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
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignNader Albert
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignRyan Riley
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
DDD (Domain-Driven Design)
DDD (Domain-Driven Design)DDD (Domain-Driven Design)
DDD (Domain-Driven Design)Senior Dev
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignNaeem Sarfraz
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Alan Christensen
 
Event Sourcing from the Trenches (with examples from .NET)
Event Sourcing from the Trenches (with examples from .NET)Event Sourcing from the Trenches (with examples from .NET)
Event Sourcing from the Trenches (with examples from .NET)Dennis Doomen
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slidesthinkddd
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignŽilvinas Kuusas
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLCAbdul Karim
 
Domain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring PortfolioDomain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring PortfolioSrini Penchikala
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignAndriy Buday
 

Mais procurados (20)

Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
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
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
DDD (Domain-Driven Design)
DDD (Domain-Driven Design)DDD (Domain-Driven Design)
DDD (Domain-Driven Design)
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven Design
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Event Sourcing from the Trenches (with examples from .NET)
Event Sourcing from the Trenches (with examples from .NET)Event Sourcing from the Trenches (with examples from .NET)
Event Sourcing from the Trenches (with examples from .NET)
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slides
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Domain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring PortfolioDomain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring Portfolio
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 

Semelhante a 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
 
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
 

Semelhante a 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
 
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
 
DNN Application Development
DNN Application DevelopmentDNN Application Development
DNN Application Development
 

Mais de 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
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)Dennis 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
 

Mais de 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
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)
 
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
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

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