materialised view
A stored table of results computed from other data, kept so queries do not have to recompute them.
In more detail
It must be refreshed or rebuilt when the source data changes. Because it is derived, it can always be thrown away and rebuilt from the source.
Examples
The course folds a Kafka stream of orders into totals per customer.PostgreSQL: CREATE MATERIALIZED VIEW ..., then REFRESH MATERIALIZED VIEW to update it.SQLite has no materialised views; a table kept up to date by application code plays the same role.Related terms
- fold — Combining a sequence of records one by one into a single result, such as the latest value or a running total per key.
- stream-table duality — The idea that a stream of changes and a table of current values are two views of the same data: fold the stream to get the table, and record the table's changes to get the stream.
- single source of truth — The one agreed place where a piece of information is maintained, so every copy is generated from it rather than edited by hand.
- state store — Local storage where a stream processing application keeps the current results of its computations.
- denormalisation — Deliberately storing a copy of data in a second place, usually to make reads faster by avoiding a join.
- PostgreSQL — A widely used open source relational database server with strict typing, rich data types and extensions.
Taught in
- Two Copies Of One Service — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Materialised Views From A Stream — Apache Kafka & Event Streaming
- When To Denormalise On Purpose — PostgreSQL, Indexing & Relational Data Modeling