Summary
CQRS and Event Sourcing offer different ways of designing and building software systems. They can help address certain modelling and architectural challenges, but they also introduce new questions and trade-offs.
In this workshop, we'll explore the principles behind both patterns, how they relate to each other, and what applying them means in practice.
We'll start with CQRS independently of Event Sourcing, gradually introduce event-sourced aggregates and projections, and explore what happens when business processes become more complex.
Rather than focusing on the mechanics of implementing everything from scratch, we'll use a combination of explanations, short exercises, group discussions, and AI-assisted coding assignments.
In between the sesssions, you'll work on a small application that evolves as new concepts are introduced. You'll have opportunities to compare different approaches, discuss design decisions, and learn from each other's experiences.
The emphasis is on understanding the principles and making informed design choices, rather than mastering a particular framework or building a production-ready system.
For who?
This workshop is intended for software developers and architects who want to gain a practical understanding of CQRS and Event Sourcing.
You don't need prior experience with either pattern, but you should be familiar with object-oriented software development and basic software design concepts.
Some programming experience is expected, as the workshop includes take-home implementation exercises. However, writing code is not the primary focus of the interactive sessions.
What you'll learn
During this workshop, we'll explore how to:
- Understand CQRS and Event Sourcing as separate but complementary patterns.
- Distinguish commands, queries, and events, and understand their respective responsibilities.
- Separate command and query models to address different requirements.
- Model domain behaviour using event-sourced aggregates.
- Reconstruct state from events and understand the role of consistency and concurrency.
- Build projections that turn events into useful query models.
- Reason about aggregate boundaries and processes that span multiple aggregates.
- Recognise some of the challenges involved in evolving and operating event-sourced systems.
- Evaluate when CQRS or Event Sourcing might be appropriate, and when simpler approaches may be preferable.
Schedule
The workshop consists of five interactive sessions and four take-home assignments.
Each session combines explanations with short practical exercises and discussions. Between sessions, you'll apply the concepts through AI-assisted implementation assignments.
We'll revisit the assignments in subsequent sessions to compare approaches, discuss questions, and reflect on the design decisions made.
Session 1 - CQRS Fundamentals
We'll explore Command Query Responsibility Segregation, starting with the distinction between commands and queries.
Take-home assignment: Apply CQRS to a small application using traditional state-based persistence.
Session 2 - Event Sourcing & Command Model
We'll introduce Event Sourcing and explore what it means to capture changes as domain events instead of storing only the current state.
We'll look at event streams, event-sourced aggregates, state reconstruction, business invariants, and concurrency.
Take-home assignment: Introduce Event Sourcing into the application and implement an event-sourced aggregate.
Session 3 - Projections & Query Models
We'll explore how events can be used to build query models tailored to different information needs.
We'll introduce projections, discuss eventual consistency, and examine how projections can be rebuilt from stored events.
Take-home assignment: Build projections that create and maintain query models from event streams.
Session 4 - Processes
We'll look at what happens when business requirements extend beyond a single aggregate.
We'll discuss consistency boundaries, coordination between aggregates, and approaches such as process managers.
Take-home assignment: Extend the application with a business process involving multiple aggregates.
Session 5 - Evolution, Reliability & Operations
We'll take a broader look at some of the challenges that arise as event-sourced systems evolve: event versioning, failure handling, idempotency, privacy, performance, and operational considerations.
We'll introduce relevant concerns and possible approaches, rather than provide complete solutions to every challenge.
Learning through practice
Practical exercises are an important part of this workshop.
During the interactive sessions, we'll work through short exercises and discuss modelling and architectural questions together.
Between sessions, you'll work independently on a small application, using an AI coding assistant to help implement the concepts we've covered.
The take-home assignments are designed to build upon each other, so you'll gradually extend and adapt your application throughout the workshop.
You won't be expected to implement everything by hand. Instead, we encourage you to use AI to support development, while taking responsibility for understanding and evaluating the resulting design.
The exercises will use one or more commonly used programming languages, with technical setup instructions provided before the workshop.
Completing the assignments is strongly recommended, as reviewing and discussing the different solutions is an important part of the learning experience. Please reserve time for these assignments.
Practical information
Format: Five interactive online sessions. Assignments: Four take-home exercises between sessions (2-4h each) Approach: Explanations, short exercises, group discussions, and AI-assisted implementation. Level: Intermediate (no prior CQRS or Event Sourcing experience required) Prerequisites: Familiarity with software development and basic software design concepts. Tools: A development environment and access to an AI coding assistant. Technical requirements will be communicated in advance.