advanced~3h

The Materialized View Pattern

CQRS's query side has been described conceptually in earlier modules — this is where it actually gets built: a denormalized table, kept continuously current by a projector, purpose-shaped for exactly the query the UI needs.

Learning objectives

  • Define a materialized view as a denormalized, purpose-built read model derived from an event stream
  • Design a projector that builds and maintains an OrderSummary view from Order aggregate events
  • Handle eventual consistency in the UI honestly rather than hiding or ignoring the read/write gap
  • Evolve a materialized view's shape over time without being constrained by the write-side aggregate's structure
  • Recognize when one materialized view isn't enough and multiple views of the same events are warranted

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

The Materialized View Pattern

Next Step

Continue to Event Replay and Subscription Queries →← Back to all Spring Cloud chapters