-
Notifications
You must be signed in to change notification settings - Fork 0
EventSourcing basics
In order to keep transactions atomic over multiple services we need to provide a method to change an entity in one operation. For this we use the event sourcing pattern.
e.g. User gets created -> Checks for valid input --> Raises USER_CREATED event with payload --> Service recives USER_CREATED and put's it into database. Database is just a view of the current state! Database is read only! Just Events can change the state!
In this example user service creates events that itself consumes! This is how we deal with all write operations.
Further reads: http://microservices.io/patterns/data/event-sourcing.html
https://www.confluent.io/blog/turning-the-database-inside-out-with-apache-samza/
https://www.oreilly.com/ideas/why-local-state-is-a-fundamental-primitive-in-stream-processing