Event-Driven Microservices

CQRS, Event Sourcing, and the Saga pattern, built end to end with Axon Framework and Spring Boot -- learned by assembling one event-driven banking system, piece by piece, not by memorizing pattern names.

Practice interview questions on this topic →
1

The Database-per-Service Problem

beginner

Understand why splitting a monolith's single database into one private database per microservice is a deliberate trade-off, and get familiar with the four-service bank example used as a running case study.

2

Cross-Service Queries & API Composition

beginner

Learn the API composition pattern: how a single component can call multiple microservices concurrently and merge their responses into one answer, plus where this simple approach starts to break down.

3

Data Consistency & Duplication Challenges

beginner

Explore what happens when a single business action must update several services' databases together, why classic distributed transactions struggle here, and how deliberate data duplication can be handled safely.

4

Introduction to CQRS

beginner

Learn the core idea behind CQRS — separating the model and code path used for writing data from the one used for reading it — and understand what it does and does not require.

5

Advantages & Disadvantages of CQRS

beginner

Weigh the genuine benefits of CQRS against its real costs, and learn a practical framework for deciding when the pattern is actually worth adopting.

6

Introduction to Event Sourcing

beginner

Understand event sourcing: storing every change as a permanent event instead of just the latest state, and why this approach pairs so naturally with CQRS.

7

Meet Axon Framework & Axon Server

intermediate

Get introduced to Axon Framework and Axon Server, the toolkit that implements CQRS and event sourcing's plumbing for you, and bring up a local Axon Server instance to connect a Spring Boot service to.

8

Designing Commands, Events & Queries

intermediate

Learn to design the three message types Axon and CQRS are built around — commands, events, and queries — and the naming convention that keeps them unmistakable in a real codebase.

9

Building the Aggregate — the Write Model

intermediate

Build the single most important class in an event-sourced system: the aggregate, which is the one place business rules get enforced and the only thing allowed to decide that a command is valid.

10

Event Sourcing Handlers & Rebuilding State

intermediate

Learn exactly how @EventSourcingHandler methods apply state changes to an aggregate, and the genuinely surprising truth about how Axon rebuilds an aggregate from scratch on every command.

11

Building the Query Side: Projections

intermediate

Build the read side of a CQRS system: a projection that keeps a simple, fast, query-optimized table in sync with events, so reads never need to replay an aggregate.

12

Validating Commands with Interceptors

intermediate

Learn to catch universal, cross-cutting command mistakes before they ever reach an aggregate, using a MessageDispatchInterceptor registered centrally on the command bus.

13

Event Processors: Subscribing vs Tracking

intermediate

Learn how Axon actually delivers stored events to projections and event handlers, and why choosing between a subscribing and a tracking event processor changes a system's latency, scalability, and crash-recovery behavior.

14

Reading Events Directly from the Event Store

intermediate

Learn to browse the raw event store directly instead of trusting projections blindly, and why checking the actual recorded events first is the fastest way to debug a misbehaving aggregate.

15

CQRS Approaches, Rolled Out Across the Bank

intermediate

Compare five real structural flavors of CQRS, understand exactly what problem each one solves over the one before it, and see the same event-sourced aggregate pattern applied consistently across a bank's account, card, and loan services.

16

The Materialized View Pattern

intermediate

Build a dedicated, pre-combined read model that merges events from several independent services into one instantly queryable record, removing the need to compose data across services at request time.

17

The Transactional Outbox Pattern

intermediate

Understand the dual-write problem that threatens any system saving data and publishing a message as two separate steps, and learn how the outbox pattern solves it by writing the message in the same local transaction as the business change.

18

The Saga Pattern — Why We Need It

beginner

Understand why a single distributed transaction across several microservices is impractical, and learn how the saga pattern replaces it with a sequence of local transactions plus compensating actions when something fails partway through.

19

Choreography Saga

intermediate

How to implement a saga with no central coordinator — each service reacts to events from its neighbors and publishes its own event in turn, forming a self-organizing chain across loan approval, funds deposit, and credit profile updates.

20

Orchestration Saga

intermediate

How a single orchestrator component explicitly directs every step of a multi-service business process, holding the full sequence of commands and compensations in one visible place instead of scattering it across independent listeners.

21

Subscription Queries & Event Replay

intermediate

Two capabilities that come almost free from an event-driven architecture already in place: push-based live queries that stream updates to a UI the instant something changes, and the ability to rebuild a read model from absolute scratch by replaying its full event history.

22

Snapshots in Event Sourcing

intermediate

Why replaying an aggregate's entire event history on every single command becomes a real performance problem for long-lived aggregates, and how a periodic snapshot lets Axon skip straight to a recent state and replay only what happened since.

23

Capstone: The Complete Event-Driven Bank

advanced

A synthesis topic that assembles every pattern covered so far — aggregates, event store, projections, materialized views, sagas, the transactional outbox, snapshots, and event replay — into one coherent picture of how a real event-driven system actually works end to end.