Event Sourcing
Storing application state as a sequence of immutable events rather than current values.
Definition
Event sourcing is an architectural pattern where changes to application state are stored as an immutable, append-only log of events rather than overwriting current state in a database. The current state can be reconstructed by replaying all events from the beginning. This provides complete audit history, enables temporal queries (state at any point in time), supports event-driven architectures, and allows projecting events into multiple read models. It pairs naturally with CQRS (Command Query Responsibility Segregation).
Example
“A bank account balance is not stored directly; instead, Deposit and Withdrawal events are appended to the event log, and the balance is computed by summing all events, providing a complete transaction audit trail by design.”
Synonyms
- event log
- immutable event store
- audit log architecture
Antonyms / Opposites
- state-based storage
- current state database
Images
CC-licensed · free to useVideo
Related Terms
- pub-sub
- message-queue
- microservices
- event-driven
