SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Event Sourcing @ DDD Europe
Keynote
Udi Dahan
@UdiDahan
I’m not old enough to say “get off my lawn” but…
The best thing since sliced bread!
Just like every other technology & methodology
This was documented as the Gartner Hype Cycle
Some of you are here
Hopefully,
we’ll get you here
So, here’s what we’re dealing with:
Let’s bring some order to the chaos
What is “Event Sourcing” anyway?
Event sourcing refers to a collection of patterns based on
persisting the full history of a domain as a sequence of
“events”
rather than persisting just the current state
Reminder: The Domain Model pattern
An object model of the domain
that incorporates both behavior and data
Use when you have complicated and everchanging business
rules
If you have simple not-null checks and a couple of sums to
calculate, a Transaction Script is a better bet
- p119 Patterns of Enterprise Application Architect, Fowler et
al.
Beware the One Domain Model to rule them all
OK, so what is an “Event” then?
Historically speaking, first they were called “Interrupts”
These were signals to the processor
that something needed immediate attention
Keyboard and mouse clicks are a kind of Interrupt
And then came the Graphical User Interface
When a button was clicked, you got an “event”
a programming construct different from a class, method, or
pointer
You could register multiple “callbacks” for an event
which were essentially methods on a class, with arguments
which gave additional data about the event
Oh, so many arguments…
Private Sub object _MouseDown(
index As Long,
ByVal Button As fmButton,
ByVal Shift As fmShiftState,
ByVal X As Single,
ByVal Y As Single)
Then came the idea to use the Parameter Object pattern to
consolidate all the arguments together
Add strong-typing and an IDE…
Parameter Object
Component-Orientation was significant too
The idea was that complex software was better built as a
collection of loosely-coupled & highly-cohesive components
On top of that, events were a communication style that was
even more decoupled than invoking methods on an interface
This became known as Event-Driven Architecture (EDA)
There were “event producers”, “event consumers”, and
“channels” that connected them
Tip: producers can also be consumers, and vice versa
Integration pushed EDA & Messaging together
Integration between applications on different platforms was
hard
Message-oriented middleware made it easier
The events being emitted by systems following EDA were
well-suited to being transmitted by messages
The name of the event was put in the header of the message
(used for routing), and the arguments in the body
Content-based routing came later
Where we are today:
An Event is a kind of data structure (name + key/value args)
which represents an action that has already occurred
Infrastructure helps move these events around
Whether between systems using messaging
Or for persistence with event-sourcing
Before using Event Sourcing on complex systems
Beware the One Domain Model to rule them all
If you’re building a complex system…
UI
BL
DAL
DB
API
This isn’t your
Domain Model
Models of your domain
public class Customer
{
FirstName
LastName
Status
// etc
}
public class Product
{
Name
Description
Price
// etc
}
Customer
Status
Product
Price
Customer
FirstName
LastName
Product
Name
Description
TX Script TX ScriptDomain(?)
Now, take these boundaries and extend them
UI
BL
DAL
DB
API
Data and screens get partitioned
DB DB DB DB
With business-level events between boundaries
Events (pub/sub)
B1 B2 B3
Event
Store
DocDB Shards
Events on the outside vs inside
Sales Billing
Shipping
Order Accepted
Order Accepted
Order Billed
Auditing & Replay
Messaging infrastructure usually provides Auditing out-of-the-
box
Once you have auditing in place, Replay becomes possible
To be totally honest, there are so many challenges with
Replay
like when integrating with other systems, that it just isn’t worth
it
(except in edge cases).
Events on the outside vs inside: Notifications
Shipping
Events on the outside vs inside: Data Sync
Billing
Master DB
Oracle
Finance
SAP
Data
Warehouse
Change
Data
Capture
ETL
Product Catalog
Events on the outside vs inside: DB Replication
Write Master
Read ReplicasRead ReplicasRead ReplicasRead ReplicasRead Replicas
Async
DB Client SDK
CRUD
Sales: customers who bought X also bought A, B, C
Events on the outside vs inside: Graph Databases
Graph DB
Monitoring
(IT/Ops)
Events on the inside: Time Series Databases
Influx DB
Netflix
Atlas
This is where we find event logging & tracing
At scale, everything becomes custom
So, what’s Event Sourcing actually for?
Bi-temporal, Code as Data Domains
Event-sourcing is for building infrastructure
Below scale, Moore’s law is your friend: Scale UP
Biggest AWS EC2 Instance: 128 vCPU, 3904 GB Memory
Reserved instance 3 year term:
$6250/month
That’s cheaper than most developers
And the business will change along the way
Incorporate re-architecting time into your plans
No, it won’t be pretty, but it will be functional
Learn how to divide responsibilities
and get your boundaries right.
http://go.particular.net/dddeu2020
Want more?
Thank you
Udi Dahan
@UdiDahan

Weitere ähnliche Inhalte

Ähnlich wie Udi Dahan: Event Sourcing Keynote @ DDD EU

Complex Event Processing
Complex Event ProcessingComplex Event Processing
Complex Event ProcessingJohn Plummer
 
Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018Puppet
 
RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011Gerardo Pardo-Castellote
 
Introduction To Denodo March 2009
Introduction To Denodo March 2009Introduction To Denodo March 2009
Introduction To Denodo March 2009GladstoneUSA
 
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida  Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida CLARA CAMPROVIN
 
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesAgile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesRaphael Branger
 
Big dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlBig dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlKhanderao Kand
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Cloud Computing Webinar
Cloud Computing WebinarCloud Computing Webinar
Cloud Computing WebinarTechSoup
 
Event Driven Architecture (EDA), November 2, 2006
Event Driven Architecture (EDA), November 2, 2006Event Driven Architecture (EDA), November 2, 2006
Event Driven Architecture (EDA), November 2, 2006Tim Bass
 
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving IT
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving ITDynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving IT
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving ITDynatrace
 
Biz Nova It Project Bonus Slides
Biz Nova It Project Bonus SlidesBiz Nova It Project Bonus Slides
Biz Nova It Project Bonus SlidesTyHowardPMP
 
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)Amazon Web Services
 
Discover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 AnalyticsDiscover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 AnalyticsSriskandarajah Suhothayan
 
SaaS Vs On Premise BI
SaaS Vs On Premise BISaaS Vs On Premise BI
SaaS Vs On Premise BILCWynne
 
Onboarding process made agile with confluent and flowabl
Onboarding process made agile with confluent and flowablOnboarding process made agile with confluent and flowabl
Onboarding process made agile with confluent and flowablmimacom
 
Data Virtualization: From Zero to Hero
Data Virtualization: From Zero to HeroData Virtualization: From Zero to Hero
Data Virtualization: From Zero to HeroDenodo
 
Guido schmutz-jax2011-event-driven soa
Guido schmutz-jax2011-event-driven soaGuido schmutz-jax2011-event-driven soa
Guido schmutz-jax2011-event-driven soaGuido Schmutz
 
Wave 2010: The new way of working.
Wave 2010: The new way of working.Wave 2010: The new way of working.
Wave 2010: The new way of working.trustteam
 

Ähnlich wie Udi Dahan: Event Sourcing Keynote @ DDD EU (20)

Complex Event Processing
Complex Event ProcessingComplex Event Processing
Complex Event Processing
 
Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018
 
RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011RTI Data-Distribution Service (DDS) Master Class 2011
RTI Data-Distribution Service (DDS) Master Class 2011
 
Introduction To Denodo March 2009
Introduction To Denodo March 2009Introduction To Denodo March 2009
Introduction To Denodo March 2009
 
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida  Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida
Jet Reports es la herramienta para construir el mejor BI y de forma mas rapida
 
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - ExcercisesAgile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
Agile Testing Days 2017 Intoducing AgileBI Sustainably - Excercises
 
Big dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosqlBig dataarchitecturesandecosystem+nosql
Big dataarchitecturesandecosystem+nosql
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
Cloud Computing Webinar
Cloud Computing WebinarCloud Computing Webinar
Cloud Computing Webinar
 
Event Driven Architecture (EDA), November 2, 2006
Event Driven Architecture (EDA), November 2, 2006Event Driven Architecture (EDA), November 2, 2006
Event Driven Architecture (EDA), November 2, 2006
 
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving IT
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving ITDynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving IT
Dynatrace: Davis - Hololens - AI update - Cloud announcements - Self driving IT
 
Biz Nova It Project Bonus Slides
Biz Nova It Project Bonus SlidesBiz Nova It Project Bonus Slides
Biz Nova It Project Bonus Slides
 
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)
AWS re:Invent 2016: Building a Solid Business Case for Cloud Migration (ENT308)
 
Going Cloud First at the FT
Going Cloud First at the FTGoing Cloud First at the FT
Going Cloud First at the FT
 
Discover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 AnalyticsDiscover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 Analytics
 
SaaS Vs On Premise BI
SaaS Vs On Premise BISaaS Vs On Premise BI
SaaS Vs On Premise BI
 
Onboarding process made agile with confluent and flowabl
Onboarding process made agile with confluent and flowablOnboarding process made agile with confluent and flowabl
Onboarding process made agile with confluent and flowabl
 
Data Virtualization: From Zero to Hero
Data Virtualization: From Zero to HeroData Virtualization: From Zero to Hero
Data Virtualization: From Zero to Hero
 
Guido schmutz-jax2011-event-driven soa
Guido schmutz-jax2011-event-driven soaGuido schmutz-jax2011-event-driven soa
Guido schmutz-jax2011-event-driven soa
 
Wave 2010: The new way of working.
Wave 2010: The new way of working.Wave 2010: The new way of working.
Wave 2010: The new way of working.
 

Kürzlich hochgeladen

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
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 ApplicationsAlberto González Trastoy
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
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.comFatema Valibhai
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Kürzlich hochgeladen (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
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
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
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
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

Udi Dahan: Event Sourcing Keynote @ DDD EU

  • 1. Event Sourcing @ DDD Europe Keynote Udi Dahan @UdiDahan
  • 2. I’m not old enough to say “get off my lawn” but…
  • 3. The best thing since sliced bread!
  • 4. Just like every other technology & methodology
  • 5. This was documented as the Gartner Hype Cycle Some of you are here Hopefully, we’ll get you here
  • 6. So, here’s what we’re dealing with:
  • 7. Let’s bring some order to the chaos
  • 8. What is “Event Sourcing” anyway? Event sourcing refers to a collection of patterns based on persisting the full history of a domain as a sequence of “events” rather than persisting just the current state
  • 9. Reminder: The Domain Model pattern An object model of the domain that incorporates both behavior and data Use when you have complicated and everchanging business rules If you have simple not-null checks and a couple of sums to calculate, a Transaction Script is a better bet - p119 Patterns of Enterprise Application Architect, Fowler et al.
  • 10. Beware the One Domain Model to rule them all
  • 11. OK, so what is an “Event” then? Historically speaking, first they were called “Interrupts” These were signals to the processor that something needed immediate attention Keyboard and mouse clicks are a kind of Interrupt
  • 12. And then came the Graphical User Interface When a button was clicked, you got an “event” a programming construct different from a class, method, or pointer You could register multiple “callbacks” for an event which were essentially methods on a class, with arguments which gave additional data about the event
  • 13. Oh, so many arguments… Private Sub object _MouseDown( index As Long, ByVal Button As fmButton, ByVal Shift As fmShiftState, ByVal X As Single, ByVal Y As Single) Then came the idea to use the Parameter Object pattern to consolidate all the arguments together
  • 14. Add strong-typing and an IDE… Parameter Object
  • 15. Component-Orientation was significant too The idea was that complex software was better built as a collection of loosely-coupled & highly-cohesive components On top of that, events were a communication style that was even more decoupled than invoking methods on an interface This became known as Event-Driven Architecture (EDA) There were “event producers”, “event consumers”, and “channels” that connected them Tip: producers can also be consumers, and vice versa
  • 16. Integration pushed EDA & Messaging together Integration between applications on different platforms was hard Message-oriented middleware made it easier The events being emitted by systems following EDA were well-suited to being transmitted by messages The name of the event was put in the header of the message (used for routing), and the arguments in the body Content-based routing came later
  • 17. Where we are today: An Event is a kind of data structure (name + key/value args) which represents an action that has already occurred Infrastructure helps move these events around Whether between systems using messaging Or for persistence with event-sourcing
  • 18. Before using Event Sourcing on complex systems
  • 19. Beware the One Domain Model to rule them all
  • 20. If you’re building a complex system… UI BL DAL DB API This isn’t your Domain Model
  • 21. Models of your domain public class Customer { FirstName LastName Status // etc } public class Product { Name Description Price // etc } Customer Status Product Price Customer FirstName LastName Product Name Description TX Script TX ScriptDomain(?)
  • 22. Now, take these boundaries and extend them UI BL DAL DB API
  • 23. Data and screens get partitioned DB DB DB DB
  • 24. With business-level events between boundaries Events (pub/sub) B1 B2 B3 Event Store DocDB Shards
  • 25. Events on the outside vs inside Sales Billing Shipping Order Accepted Order Accepted Order Billed
  • 26. Auditing & Replay Messaging infrastructure usually provides Auditing out-of-the- box Once you have auditing in place, Replay becomes possible To be totally honest, there are so many challenges with Replay like when integrating with other systems, that it just isn’t worth it (except in edge cases).
  • 27. Events on the outside vs inside: Notifications Shipping
  • 28. Events on the outside vs inside: Data Sync Billing Master DB Oracle Finance SAP Data Warehouse Change Data Capture ETL
  • 29. Product Catalog Events on the outside vs inside: DB Replication Write Master Read ReplicasRead ReplicasRead ReplicasRead ReplicasRead Replicas Async DB Client SDK CRUD
  • 30. Sales: customers who bought X also bought A, B, C Events on the outside vs inside: Graph Databases Graph DB
  • 31. Monitoring (IT/Ops) Events on the inside: Time Series Databases Influx DB Netflix Atlas This is where we find event logging & tracing
  • 32. At scale, everything becomes custom
  • 33. So, what’s Event Sourcing actually for?
  • 34. Bi-temporal, Code as Data Domains
  • 35. Event-sourcing is for building infrastructure
  • 36. Below scale, Moore’s law is your friend: Scale UP Biggest AWS EC2 Instance: 128 vCPU, 3904 GB Memory Reserved instance 3 year term: $6250/month That’s cheaper than most developers
  • 37. And the business will change along the way
  • 39. No, it won’t be pretty, but it will be functional
  • 40. Learn how to divide responsibilities and get your boundaries right. http://go.particular.net/dddeu2020 Want more?

Hinweis der Redaktion

  1. © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  2. I got to tell you, the things I’ve been hearing about this “event sourcing” thing. People are treating it as
  3. It does the scaling, the consistency, the auditing, the modeling, the time to market… And I got to tell you, it sounds like the promises I’ve heard from…
  4. So, yeah, naming things is hard, but there’s so much more than just Event-Blah. There’s also Service-Oriented Architecture, Microservices, Domain Models, DDD, and even CRUD.
  5. I’ll be touching on some older computer history along the way, so please bear with me.
  6. A “pattern” is a solution design for a certain problem context. It is not a “best practice”. Event-sourcing has a whole bunch of ramifications that many of the other speakers will talk about today, so I want to focus on setting the stage here. Now, a lot of you already know the Domain Model pattern, or at least think you do, but here’s a friendly reminder just in case.
  7. And in the darkness bind them. But we’ll get back to this idea of having multiple domain models – event-sourced or otherwise, a bit later.
  8. Note there was nothing about Event-Driven Architecture which meant it had to be distributed.
  9. 1. The thing was, there was no interoperable pure event-based model that worked at the time. There still isn’t – not really.
  10. Now, remember that we said that Event-Sourcing is based on the Domain Model pattern? Right. And remember what we said about the domain model?
  11. Use when you have complicated and everchanging business rules “If you have simple not-null checks and a couple of sums to calculate, a Transaction Script is a better bet”
  12. All the way down through the database, and all the way up through the UI
  13. Whether you’re using SignalR, or Azure Notification Hubs, or Google Cloud Messaging – this is about pushing data updates to your users.
  14. You might be familiar with the concept of Projections in Event Sourcing, for creating read models that are quick and easy to read from. Almost all databases already have this functionality built-in.
  15. You won’t see domain models everywhere. You won’t see event-sourcing everywhere. Each area becomes a special case.
  16. If you look at how databases do replication – you’ll see Event Sourcing patterns. If you look at how Time Series Databases work, you’ll also see Event Sourcing patterns. Things like Event Replay are a great way to get a new database node up and running in a cluster. If/when existing database technologies just don’t handle the scale you need, you’ll use Event Sourcing patterns to build your own.
  17. Seriously, I’ve seen far too many systems where the over-engineered complexity was what hurt its performance, to the point where even scaling up didn’t help. Start simple.
  18. Accept that you’ll need to redesign the system over time. Explain that to stakeholders. That this is *normal*.
  19. And that’s the most important thing. That the business can continue doing what it needs to do, and lives to fight another day.
  20. I know I’ve just barely scratched the surface on these ideas, so if you want more, check out my videos on this link. And I hope you’ve