Event sourcing is an architecture pattern where all changes to application state are stored as a sequence of events. These events can be used to reconstruct past states and serve as the system of record. The key aspects of event sourcing are storing all changes as a sequence of immutable events, maintaining a write-optimized event log, and deriving the current state by replaying the events in order. Event sourcing allows for easy duplication of data through event replay and makes it possible to undo changes by replaying a modified sequence of events. Popular technologies for implementing event sourcing include Event Store and Apache Kafka.
2. Stats about me
Name: Radu Iscu
Years of copy-pasting code professionally: 10
Technologies outlived: .net 1.x, Flash, Flex, Web
Forms, Web parts
Programming languages outlived: Turbo Pascal,
Perl, PHP, Action Script 2-3, Visual Basic .net
Programming languages: c#, javascript, scala
24. Event versioning
ATM pull v1 ATM pull v2 ATM pull v3
Bank
deposit v1
Bank
deposit v2
Bank
deposit v3
Request for
statement
v1
Request for
statement
v2
Request for
statement
v3
25. Undoing changes
Original
event
State is OK
Problem
event(s)
Events are added that put the system in an error state
Changes
New events are impacted
Re-add
original state
Read the original state
Reapply changes
35. Retry pipeline
Event
Send fail event
Original event
Transform
Increment try count on original event
State
machine
If try count > max tries => dump
If try count < max tries => send
Dispatcher
Send message
Log message send attempt
36. Load balancer
State
machine
Use information from the events to
decide where they go
Mark events accordingly
Dispatcher
Send events based on markings made
by state machine
38. Interacting with outside systems
Time bound values (i.e. money)
Systems where reads have side effects (i.e. credit
scores)
Log everything that you send
43. Reading/watching list
Article about event sourcing with some code
samples
https://martinfowler.com/eaaDev/EventSourcing.h
tml
Presentation about event sourcing
https://www.youtube.com/watch?v=JHGkaShoyNs
Presentation about source control as data
https://www.youtube.com/watch?v=KaLROwp-VDY