Event Sourcing — The Basics

Albert Starreveld
10 min readJul 31, 2023

In conventional software development, applications typically store their state in a database. To retrieve specific data, an application queries the database, and the results are used presented to the user.

However, Event Sourcing introduces a different approach. Instead of storing the final state of an object in the database, event-sourcing preserves the sequence of events that led to the current state of the object. By reapplying these events in sequence, the object’s previous state is reconstructed.

Event-Sourcing offers several significant benefits, with two standing out in particular:

  • Built-in Audit-Trail: One of the primary advantages of Event-Sourcing is that it inherently provides an Audit-Trail. This means that you can always trace back the events that led to the current state of an object.
  • Scalability: When implemented correctly, Event-Sourced systems can scale almost endlessly.

History

The concept of Event Sourcing has been around for years. Articles on the internet date back to 2005 (and maybe even further). However, after public cloud gained popularity, that’s when Event Sourcing started to become more popular.

Organisations that adopted Cloud-Native approaches redesigned their applications by breaking them down into smaller chunks. This enabled easier scalability, leading to reduced hosting costs.

--

--

Albert Starreveld

Passionate about cloud native software development. Only by sharing knowledge and code we can take software development to the next level!