Skip to content
uencoder

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

References