Skip to content

What is Event Sourcing?

Event Sourcing is a way of storing data that focuses on what happened, not just what is – the foundation on which other concepts like Data Mesh and AI can build.

Instead of saving only the current state, you store a series of events that describe every meaningful change over time.

Each event is a fact – something that happened in the past. For example, in a library domain:

  • BookBorrowed – a member borrows a copy of a book
  • LoanExtended – the due date is pushed further into the future
  • BookReturned – the book is brought back
  • LateFeeIncurred – a fee is charged for returning it late

These events are stored in the order they occurred, forming the complete history of a business entity.

How Is That Different from Traditional Storage?

In a typical CRUD system, you store only the current state: "Which books are on loan?" or "How much does this member owe?"

With Event Sourcing, you store how the state came to be:

The state itself is not stored – it is reconstructed by replaying all events.

This lets you:

  • Rebuild the current state at any time
  • See exactly when and why something happened
  • Audit and debug with full traceability

Why Store Events?

Recording every event provides several important advantages:

  • Traceability: You know how something changed, not just that it changed.
  • Auditability: Every action is preserved – no data is lost or overwritten.
  • Flexibility: You can create new projections or analytical views later from the same history.
  • Domain clarity: Events are written in the language of the business, making them meaningful for developers, analysts, and data scientists alike.
  • Foundation for analytics and AI: Immutable, well-defined events are ideal for statistics, time-series analysis, and machine learning.

From Events to Projections

While the event store contains the raw history, most queries are answered by projections – derived data built from processing the event stream.

These projections can take many forms:

  • A list of all books currently on loan
  • A member's complete borrowing history
  • A time series of loans per week for statistical analysis or forecasting

Because projections can be rebuilt at any time, they always stay consistent with the events they are based on. This makes Event Sourcing an ideal foundation not only for operational systems, but also for data-driven insights, forecasting, and intelligent systems.

Next up: Data Mesh – how to turn events into versioned, discoverable, and reusable data products.