Articles

Unravelling Event Sourcing: Key Definitions

Megan Armstrong  |  22 January 2024

In the ever-evolving landscape of software architecture, one paradigm stands out for its ability to capture the essence of business processes and enable unprecedented insights – Event Sourcing

At the heart of the pattern lie fundamental principles that not only shape the architecture, but redefine the way you'll perceive and interact with data. In this exploration, let's delve into the key definitions that underpin Event Sourcing, shedding light on:

  • Events
  • Event Sourcing databases
  • Streams
  • Projections
  • Subscriptions

Events: The Immutable Truth

At the epicentre of Event Sourcing are events – immutable records of changes in your system that signify facts within a domain. Naming conventions, such as 'InvoiceIssued,' go beyond mere creation and embody the specific business event in the past tense, providing clarity and context. Events, enriched with metadata like timestamps and unique identifiers, become the foundation for deriving insights and making informed decisions.

Events: immutable truth

Event Sourcing Databases: Chronicles of Change

For Event Sourcing success, using the right kind of database to store your events is essential. Traditional databases often struggle to keep up with the volume of events that need to be stored; they simply weren’t designed for the level of data richness of Event Sourcing. 

In contrast, databases like EventStoreDB were designed to maintain high performance whilst recording every change in the system as an append-only log. This chronological log of immutable events, while unalterable themselves, allows for the modification of their effects through subsequent events. This meticulous preservation of the business context ensures a comprehensive audit trail, offering a goldmine of information for analysis, reporting and more.

Event Sourcing database

Streams: Unveiling the Full History

Within the event store, events related to a specific domain object tend to be organized into streams. These streams, identified by a unique ID, offer a comprehensive history of changes. The order of events within a stream, represented by numeric values, facilitates state retrieval and helps manage concurrency issues. Whether short-lived with numerous events or long-lived with fewer, streams play a pivotal role in the efficiency of event storage.

Streams within EventStoreDB

Projections: Crafting Insightful Views

Projections, also known as View Models or Query Models, bridge the gap between write and read models in Event Sourcing. In the read model, projections transform events from the write model into meaningful representations, such as order summaries or financial reports. Temporary and disposable projections contribute to the dynamic nature of Event Sourcing, ensuring they do not replace the immutable truth held within the events.

Projectoins in eventstoredb

Subscriptions: Observability Unleashed

Observability becomes a key advantage of Event Sourcing through subscriptions. Each action triggers an event, allowing for the creation of complex business workflows and distributed systems. The publish/subscribe approach in Event-Driven Architecture enables services to remain decoupled, promoting modularity and scalability. 

In EventStoreDB, this subscription functionality empowers services to listen to events and orchestrate follow-up actions, ushering in a new era of system observability.

Subscriptions in eventstoredb

Learn more about Event Sourcing

Want to deepen your Event Sourcing knowledge? Check out these resources:

Why Event Sourcing? Video 

In this 30 minute video, learn from Developer Advocate Stephen Tung how you can use Event Sourcing to scale and distribute data freely, without forming a tightly coupled mess. 

Beginner's Guide to Event Sourcing

New to Event Sourcing and need an overview of the key concepts? Our Beginner's Guide to Event Sourcing is a great place to start and includes diagrams and code snippets to help explain things.

Introduction to Event Sourcing webinar

This webinar is a practical introduction to Event Sourcing, designed to help you see how to convert business requirements into an event-sourced application. 

Introduction to Event Sourcing in TypeScript and NodeJS webinar

Event Sourcing is perceived as a complex pattern. In this webinar though, Oskar Dudycz will explain that it doesn't have to be true. He'll explain why no data is lost in Event Sourcing, and how it's easier to write code closer to business.

10 problems Event Sourcing can solve for you 

When is Event Sourcing the right architectural style to use? In this blog, we explore some functional and technical challenges it can solve for you. 

Developers tips for Event Sourcing 

Ready to start building your first Event Sourced application? You'll want to check out these tips from our Developers. 


Photo of Megan Armstrong

Megan Armstrong Megan Armstrong is the Content Marketing Manager at Event Store Ltd.