SlideShare a Scribd company logo
1 of 48
CQRS/DDD/ES
Beer Time – CEST
Coffee Time – PST
Lunch Time – EST
Snooze Time – ASPAC 
Ask questions in the “Chat” area
About Me !
Architect by day / CQRS-ES Evangelist by Night.
20 years of experience primarily building Products in the Financial Services space.
Love to explore and write about Event Driven Architectures.
Author of the book “Practical Domain-Driven Design with Enterprise Java” and the only book with “Axon”
in its name.
InfoQ Editor focused on CQRS/ES.
Writing my second book “Pocket Guide to CQRS/ES using Axon” with Allard Buijze – out in August.
Still learning ! So I might be wrong :)
Agenda
The First Steps
02
Roadmap
04
The Foundation
01
Digging in Deeper
03
What is DDD/CQRS/ES ? Peeling off the layers.
Choice of Technology and
Process.
Setting yourself up for
success.
THE FOUNDATION
01
The Domain Model is the “heart” of an
Application.
Domain
A Sphere of knowledge, influence or activity.
The subject area to which the user applies a
program is the domain of the software.
Model
A system of abstractions that describes
selected aspects of a domain and can be used
to solve problems related to that domain.
Domain (or Sub-Domain) Categories
Core
Domain
Generic
Supporting
The Money Maker
Off the Shelf (e.g. Identity
Management)
Custom Built (e.g. Document
Management)
https://medium.com/nick-tune-tech-strategy-blog/domains-subdomain-problem-solution-space-in-
ddd-clearly-defined-e0b49c7b586c
Travel/Health
Insurance.
Customer
Quotes
Service
Customer
Claims
Service
Policy
Changes
Customer
Onboarding
Service
Customer
Complaints
Terminate
Policy
Model for a Particular Problem Only !
Building Blocks
Repositories
Entities Value Objects Aggregates
Events
Bounded
Contexts
Structure
Scope of Model
What are we
optimizing for ?
Non-Functional
Concerns
CQRS
Divide and Conquer
Command
Query
Responsibility
Separation
Command Model
Focused on executing tasks.
Primarily expressed in operations.
Only contains data necessary for task execution
and decision making.
Query Model
Focused on delivering information.
Data is stored the way it is used.
Denormalized/”table per view”
Building Blocks
Client
Command Model Projections
Commands Queries
Synchronization Problem
Client
Command Model Projections
Commands Queries
Events as the Glue
Client
Command Model Projections
Commands
Events
Queries
CQRS, DDD & EDA
Repository
Command
Event
Query
Projections
(Aggregate, Entit
Value Object, etc
Immutability
Traditional State Storage
What happened What we store
Flight
flightNo: AC-323
planned departure time: 6:00
planned arrival time: 10:00
captain: T. Cruise
status: awaiting departure
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
Traditional State Storage
What happened What we store
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
3 Departure slot missed: 6:00
4 Captain assigned: C. Lindbergh
…
Flight
flightNo: AC-323
planned departure time: 6:00
planned arrival time: 10:00
captain: C. Lindbergh
status: delayed at gate
Traditional State Storage
What happened What we store
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
3 Departure slot missed: 6:00
4 Captain assigned: C. Lindbergh
5 Flight departed: 7:34
…
Flight
flightNo: AC-323
planned departure time: 6:00
planned arrival time: 10:00
captain: C. Lindbergh
actual departure time : 7:34
status: in-flight
Traditional State Storage
What happened What we store
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
3 Departure slot missed: 6:00
4 Captain assigned: C. Lindbergh
5 Flight departed: 7:34
6 Arrival time estimated: 11:30
7 Arrival time estimated: 10:40
8 Flight arrived: 10:24
…
Flight
flightNo: AC-323
planned departure time: 6:00
planned arrival time: 10:00
captain: C. Lindbergh
actual departure time : 7:34
actual arrival time: 10:24
status: arrived
The valuable information is here… Not here
Event Sourcing
System Of Events
NOT
System Of State
Event Sourcing based Storage
What happened What we store
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
3 Departure slot missed: 6:00
4 Captain assigned: C. Lindbergh
5 Flight departed: 7:34
6 Arrival time estimated: 11:30
7 Arrival time estimated: 10:40
8 Flight arrived: 10:24
…
1 Flight scheduled: 6:00 - 10:00
2 Captain assigned: T. Cruise
3 Departure slot missed: 6:00
4 Captain assigned: C. Lindbergh
5 Flight departed: 7:34
6 Arrival time estimated: 11:30
7 Arrival time estimated: 10:40
8 Flight arrived: 10:24
…
Characteristics
Complete and truthful
representation of history
• Natural alignment as Commands
result in Events
• Storage Method for Command Model
• Only persist changes
Replay all past Events to arrive
at current state (on an
Aggregate)
Guarantee Command Model State Construction
The Beauty of Immutability
Predictable model for
New Feature
Development
Data Mining
Transparency
No loss of context
within the entire
system.
Auditing
Accurate and correct
data.
Debugging
History of changes
makes it easier to
debug and safer to
correct data.
Analytics/Value from
Data
Model
Complexity
Eliminate the Mixed
Model problem.
Evolution
The
First Steps
02
CQRS/ES is easy to understand,
not as easy to implement
“correctly”
System of Events
System of State
NOT
All systems are eventually consistent.
Eventual Consistency
“Commands”/”Queries” and “Events”
are all “Messages”
Messaging
A Component should not be aware, nor make
any assumptions, of the physical location of
Components it interacts with.
Location Transparency
ES Capability Map
Digging in Deeper
03
A pattern name with “Event”
does not mean it is only about “Events”.
Event Sourcing != Event Streaming
We decided to Kubernetes my Custom CQRS/ES
platform based on Event Driven Microservices !
The Akka platform
The Axon Platform
It is also about the process.
Modeling Process Toolkit #1 – DDD Crew
https://github.com/ddd-crew/ddd-starter-modelling-process
Modeling Process Toolkit #1 – DDD Crew
Big-Picture
Event Storming
Decomposition
via Design
Heuristics
Validation of
Message Flows
Bounded
Context
Classifications
Team Topologies Bounded
Context Canvas
Design-Level
Event Storming
Aggregate
Design Canvas
And a lot more…..
Modeling Process Toolkit #2 – Event Modeling (Adam Dymitruk)
Collaboration Swim Lanes Events Commands
Read Models Interfaces
And a lot more…..
Modeling Process Toolkit #2 – Event Modeling (Adam Dymitruk)
Roadmap
04
A TIMELINE ALWAYS
WORKS FINE
Understand the
importance of
Immutabilty i.e. the
value from Immutable
Data.
Step 1
Choose a purpose-
built platform.
Step 2
Align processes
around these
concepts.
Step 3
Do things
progressively !
Step 4
Are you ready to take the leap of faith ?
WHOA!
THANKS
www.axoniq.io

More Related Content

Similar to Adopting DDD/CQRS/ES

Azure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep DiveAzure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep DiveIlyas F ☁☁☁
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azureSergey Seletsky
 
The Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache SparkThe Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache SparkCloudera, Inc.
 
The never changing face of immutability
The never changing face of immutabilityThe never changing face of immutability
The never changing face of immutabilityChris Howe-Jones
 
DITA's New Thang: Going Mapless!
DITA's New Thang: Going Mapless!DITA's New Thang: Going Mapless!
DITA's New Thang: Going Mapless!dclsocialmedia
 
Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Ludovico Caldara
 
Architecture As Language
Architecture As LanguageArchitecture As Language
Architecture As LanguageMarkus Voelter
 
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)Jernej Kavka (JK)
 
SplunkApplicationLoggingBestPractices_Template_2.3.pdf
SplunkApplicationLoggingBestPractices_Template_2.3.pdfSplunkApplicationLoggingBestPractices_Template_2.3.pdf
SplunkApplicationLoggingBestPractices_Template_2.3.pdfTuynNguyn819213
 
Data Mining & Analytics for U.S. Airlines On-Time Performance
Data Mining & Analytics for U.S. Airlines On-Time Performance Data Mining & Analytics for U.S. Airlines On-Time Performance
Data Mining & Analytics for U.S. Airlines On-Time Performance Mingxuan Li
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
Cansat 2008: University of Michigan Maizesat Final Presentation
Cansat 2008: University of Michigan Maizesat Final PresentationCansat 2008: University of Michigan Maizesat Final Presentation
Cansat 2008: University of Michigan Maizesat Final PresentationAmerican Astronautical Society
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportAlfredo Krieg
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applicationsIdo Flatow
 
Strategies for Integrating Utility System Operational Data into ArcGIS Server...
Strategies for Integrating Utility System Operational Data into ArcGIS Server...Strategies for Integrating Utility System Operational Data into ArcGIS Server...
Strategies for Integrating Utility System Operational Data into ArcGIS Server...True North Geographic Technologies
 

Similar to Adopting DDD/CQRS/ES (20)

New em12c kscope
New em12c kscopeNew em12c kscope
New em12c kscope
 
Azure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep DiveAzure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep Dive
 
Concurrecny inf sharp
Concurrecny inf sharpConcurrecny inf sharp
Concurrecny inf sharp
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azure
 
The Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache SparkThe Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache Spark
 
The never changing face of immutability
The never changing face of immutabilityThe never changing face of immutability
The never changing face of immutability
 
Big Data Tools in AWS
Big Data Tools in AWSBig Data Tools in AWS
Big Data Tools in AWS
 
DITA's New Thang: Going Mapless!
DITA's New Thang: Going Mapless!DITA's New Thang: Going Mapless!
DITA's New Thang: Going Mapless!
 
Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Let your DBAs get some REST(api)
Let your DBAs get some REST(api)
 
Architecture As Language
Architecture As LanguageArchitecture As Language
Architecture As Language
 
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
 
SplunkApplicationLoggingBestPractices_Template_2.3.pdf
SplunkApplicationLoggingBestPractices_Template_2.3.pdfSplunkApplicationLoggingBestPractices_Template_2.3.pdf
SplunkApplicationLoggingBestPractices_Template_2.3.pdf
 
Data Mining & Analytics for U.S. Airlines On-Time Performance
Data Mining & Analytics for U.S. Airlines On-Time Performance Data Mining & Analytics for U.S. Airlines On-Time Performance
Data Mining & Analytics for U.S. Airlines On-Time Performance
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
Cansat 2008: University of Michigan Maizesat Final Presentation
Cansat 2008: University of Michigan Maizesat Final PresentationCansat 2008: University of Michigan Maizesat Final Presentation
Cansat 2008: University of Michigan Maizesat Final Presentation
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR Report
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applications
 
Strategies for Integrating Utility System Operational Data into ArcGIS Server...
Strategies for Integrating Utility System Operational Data into ArcGIS Server...Strategies for Integrating Utility System Operational Data into ArcGIS Server...
Strategies for Integrating Utility System Operational Data into ArcGIS Server...
 
Engineering Test Rig
Engineering Test RigEngineering Test Rig
Engineering Test Rig
 
My lectures
My lecturesMy lectures
My lectures
 

Recently uploaded

Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Chirag Panchal
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Maxim Salnikov
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphNeo4j
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024SimonedeGijt
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfkalichargn70th171
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Andreas Granig
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConNatan Silnitsky
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jNeo4j
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...drm1699
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksJinanKordab
 
[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)Dimitrios Platis
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletAndrea Goulet
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Conceptsthomashtkim
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfryanfarris8
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaNeo4j
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio, Inc.
 

Recently uploaded (20)

Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 

Adopting DDD/CQRS/ES

  • 1. CQRS/DDD/ES Beer Time – CEST Coffee Time – PST Lunch Time – EST Snooze Time – ASPAC  Ask questions in the “Chat” area
  • 2. About Me ! Architect by day / CQRS-ES Evangelist by Night. 20 years of experience primarily building Products in the Financial Services space. Love to explore and write about Event Driven Architectures. Author of the book “Practical Domain-Driven Design with Enterprise Java” and the only book with “Axon” in its name. InfoQ Editor focused on CQRS/ES. Writing my second book “Pocket Guide to CQRS/ES using Axon” with Allard Buijze – out in August. Still learning ! So I might be wrong :)
  • 3. Agenda The First Steps 02 Roadmap 04 The Foundation 01 Digging in Deeper 03 What is DDD/CQRS/ES ? Peeling off the layers. Choice of Technology and Process. Setting yourself up for success.
  • 5. The Domain Model is the “heart” of an Application.
  • 6. Domain A Sphere of knowledge, influence or activity. The subject area to which the user applies a program is the domain of the software. Model A system of abstractions that describes selected aspects of a domain and can be used to solve problems related to that domain.
  • 7. Domain (or Sub-Domain) Categories Core Domain Generic Supporting The Money Maker Off the Shelf (e.g. Identity Management) Custom Built (e.g. Document Management) https://medium.com/nick-tune-tech-strategy-blog/domains-subdomain-problem-solution-space-in- ddd-clearly-defined-e0b49c7b586c
  • 9. Building Blocks Repositories Entities Value Objects Aggregates Events Bounded Contexts
  • 11. Scope of Model What are we optimizing for ? Non-Functional Concerns
  • 13. Command Query Responsibility Separation Command Model Focused on executing tasks. Primarily expressed in operations. Only contains data necessary for task execution and decision making. Query Model Focused on delivering information. Data is stored the way it is used. Denormalized/”table per view”
  • 14. Building Blocks Client Command Model Projections Commands Queries
  • 15. Synchronization Problem Client Command Model Projections Commands Queries
  • 16. Events as the Glue Client Command Model Projections Commands Events Queries
  • 17. CQRS, DDD & EDA Repository Command Event Query Projections (Aggregate, Entit Value Object, etc
  • 19. Traditional State Storage What happened What we store Flight flightNo: AC-323 planned departure time: 6:00 planned arrival time: 10:00 captain: T. Cruise status: awaiting departure 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise
  • 20. Traditional State Storage What happened What we store 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise 3 Departure slot missed: 6:00 4 Captain assigned: C. Lindbergh … Flight flightNo: AC-323 planned departure time: 6:00 planned arrival time: 10:00 captain: C. Lindbergh status: delayed at gate
  • 21. Traditional State Storage What happened What we store 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise 3 Departure slot missed: 6:00 4 Captain assigned: C. Lindbergh 5 Flight departed: 7:34 … Flight flightNo: AC-323 planned departure time: 6:00 planned arrival time: 10:00 captain: C. Lindbergh actual departure time : 7:34 status: in-flight
  • 22. Traditional State Storage What happened What we store 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise 3 Departure slot missed: 6:00 4 Captain assigned: C. Lindbergh 5 Flight departed: 7:34 6 Arrival time estimated: 11:30 7 Arrival time estimated: 10:40 8 Flight arrived: 10:24 … Flight flightNo: AC-323 planned departure time: 6:00 planned arrival time: 10:00 captain: C. Lindbergh actual departure time : 7:34 actual arrival time: 10:24 status: arrived The valuable information is here… Not here
  • 23. Event Sourcing System Of Events NOT System Of State
  • 24. Event Sourcing based Storage What happened What we store 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise 3 Departure slot missed: 6:00 4 Captain assigned: C. Lindbergh 5 Flight departed: 7:34 6 Arrival time estimated: 11:30 7 Arrival time estimated: 10:40 8 Flight arrived: 10:24 … 1 Flight scheduled: 6:00 - 10:00 2 Captain assigned: T. Cruise 3 Departure slot missed: 6:00 4 Captain assigned: C. Lindbergh 5 Flight departed: 7:34 6 Arrival time estimated: 11:30 7 Arrival time estimated: 10:40 8 Flight arrived: 10:24 …
  • 25. Characteristics Complete and truthful representation of history • Natural alignment as Commands result in Events • Storage Method for Command Model • Only persist changes Replay all past Events to arrive at current state (on an Aggregate) Guarantee Command Model State Construction
  • 26. The Beauty of Immutability Predictable model for New Feature Development Data Mining Transparency No loss of context within the entire system. Auditing Accurate and correct data. Debugging History of changes makes it easier to debug and safer to correct data. Analytics/Value from Data Model Complexity Eliminate the Mixed Model problem. Evolution
  • 28. CQRS/ES is easy to understand, not as easy to implement “correctly”
  • 29. System of Events System of State NOT
  • 30. All systems are eventually consistent. Eventual Consistency
  • 32. A Component should not be aware, nor make any assumptions, of the physical location of Components it interacts with. Location Transparency
  • 35. A pattern name with “Event” does not mean it is only about “Events”.
  • 36. Event Sourcing != Event Streaming
  • 37. We decided to Kubernetes my Custom CQRS/ES platform based on Event Driven Microservices !
  • 40. It is also about the process.
  • 41. Modeling Process Toolkit #1 – DDD Crew https://github.com/ddd-crew/ddd-starter-modelling-process
  • 42. Modeling Process Toolkit #1 – DDD Crew Big-Picture Event Storming Decomposition via Design Heuristics Validation of Message Flows Bounded Context Classifications Team Topologies Bounded Context Canvas Design-Level Event Storming Aggregate Design Canvas And a lot more…..
  • 43. Modeling Process Toolkit #2 – Event Modeling (Adam Dymitruk)
  • 44. Collaboration Swim Lanes Events Commands Read Models Interfaces And a lot more….. Modeling Process Toolkit #2 – Event Modeling (Adam Dymitruk)
  • 46. A TIMELINE ALWAYS WORKS FINE Understand the importance of Immutabilty i.e. the value from Immutable Data. Step 1 Choose a purpose- built platform. Step 2 Align processes around these concepts. Step 3 Do things progressively ! Step 4
  • 47. Are you ready to take the leap of faith ? WHOA!