What is Event Sourcing
Storing state through event history
Event Sourcing is an architectural pattern where application state is determined by a sequence of events rather than a current data snapshot.
How It Works
- Event — an immutable record of what happened
- Event Store — storage of all events in chronological order
- Projection — current state reconstructed from events
- Replay — ability to reproduce all events
Benefits
- Complete change history (audit trail)
- Ability to roll back to any point in time
- System behavior debugging and analysis
- Support for CQRS (Command Query Responsibility Segregation)
Use Cases
- Banking transactions and payment systems
- Booking and order systems
- Game servers (match replays)
- Audit and compliance in financial applications
Technologies
Event Store, Apache Kafka, Axon Framework, Marten (.NET).