SlideShare a Scribd company logo
1 of 52
Event Sourcing
THE BEST UBIQUITOUS
PATTERN YOU’VE NEVER
HEARD OF
@blimpyacht
User: A
Balance: 427
User: B
Balance: 550
User: A
Balance: 427
User: B
Balance: 550
User: A
Balance: 427
User: B
Balance: 550
+5-5
Event Sourcing
Event Sourcing
http://www.avanscoperta.it/en/training/cqrs-event-sourcing-and-applying-domain-driven-design/
https://media.licdn.com/media/p/5/005/09f/2d8/3c9f5a5.jpg
Event Sourcing
Event Sourcing
Command Query Responsibility Segregation
(CQRS)
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5 t(12) = 9
Event Sourcing
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
t(5) = 10
Event Sourcing
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
t(9) = 12
Event Sourcing
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
Event Sourcing
f ’(x) = A
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
Event Sourcing
+5
-4
+5
Res Gestae Divi Augusti
Primary
Primary
Primary
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
Event Sourcing
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
t(4) = 14
Event Sourcing
t(8) = 10
t(12) = 9
Journal
Journal
Ledger
Accounts Payable
Journal
Ledger
Accounts Payable Accounts Receivab
Journal
Ledger
Command Query
Responsibility
Segregation
CQR
S
CRUD vs. CQRS
CRUD
CRUD vs. CQRS
WRIT
E
READ
WRIT
E
READ
Primar
y
READ
CRUD vs. CQRS
WRIT
E
Primar
y
READ
Variant Read Models: VIEWS
READ
READ
READ
READ
WRIT
E
READ
Primar
y
READ
CRUD vs. CQRS
CRUD vs. CQRS
2ndary
WRIT
E
READ
2ndary
Primar
y
READ
CRUD vs. CQRS
2ndary
WRIT
E
READ
2ndary
Primar
y
READ
Where it Gets Tricky
CRUD vs. CQRS
2ndary
WRIT
E
READ
2ndary
Primar
y
READ
CRUD vs. CQRS
2ndary
2ndary
Primar
y
WRIT
E
READ
READ
Consistent Replay
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
t(5) = 10 Exchange Rate
Server
10 / 0.88 = 8.82€
Consistent Replay
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
t(5) = 10 Exchange Rate
Server
10 / 0.87 = 8.70€
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
0.88
Exchange Rate
Server
Consistent Replay
Bounded Context
applicability of the model
internally consistent UNIFICATION
Where it Gets More Tricky
External Updates
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
Notification
Subscriber
http://www.webstaurantstore.com/images/products/extra_large/68
External Updates
+4
-2
+5
+7
-4
+9
-3
-6
+2
+1
+1
-5
Notification
SubscriberKafka
THANKS!
{ Name: ‘Bryan Reinero’,
Title: ‘Developer Advocate’,
Twitter: ‘@blimpyacht’,
Email: ‘bryan@mongdb.com’ }
{
"_id" : ObjectId("565f1dd8d4c6d9a90a9a16ce"),
"country" : "USA",
"crew" : "Ed White",
"vehicle" : "Gemini IV",
"date" : "6/3/65",
"duration" : "0:36",
"purpose" : "First U.S. EVA. Used HHMU and took photos,
"minutes" : 36
}
{
"_id" : ObjectId("565f1dd8d4c6d9a90a9a16cf"),
"country" : "USA",
"crew" : "Eugene Cernan",
"vehicle" : "Gemini IX-A",
"date" : "6/5/66",
"duration" : "2:07",
"purpose" : "Inadequate restraints stiff 25ft umbilical and high workloads….,
"minutes" : 127
}
{
"_id" : ObjectId("565f1dd8d4c6d9a90a9a16d0"),
"country" : "USA",
"crew" : "Mike Collins",
"vehicle" : "Gemini X",
"date" : "7/19/66",
"duration" : "0:50",
db.EVA.aggregate(
[
{ "$match": { "crew" : /David Scott/ } },
{ "$project": {
_id: 0,
name: { $literal: "David Scott" },
minutes: 1, }
},
{ "$group": { _id: "$name", total: { $sum: "$minutes" } } }
]
);
{ "_id" : "David Scott", "total" : 1200 }

More Related Content

Viewers also liked

Pola i obwody figur płaskich
Pola i obwody figur płaskichPola i obwody figur płaskich
Pola i obwody figur płaskich
SP114
 
Medios de comunicación,transmisión,cable coaxial.
Medios de comunicación,transmisión,cable coaxial.Medios de comunicación,transmisión,cable coaxial.
Medios de comunicación,transmisión,cable coaxial.
Lizeth Correa
 

Viewers also liked (10)

About abstract class
About abstract classAbout abstract class
About abstract class
 
eReefs Data Brokering Layer
eReefs Data Brokering LayereReefs Data Brokering Layer
eReefs Data Brokering Layer
 
Produk rekayasa panel surya
Produk rekayasa panel suryaProduk rekayasa panel surya
Produk rekayasa panel surya
 
2nd webinar - Implementation of integrated EnMS & SEAPs - SOGESCA - E.Cosenza
2nd webinar - Implementation of integrated EnMS & SEAPs - SOGESCA - E.Cosenza2nd webinar - Implementation of integrated EnMS & SEAPs - SOGESCA - E.Cosenza
2nd webinar - Implementation of integrated EnMS & SEAPs - SOGESCA - E.Cosenza
 
Pola i obwody figur płaskich
Pola i obwody figur płaskichPola i obwody figur płaskich
Pola i obwody figur płaskich
 
Juan carlos briquet los desiertos más grandes del mundo
Juan carlos briquet   los desiertos más grandes del mundoJuan carlos briquet   los desiertos más grandes del mundo
Juan carlos briquet los desiertos más grandes del mundo
 
2nd OTS - 50000&1SEAPs : Pierre Crepaux, Lorient (FR)
2nd OTS - 50000&1SEAPs : Pierre Crepaux, Lorient (FR)2nd OTS - 50000&1SEAPs : Pierre Crepaux, Lorient (FR)
2nd OTS - 50000&1SEAPs : Pierre Crepaux, Lorient (FR)
 
Cekindo regulatory for healthcare and wellness in indonesia
Cekindo regulatory for healthcare and wellness in indonesiaCekindo regulatory for healthcare and wellness in indonesia
Cekindo regulatory for healthcare and wellness in indonesia
 
Unidad III Herramientas de aprendizaje
Unidad III Herramientas de aprendizajeUnidad III Herramientas de aprendizaje
Unidad III Herramientas de aprendizaje
 
Medios de comunicación,transmisión,cable coaxial.
Medios de comunicación,transmisión,cable coaxial.Medios de comunicación,transmisión,cable coaxial.
Medios de comunicación,transmisión,cable coaxial.
 

Similar to Event sourcing

20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
Craeg Strong
 
Build It and They Will Come: SharePoint 2013 User Adoption
Build It and They Will Come:  SharePoint 2013 User AdoptionBuild It and They Will Come:  SharePoint 2013 User Adoption
Build It and They Will Come: SharePoint 2013 User Adoption
Stacy Deere
 

Similar to Event sourcing (20)

Event Sourcing + CQRS
Event Sourcing + CQRSEvent Sourcing + CQRS
Event Sourcing + CQRS
 
Big Data Day LA 2015 - Event Sourcing: The Best Ubiquitous Pattern You've Nev...
Big Data Day LA 2015 - Event Sourcing: The Best Ubiquitous Pattern You've Nev...Big Data Day LA 2015 - Event Sourcing: The Best Ubiquitous Pattern You've Nev...
Big Data Day LA 2015 - Event Sourcing: The Best Ubiquitous Pattern You've Nev...
 
Two Methods for Modeling LTV with a Spreadsheet
Two Methods for Modeling LTV with a SpreadsheetTwo Methods for Modeling LTV with a Spreadsheet
Two Methods for Modeling LTV with a Spreadsheet
 
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
Tamir Dresher   Clarizen adventures with the wild GC during the holiday seasonTamir Dresher   Clarizen adventures with the wild GC during the holiday season
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
 
ScrumBan Evolution - What is you next step?
ScrumBan Evolution - What is you next step?ScrumBan Evolution - What is you next step?
ScrumBan Evolution - What is you next step?
 
Scaling Agile to the Enterprise: 5 Secrets to Unlocking the Strategic Value o...
Scaling Agile to the Enterprise: 5 Secrets to Unlocking the Strategic Value o...Scaling Agile to the Enterprise: 5 Secrets to Unlocking the Strategic Value o...
Scaling Agile to the Enterprise: 5 Secrets to Unlocking the Strategic Value o...
 
Belgian Ad School 2014
Belgian Ad School 2014Belgian Ad School 2014
Belgian Ad School 2014
 
Scrum and kanban
Scrum and kanbanScrum and kanban
Scrum and kanban
 
Test Automation in the Fast Lane by Caleb Eno
Test Automation in the Fast Lane by Caleb EnoTest Automation in the Fast Lane by Caleb Eno
Test Automation in the Fast Lane by Caleb Eno
 
O365Engage17 - Provisioning O365 Groups
O365Engage17 - Provisioning O365 GroupsO365Engage17 - Provisioning O365 Groups
O365Engage17 - Provisioning O365 Groups
 
Them’s the Rules: Using a Rules Engine to Wrangle Complexity
Them’s the Rules: Using a Rules Engine to Wrangle ComplexityThem’s the Rules: Using a Rules Engine to Wrangle Complexity
Them’s the Rules: Using a Rules Engine to Wrangle Complexity
 
Data Science Training | Data Science Tutorial for Beginners | Data Science wi...
Data Science Training | Data Science Tutorial for Beginners | Data Science wi...Data Science Training | Data Science Tutorial for Beginners | Data Science wi...
Data Science Training | Data Science Tutorial for Beginners | Data Science wi...
 
Event sourcing the best ubiquitous pattern you have never heard off
Event sourcing   the best ubiquitous pattern you have never heard offEvent sourcing   the best ubiquitous pattern you have never heard off
Event sourcing the best ubiquitous pattern you have never heard off
 
Build It And They Will Come: User Adoption SharePoint 2013 (SPS Charlotte)
Build It And They Will Come:  User Adoption SharePoint 2013 (SPS Charlotte)Build It And They Will Come:  User Adoption SharePoint 2013 (SPS Charlotte)
Build It And They Will Come: User Adoption SharePoint 2013 (SPS Charlotte)
 
Introduce to PredictionIO
Introduce to PredictionIOIntroduce to PredictionIO
Introduce to PredictionIO
 
(MED302) Leveraging Cloud-Based Predictive Analytics to Strengthen Audience E...
(MED302) Leveraging Cloud-Based Predictive Analytics to Strengthen Audience E...(MED302) Leveraging Cloud-Based Predictive Analytics to Strengthen Audience E...
(MED302) Leveraging Cloud-Based Predictive Analytics to Strengthen Audience E...
 
IETF 104: Deployment of validation reconsidered
IETF 104: Deployment of validation reconsideredIETF 104: Deployment of validation reconsidered
IETF 104: Deployment of validation reconsidered
 
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenGrokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
 
20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
20190923 AgileDC 2019 Conf Kanban AntiPatterns: What you don't know *can* hur...
 
Build It and They Will Come: SharePoint 2013 User Adoption
Build It and They Will Come:  SharePoint 2013 User AdoptionBuild It and They Will Come:  SharePoint 2013 User Adoption
Build It and They Will Come: SharePoint 2013 User Adoption
 

More from Bryan Reinero

More from Bryan Reinero (7)

MongoDB, Event Sourcing & Spark
MongoDB, Event Sourcing & SparkMongoDB, Event Sourcing & Spark
MongoDB, Event Sourcing & Spark
 
Mongo db &_spark
Mongo db &_sparkMongo db &_spark
Mongo db &_spark
 
Systems of engagement
Systems of engagementSystems of engagement
Systems of engagement
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
Polyglot Persistence
Polyglot PersistencePolyglot Persistence
Polyglot Persistence
 
Code instrumentation
Code instrumentationCode instrumentation
Code instrumentation
 
Mongo db v3_deep_dive
Mongo db v3_deep_diveMongo db v3_deep_dive
Mongo db v3_deep_dive
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Event sourcing

Editor's Notes

  1. http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-84-75-metablogapi/3808.image_5F00_14B6A83B.png https://media.licdn.com/media/p/5/005/09f/2d8/3c9f5a5.jpg
  2. http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-84-75-metablogapi/3808.image_5F00_14B6A83B.png https://media.licdn.com/media/p/5/005/09f/2d8/3c9f5a5.jpg
  3. http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-84-75-metablogapi/3808.image_5F00_14B6A83B.png https://media.licdn.com/media/p/5/005/09f/2d8/3c9f5a5.jpg
  4. http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-84-75-metablogapi/3808.image_5F00_14B6A83B.png https://media.licdn.com/media/p/5/005/09f/2d8/3c9f5a5.jpg
  5. Temporal Queries Replay or Rebuild Hard to Attack
  6. Temporal Queries Replay or Rebuild Hard to Attack
  7. Temporal Queries Replay or Rebuild Hard to Attack
  8. Temporal Queries Replay or Rebuild Hard to Attack
  9. Temporal Queries Replay or Rebuild Hard to Attack
  10. Checkpoints
  11. Checkpoints
  12. . I.E. terms always have the same meaning and the model contains no contradictory rules.