pattern

Materialized View

A precomputed, stored result of a query, refreshed on a schedule or from a change stream, read instead of recomputing.

cqrsread-modelperformance

The trade is explicit: pay storage and staleness to avoid paying computation on every read. When a dashboard aggregates ten million rows and is viewed a thousand times an hour, precomputing once is four orders of magnitude cheaper.

Architecturally this is the mechanism behind a CQRS read model — the "view" may be a database view, a denormalised table, a search index or a cache, and it may be maintained by a scheduled refresh or incrementally from CDC or an event stream.

The design decisions are refresh strategy and staleness tolerance. Full refresh is simple and expensive; incremental is cheap and requires the update logic to be correct for every event type, including deletes and out-of-order arrivals. State the acceptable staleness explicitly and monitor it, because the failure mode is a view that silently stops updating and keeps serving.