Concepts
The ideas behind Event Sourcing, CQRS, and Domain-Driven Design, explained without any product, along the five stages of the lifecycle.
Domain-driven design (DDD) is an approach to software design that puts the business domain at the center of the system.
Event-StormingThis guide introduces Event-Storming as a collaborative modeling technique for discovering and designing events in event-sourced systems. It explains the purpose of Event-Storming, how it fits into the software development process, and how it helps identify meaningful domain events that form the foundation of event-sourced systems.
Modeling EventsThis guide explains how to model events effectively in an event-sourced system. It focuses on naming, structure, semantics, and best practices for designing events that are expressive, stable, and aligned with domain behavior. Good event modeling is essential for building systems that are maintainable, auditable, and adaptable over time.
Designing AggregatesThis guide explains how to design aggregates in event-sourced systems. It covers the conceptual role of aggregates, how they relate to subjects and events, and how to apply consistent modeling principles that ensure correctness, isolation, and long-term maintainability.
Dynamic Consistency Boundaries (DCBs)Event-sourced systems often use aggregates to define where consistency must be preserved. Aggregates help prevent conflicting updates and capture business invariants. But they also introduce rigidity: Once an aggregate boundary is defined, it becomes difficult to change – even when the domain evolves or the original design turns out to be insufficient.
This guide introduces the concept of event sourcing and explains how it differs from traditional approaches to storing application state. You'll learn what event sourcing is, when and why it can be useful, how it compares to CRUD-based systems, and in which kinds of domains it can be applied. The goal is to provide an accessible and practical introduction that helps you assess whether event sourcing might be a good fit for your own projects.
What is CQRS?CQRS stands for Command Query Responsibility Segregation. The idea is simple: Separate the part of your system that changes data from the part that reads it.
Use CasesThis guide helps you understand where event sourcing can be most effectively applied. While the concept of event sourcing offers powerful capabilities, it is not a one-size-fits-all solution.
Designing Read ModelsThis guide explores how to design effective, purpose-driven read models in an event-sourced system. It covers the role of read models in an event-sourced architecture, discusses modeling strategies and trade-offs, and explains how to align projections with use cases. Read models are not simply a reflection of stored events – they are tailored, context-specific representations of current state.
Read-Model Consistency and LagThis guide explains how to manage the consistency and freshness of read models in event-sourced systems. While event sourcing allows for clean separation between write operations and derived state, it also introduces the challenge of keeping projections in sync with the event log – especially in distributed environments where reads and writes are decoupled.
Eventual Consistency in PracticeThis guide explains what eventual consistency means in the context of event-sourced systems and how to design applications that behave correctly even when data is temporarily out of sync. It explores where consistency gaps can occur, how they affect the user experience, and what strategies can be applied to deal with them effectively.
Snapshots and PerformanceThis guide explains how to use snapshots in event-sourced systems to improve performance and reduce overhead during replay. While the event store treats all events as immutable and equally important, applications can introduce snapshots as a way to avoid rebuilding state from the beginning of a stream every time. This is especially useful for aggregates with long histories or systems with high throughput.
Optimizing Event ReplaysThis guide explains how to optimize the performance and structure of event replays in event-sourced systems. Replaying events is a fundamental capability of event-sourced architectures. It allows you to rebuild state, regenerate read models, migrate data structures, or recover from errors. While the ability to replay is always available, doing so efficiently – especially at scale – requires careful design.
Patterns for Temporal QueriesThis guide explores patterns for performing time-based queries in event-sourced systems. Temporal queries are essential for understanding how the system has evolved, analyzing trends, answering retrospective questions, and reconstructing domain state at specific points in time.
Versioning EventsThis guide explains how to evolve event types and structures in a safe, predictable, and maintainable way. It focuses on practical strategies for versioning events and shows how to preserve compatibility without losing semantic clarity. You'll learn when to introduce new event types, how to handle schema changes, and what to avoid when working with immutable historical data.
GDPR ComplianceThis guide explains how to assess and achieve GDPR compliance in event-sourced systems. It addresses the challenges of storing personal data in immutable event streams, outlines the implications for the right to erasure and other GDPR provisions, and offers practical recommendations for designing compliant systems.
Common MistakesThis guide describes common mistakes and misunderstandings that arise when working with the event sourcing model. Each section highlights a specific problem, explains its background, and offers guidance on how to avoid or resolve it. The goal is to make it easier to diagnose unexpected behavior and to apply event sourcing concepts correctly in practice.
This guide explains how to build event handlers in event-sourced systems. It focuses on how applications can observe events, react to them reliably, and maintain processing state across interruptions. When the event store itself does not include a handler mechanism and simply provides a way to observe event streams, it is the responsibility of the application to define, execute, and coordinate event handling logic.
Building Event-Driven ApplicationsThis guide explains how to design and implement event-driven applications on top of an event store. It covers the core principles of event-driven architecture, the role of the event store as a durable event source, and strategies for integrating event handling, processing, and downstream systems. While the event store does not define how applications should be structured, it provides a solid foundation for building systems that react to change rather than poll for it.
Testing Event-Sourced SystemsThis guide explains how to test event-sourced systems. It covers unit tests for application logic, integration tests involving the event store, and practical strategies for managing test data and verifying event-driven behavior. When the event store is focused solely on storing and retrieving events, testing primarily concerns the application layer – and how it interacts with the event store.