Glossary/Event Sourcing
Architecture Patterns
1 min read
Share:

What is Event Sourcing?

TL;DR

Event sourcing stores every state change as an immutable event, building current state by replaying the event history.

Event sourcing stores every state change as an immutable event, building current state by replaying the event history. Instead of storing "the account balance is $500," you store every deposit and withdrawal. Current state is derived by replaying events in order.

Benefits: Complete audit trail (every change is recorded), Time travel (reconstruct state at any point in time), Event replay (reprocess events with new business logic), and Natural for distributed systems (events are the communication mechanism).

Challenges: Eventual consistency (reads may be stale), Event schema evolution (changing event formats over time), and Storage growth (events accumulate forever — use snapshots for performance).

Why It Matters

Event sourcing provides perfect auditability and the ability to reconstruct any historical state. Essential for financial systems, compliance-heavy domains, and systems where "why did this happen?" is a common question.

Frequently Asked Questions

What is event sourcing?

Storing every state change as an immutable event, then deriving current state by replaying events. Provides complete audit trail, time travel, and event replay capabilities.

Event sourcing vs CRUD?

CRUD stores current state (overwriting history). Event sourcing stores all state changes (preserving history). Use CRUD for simple domains. Use event sourcing when audit trails, temporal queries, or event replay are valuable.

Related Terms

Need Expert Help?

Richard Ewing is a Product Economist and AI Capital Auditor. He helps companies translate technical complexity into financial clarity.

Book Advisory Call →