Event Sourcing
Event sourcing uses an immutable sequence of events as the source of truth for state; current state derives from replaying events, supporting audit and time travel.
Purpose
Complete audit trails and time-travel debugging, eliminating state synchronization issues.
Mechanism
Each state change emits an immutable event stored in the event store. Current state = reduce(all events). Benefits: complete audit, time travel, undo/redo. Costs: high complexity, event schema evolution, snapshot optimization.
Use cases
- Audit trails
- CQRS
- Domain-driven design
Related terms
CQRS
CQRS separates read and write operations into distinct models—the read side optimizes queries, the write side optimizes validation—often paired with event sourcing. GLOSSARY
Event-Driven Architecture
Event-driven architecture centers on events: producers publish events and consumers respond to them, decoupling component communication. GLOSSARY