CQRS Fundamentals & Read Model Design
- CQRS core concept: separate command and query responsibilities
- Command model: aggregates, command handlers, invariant enforcement
- Query model: optimized read projections — denormalized, materialized
- Synchronization patterns: synchronous vs eventual consistency between models
- When CQRS pays off — and when it's over-engineering
- Read model storage: relational projections, Elasticsearch, Redis
- Projection rebuilding: replaying events to regenerate read models
- CQRS with Spring Boot: command bus, query bus, event bus patterns
- Axon Framework: built-in CQRS and Event Sourcing support
- Testing CQRS: command handling tests, projection tests
Event Sourcing in Depth
- Event Sourcing fundamentals: append-only event store, no mutable state
- Event store options: EventStoreDB, Axon Server, PostgreSQL-based
- Aggregate design with Event Sourcing: apply() methods, rehydration from events
- Snapshots: reducing rehydration time for high-event-count aggregates
- Event versioning: upcasting old events to new schemas
- Temporal queries: reconstructing state at any point in time
- Sagas with Event Sourcing: long-running processes using event-driven state machines
- CQRS + Event Sourcing together: the full pattern, end to end
- Operational concerns: storage growth, event retention, GDPR and right-to-erasure
- When NOT to use Event Sourcing: the honest trade-off analysis
Developers and architects who understand CQRS and Event Sourcing deeply enough to apply them where they genuinely help — and recognize when simpler patterns suffice.
- Implement CQRS with separate command and query models and understand consistency trade-offs
- Design event-sourced aggregates with correct apply/rehydration logic
- Choose an event store and configure snapshot strategies for aggregate rehydration
- Apply upcasting for backward-compatible event schema evolution
Book the CQRS & Event Sourcing training
Best delivered after foundational DDD knowledge. Can be combined with the Domain-Driven Design training for a complete 3-day architectural patterns track.
Get in touch