DBRaven
Relationship · Complements
Source: Pattern·Target: Pattern

Summary

CQRS separates the write model (normalized, ACID) from the read model; materialized views implement the read model by pre-computing the denormalized view that the query side serves. Each pattern makes the other more operationally tractable.

Evidence

  • ·CQRS read models are structurally equivalent to materialized views: both pre-compute query results
  • ·PostgreSQL MATERIALIZED VIEW is the simplest CQRS read model implementation for relational data
  • ·Event-sourced CQRS uses projection processors to build materialized view equivalents from the event stream
  • ·LinkedIn's Feed architecture uses materialized views (pre-computed fan-out) as the CQRS read model
  • ·CQRS query side with Redis cache over materialized view is a common three-layer read optimization stack

Operational Context

  • ·Materialized view refresh is the CQRS synchronization step: lag between write and view refresh = eventual consistency window
  • ·Multiple materialized views can serve different CQRS query shapes from the same write model
  • ·Materialized view schema changes require view recreation: plan for zero-downtime view rebuilds

Tradeoffs

  • ·Eventual consistency between write model and materialized views is inherent to the pattern
  • ·Multiple views add storage and refresh overhead: each view is a separately maintained copy of data
  • ·Debugging requires understanding which view version a query returned: important for support workflows

Evidence grounding

Grounded, 5 supporting items

The CQRS + materialized view combination is the canonical read model implementation strategy, documented in Fowler's CQRS article, Vernon's IDDD, and production architectures at LinkedIn, Netflix, and Shopify.

cqrs complements materialized_view: DBRaven