intermediateThe Materialized View Pattern

How does a materialized view differ from an ordinary CQRS projection?

An ordinary CQRS projection keeps one service's own read model in sync with events published by that same service's own aggregate — an account service's balance view listening only to its own account events, for example. A materialized view deliberately combines events published by several different aggregates across several different microservices into one unified record. The distinguishing feature isn't the mechanism, since both use event handlers to update a read model, it's the scope: a projection answers a question one service can answer alone, while a materialized view answers a question that genuinely spans service boundaries, such as a customer profile screen needing data from customer, account, card, and loan services at once.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Does enabling snapshots change what data is stored as the permanent source of truth?← Back to all Event-Driven Microservices questions