SlideShare a Scribd company logo
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
Practical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event Sourcing
Practical introduction to DDD, CQRS and Event Sourcing
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
Practical introduction to DDD, CQRS and Event Sourcing
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
Practical introduction to DDD, CQRS and Event Sourcing
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.
Practical introduction to DDD, CQRS and Event Sourcing
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 (20)

PPTX
Apache Spark Fundamentals
Zahra Eskandari
 
PPTX
Flink Forward San Francisco 2019: Moving from Lambda and Kappa Architectures ...
Flink Forward
 
PDF
Getting Started with Confluent Schema Registry
confluent
 
PPTX
Intro to Apache Spark
Robert Sanders
 
PPTX
Data Lakehouse Symposium | Day 4
Databricks
 
PDF
Hadoop Overview & Architecture
EMC
 
PPTX
Building a Big Data Solution
James Serra
 
PDF
Archmage, Pinterest’s Real-time Analytics Platform on Druid
Imply
 
PDF
Big data real time architectures
Daniel Marcous
 
PPT
Data warehousing
Mohammed Bindrees , PhD
 
PPTX
Introduction To Hadoop | What Is Hadoop And Big Data | Hadoop Tutorial For Be...
Simplilearn
 
PPTX
Spark
Heena Madan
 
PDF
Intro to Neo4j and Graph Databases
Neo4j
 
PDF
Introducing Databricks Delta
Databricks
 
PPTX
Elastic Data Warehousing
Snowflake Computing
 
PPTX
Introduction to Apache Spark
Rahul Jain
 
PDF
Cassandra Database
YounesCharfaoui
 
PDF
Building an open data platform with apache iceberg
Alluxio, Inc.
 
PDF
Python for Financial Data Analysis with pandas
Wes McKinney
 
PPTX
Apache NiFi in the Hadoop Ecosystem
Bryan Bende
 
Apache Spark Fundamentals
Zahra Eskandari
 
Flink Forward San Francisco 2019: Moving from Lambda and Kappa Architectures ...
Flink Forward
 
Getting Started with Confluent Schema Registry
confluent
 
Intro to Apache Spark
Robert Sanders
 
Data Lakehouse Symposium | Day 4
Databricks
 
Hadoop Overview & Architecture
EMC
 
Building a Big Data Solution
James Serra
 
Archmage, Pinterest’s Real-time Analytics Platform on Druid
Imply
 
Big data real time architectures
Daniel Marcous
 
Data warehousing
Mohammed Bindrees , PhD
 
Introduction To Hadoop | What Is Hadoop And Big Data | Hadoop Tutorial For Be...
Simplilearn
 
Intro to Neo4j and Graph Databases
Neo4j
 
Introducing Databricks Delta
Databricks
 
Elastic Data Warehousing
Snowflake Computing
 
Introduction to Apache Spark
Rahul Jain
 
Cassandra Database
YounesCharfaoui
 
Building an open data platform with apache iceberg
Alluxio, Inc.
 
Python for Financial Data Analysis with pandas
Wes McKinney
 
Apache NiFi in the Hadoop Ecosystem
Bryan Bende
 

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

PPTX
Event Sourcing from the Trenches (DDD Europe 2020)
Dennis Doomen
 
PPTX
Event Sourcing from the Trenches (with examples from .NET)
Dennis Doomen
 
PPTX
The Good, The Bad and The Ugly of Event Sourcing
Dennis Doomen
 
PPTX
How to Practice TDD Without Shooting Yourself in the Foot
Dennis Doomen
 
PPTX
Slow Event Sourcing (re)projections - Just make them faster!
Dennis Doomen
 
PPTX
The Good, The Bad and The Ugly of Event Sourcing
Dennis Doomen
 
PPTX
Decomposing the Monolith (Riga Dev Days 2019)
Dennis Doomen
 
PPTX
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
PPTX
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
IT Arena
 
PPTX
How To Practice TDD Without Shooting Yourself In The Foot
Dennis Doomen
 
PPTX
Tools and practices to help you deal with legacy code
Dennis Doomen
 
PPTX
Building occasionally connected applications using event sourcing
Dennis Doomen
 
PPTX
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
PPTX
Design patterns for Event Sourcing in .NET
Dennis Doomen
 
Event Sourcing from the Trenches (DDD Europe 2020)
Dennis Doomen
 
Event Sourcing from the Trenches (with examples from .NET)
Dennis Doomen
 
The Good, The Bad and The Ugly of Event Sourcing
Dennis Doomen
 
How to Practice TDD Without Shooting Yourself in the Foot
Dennis Doomen
 
Slow Event Sourcing (re)projections - Just make them faster!
Dennis Doomen
 
The Good, The Bad and The Ugly of Event Sourcing
Dennis Doomen
 
Decomposing the Monolith (Riga Dev Days 2019)
Dennis Doomen
 
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
IT Arena
 
How To Practice TDD Without Shooting Yourself In The Foot
Dennis Doomen
 
Tools and practices to help you deal with legacy code
Dennis Doomen
 
Building occasionally connected applications using event sourcing
Dennis Doomen
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
Design patterns for Event Sourcing in .NET
Dennis Doomen
 
Ad

More from Dennis Doomen (19)

PDF
15 Years of Insights from a TDD Practitioner (NDC Oslo)
Dennis Doomen
 
PPTX
Using Boundary-Driven Development to beat code complexity
Dennis Doomen
 
PPTX
Getting a grip on your code dependencies (2023-10)
Dennis Doomen
 
PPTX
What you can learn from an open-source project with 250 million downloads
Dennis Doomen
 
PPTX
Getting a grip on your code dependencies
Dennis Doomen
 
PPTX
My Laws of Test Driven Development (2023)
Dennis Doomen
 
PPTX
Automate Infrastructure with Pulumi and C#
Dennis Doomen
 
PPTX
What is the right unit in unit testing (UpdateConf 2022)
Dennis Doomen
 
PPTX
50 things software teams should not do.pptx
Dennis Doomen
 
PPTX
What is the right "unit" in unit testing and why it is not a class?
Dennis Doomen
 
PPTX
A lab around the principles and practices for writing maintainable code
Dennis Doomen
 
PPTX
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
PPTX
A lab around the principles and practices for writing maintainable code (2019)
Dennis Doomen
 
PPTX
Lessons learned from two decades of professional software development
Dennis Doomen
 
PPTX
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Dennis Doomen
 
PPTX
Strengths and weaknesses of dependency injection
Dennis Doomen
 
PPTX
Build Libraries That People Love To use
Dennis Doomen
 
PPTX
Decomposing the Monolith using Microservices that don't give you pain
Dennis Doomen
 
PPTX
Build Libraries, Not Frameworks
Dennis Doomen
 
15 Years of Insights from a TDD Practitioner (NDC Oslo)
Dennis Doomen
 
Using Boundary-Driven Development to beat code complexity
Dennis Doomen
 
Getting a grip on your code dependencies (2023-10)
Dennis Doomen
 
What you can learn from an open-source project with 250 million downloads
Dennis Doomen
 
Getting a grip on your code dependencies
Dennis Doomen
 
My Laws of Test Driven Development (2023)
Dennis Doomen
 
Automate Infrastructure with Pulumi and C#
Dennis Doomen
 
What is the right unit in unit testing (UpdateConf 2022)
Dennis Doomen
 
50 things software teams should not do.pptx
Dennis Doomen
 
What is the right "unit" in unit testing and why it is not a class?
Dennis Doomen
 
A lab around the principles and practices for writing maintainable code
Dennis Doomen
 
How to practice TDD without shooting yourself in the foot
Dennis Doomen
 
A lab around the principles and practices for writing maintainable code (2019)
Dennis Doomen
 
Lessons learned from two decades of professional software development
Dennis Doomen
 
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Dennis Doomen
 
Strengths and weaknesses of dependency injection
Dennis Doomen
 
Build Libraries That People Love To use
Dennis Doomen
 
Decomposing the Monolith using Microservices that don't give you pain
Dennis Doomen
 
Build Libraries, Not Frameworks
Dennis Doomen
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

Practical introduction to DDD, CQRS and Event Sourcing

  • 1. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
  • 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
  • 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
  • 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.
  • 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 [email protected]