Skip to content

Single Source of Truth

In event-driven systems that use Event Sourcing, there is only one place that holds the complete truth: the event log.

Everything else – state, read models, decisions – is derived from the sequence of events.

In Our Library

If you know:

  • Which member borrowed which copy
  • When it was borrowed
  • When it was returned
  • Whether it was overdue

…then you can answer any question the system needs to support.

That's because the events are the truth. Everything else – like a list of current loans or overdue items – is just a projection built for convenience.

Events Define the System

  • Command handlers use events to reconstruct state and make decisions.
  • Projections use events to build queryable views.
  • Policies (we'll cover those later) use events to trigger new actions.

Whether it's behavior, state, or process – it all flows from the event stream.

Why This Matters

By making events the source of truth, you gain:

  • Transparency: you know exactly what happened and when
  • Recoverability: you can rebuild any part of the system
  • Flexibility: you can create new models or workflows without touching old code
  • Consistency: everything is based on the same factual history

It's not just a log. It's the foundation of your system.

Next up: Take a step back and review how all parts of an event-driven system fit together – in the Summary.