~/notes/event-sourcing

Event Sourcing

Instead of storing current state, the service appends every state-changing event to an immutable log (event store).

Aug 20, 2026

diagram
append eventsreplay

Command

Aggregate

Event Store

Projection Handler

Read Model

Query

append eventsreplay

Command

Aggregate

Event Store

Projection Handler

Read Model

Query

Pros

  • Keeps a full record of every decision that changes the state.
  • Makes it possible to rebuild new projections and answer questions about changes over time.
  • Keeps long-lasting facts separate from temporary read models.

Drawbacks

  • Changing event formats and making sure old events still work are tough problems over time.
  • If you do not use snapshots or organise data well, rebuilding large streams can take a long time.
  • You need special tools to debug projections and fix bad events.