Materialized Views
Precomputed query results, refreshed incrementally or in full.
4 to work through
-
intermediate
A discussion platform precomputes ranked feeds as materialised views. What does this buy, and what are the failure modes?
2 min answer -
advanced
A read-heavy query is too expensive to compute on demand. Compare a database materialized view, an application-maintained read model and a stream-processed view, and describe how each handles staleness and rebuild.
2 min answer -
advanced
A ride-hailing platform maintains a materialised view of driver availability by geographic cell. What are the design decisions, and what breaks?
2 min answer -
advanced
Your social feed precomputes each user's timeline when someone they follow posts. An account with 40 million followers joins. What breaks and how do you fix it?
2 min answer
4 terms in this topic
Approximate-Then-Commit
Selecting candidates from a deliberately stale projection and committing with a conditional write against the authoritative record - which buys cheap…
patternMaterialised View Pattern
Maintaining a pre-computed, query-shaped copy of data so reads are cheap, at the cost of write amplification and staleness.
case-studyTwitter Timelines: Fan-Out on Write, Except for Celebrities
Precomputing every user's timeline at write time is fast to read and impossible for accounts with millions of followers, so the two approaches are co…
conceptView Staleness Window
The maximum age of data in a precomputed view, which must be an explicit, monitored contract rather than an incidental property.
Neighbouring topics
Architecture Patterns
General material on architectural patterns and their trade-offs.
Layered Architecture
The default shape, its clarity, and where a technical partition fails.
Event-Driven Architecture
Publishing facts, and trading comprehensibility for decoupling.
Pipes and Filters
Independent transformation steps composed into a pipeline.
Publish/Subscribe
Broadcast to every subscriber, as distinct from work distribution.
Competing Consumers
Scaling throughput with instances, at the cost of ordering.
Saga
Local transactions with compensating actions across services.
CQRS
Separate models for writing and reading, each optimised for its job.
Event Sourcing
The event log as the system of record, with state as a projection.
Outbox
Making the event atomic with the business write it describes.
Strangler Fig
Incremental replacement behind a routing facade.
Anti-Corruption Layer
Translating a foreign model at the boundary so it does not leak in.
Sidecar & Ambassador
Cross-cutting behaviour in a co-deployed process.
Service Mesh
Sidecars applied estate-wide, and the scale at which that pays.
API Gateway
A single entry point for policy, routing and protocol translation.
Backend for Frontend
A narrow backend per client experience, owned by that client's team.
Cell-Based Architecture
Complete isolated copies each serving a subset of customers.
Sharding Patterns
Directory versus embedded keys, logical shards and rebalancing.
Orchestration vs Choreography
A coordinator that knows the flow, or services that react to events.