Comparison
CQRSvsMaterialised view
CQRS
you stop trying to serve reads and writes from the same model and build a separate read model shaped for the queries.
Splitting the write model from one or more read models, so each is shaped for its own job rather than compromising. It is what lets a normalised write side coexist with a denormalised, query-shaped read side. The read model is now asynchronously updated, so the UI must tolerate a user not immediately seeing their own write.
Full entry →Materialised view
you precompute the expensive aggregate into a real table and refresh it on a schedule instead of recomputing it per request.
A stored, physically persisted result of a query, refreshed either on demand or incrementally. It converts a slow read into a fast one and moves the cost to refresh time. Refresh is the whole design problem: a full refresh locks or duplicates the data, and an incremental one needs you to know exactly which inputs changed.
Full entry →