Module 7
Patterns for managing data in distributed systems: CQRS, event sourcing, materialized views, sagas, and strategies for maintaining consistency across services.
Separate your read and write models: when CQRS helps, implementation strategies, eventual consistency between models, and common pitfalls.
Store every state change as an immutable event: event stores, projections, snapshots, replay, and the relationship between event sourcing and CQRS.
Pre-compute and cache query results as materialized views: build strategies, refresh mechanisms, consistency trade-offs, and use cases.
Each microservice owns its data: schema isolation, data duplication trade-offs, cross-service queries, and migration strategies.
Manage distributed transactions without 2PC: choreography-based sagas with events vs orchestration-based sagas with a coordinator. Compensation logic and failure handling.
Guarantee message delivery alongside database writes: the outbox table, polling publisher, log-tailing approach, and exactly-once semantics.
Capture database changes as events: Debezium, log-based CDC, trigger-based CDC, and using CDC to keep materialized views and search indexes in sync.
Use the best database for each use case within the same system: strategies for managing multiple data stores, data synchronization, and operational complexity.