# Patterns
All Patterns notes →12 — CQRS — Command Query Responsibility Segregation
Separate the write model (commands) from the read model (queries). Unlocks independent scaling, optimised projections, and eventual-consistency trade-offs at scale.
patterns distributed-systems data maang-prep
Jun 30, 2026
13 — Event Sourcing
Store state as an immutable, append-only sequence of domain events. Current state is derived by replaying the log. Gives audit trail, temporal queries, and projection flexibility for free.
patterns data distributed-systems maang-prep
Jun 30, 2026
14 — Transactional Outbox
Atomically write to the database and publish a message by using a single local transaction. The outbox table is polled or tailed by CDC to publish reliably. Solves the dual-write problem.
patterns data distributed-systems data-consistency maang-prep
Jun 30, 2026