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 →The Database-per-Service Problem
beginnerUnderstand 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.
Cross-Service Queries & API Composition
beginnerLearn 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.
Data Consistency & Duplication Challenges
beginnerExplore 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.
Introduction to CQRS
beginnerLearn 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.
Advantages & Disadvantages of CQRS
beginnerWeigh the genuine benefits of CQRS against its real costs, and learn a practical framework for deciding when the pattern is actually worth adopting.
Introduction to Event Sourcing
beginnerUnderstand event sourcing: storing every change as a permanent event instead of just the latest state, and why this approach pairs so naturally with CQRS.
Meet Axon Framework & Axon Server
intermediateGet 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.
Designing Commands, Events & Queries
intermediateLearn 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.
Building the Aggregate — the Write Model
intermediateBuild 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.
Event Sourcing Handlers & Rebuilding State
intermediateLearn 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.
Building the Query Side: Projections
intermediateBuild 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.
Validating Commands with Interceptors
intermediateLearn to catch universal, cross-cutting command mistakes before they ever reach an aggregate, using a MessageDispatchInterceptor registered centrally on the command bus.
Event Processors: Subscribing vs Tracking
intermediateLearn 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.
Reading Events Directly from the Event Store
intermediateLearn 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.
CQRS Approaches, Rolled Out Across the Bank
intermediateCompare 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.
The Materialized View Pattern
intermediateBuild 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.
The Transactional Outbox Pattern
intermediateUnderstand 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.
The Saga Pattern — Why We Need It
beginnerUnderstand 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.
Choreography Saga
intermediateHow 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.
Orchestration Saga
intermediateHow 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.
Subscription Queries & Event Replay
intermediateTwo 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.
Snapshots in Event Sourcing
intermediateWhy 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.
Capstone: The Complete Event-Driven Bank
advancedA 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.