Académique Documents
Professionnel Documents
Culture Documents
Amount
Payment Deposit
+ $3000
$3000
Bill Payments
- $1800
$1200
CC Charge
- $900
$300
Speed Fine
- $300
$0
WTF!?
Why no money?
$0
Event sourcing
Payment Deposit
+ $3000
Bill Payments
- $1800
CC Charge
- $900
Speed Fine
- $300
Hmm need
cheaper room
$0
Domain Event #1
Entity (State 1)
Entity (State 1)
Domain Event #1
Domain Event #2
...
Domain Event #n
Entity (State n)
...
Domain Event #4
Domain Event #5
Domain Event #6
Entity (Version 6)
Persisted!
Something important
Sample Domain:
Room Access Control
Access Control Zone
AC Software
Hardware
Controlers
Valid Permission
Lock
None or invalid Permission
Demo #0
Initial, save state model
Demo #1
What We need for Event Sourcing:
Domain Events
Event Store
Event Sourcing
Limitations
Snapshot
Event #1
Event #2
Event #3
Event #4
Snapshot (Version3)
Event #5
Event #4
Event #6
Event #5
Event #6
Entity (Version 6)
Demo #2
Snapshot store
What's with
Command-Query Responsibility Segregation ?
Query
(non-domain views)
Read Side
view-only data
User
UI
Command
(non-domain parameters)
DB
Domain Logic
Query
(non-domain views)
Read Side
view-only data
Read
Store
User
UI
Command
(non-domain parameters)
Synchronization
Event
Store
Domain Logic
Add Events
Demo #3
ES to do or not to do
Yes when:
Event Driven
Architecture
Maybe no when:
No events needed
Concurency
Legacy software
Scalable, modifiable
systems
What next:
Udi Dahan
http://www.udidahan.com/
http://geteventstore.com/blog/
http://cqrsjourney.github.io/
Szymon Pobiega
http://simon-says-architecture.com/
meet me at:
https://twitter.com/a_kosinski