Data Modeling medium
What is a 'Materialized View'?
- A A standard, virtual SQL View that provides a logical window into the data without consuming any additional physical storage space on the disk array.
- B A specialized user interface component that dynamically renders the database schema as a visual graph for administrator-level cluster management.
- C A redundant, off-site backup of the entire database state that is strictly synchronized using a high-latency asynchronous mirroring protocol.
- D A physically stored, pre-calculated query result that offers rapid read access but must be refreshed periodically as the underlying base data changes.
Answer: D. A physically stored, pre-calculated query result that offers rapid read access but must be refreshed periodically as the underlying base data changes.
Materialized Views are a powerful caching mechanism for expensive aggregations or complex joins. Unlike standard 'Virtual Views', they take up disk space and provide O(1) or O(log N) read speeds because the result is already calculated. The trade-off is 'Data Freshness': until the view is refreshed, it may serve stale data, and the refresh process can be resource-intensive for very large datasets.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When modeling a Distributed Transaction using the Saga Pattern (Choreography or Orchestration), what type of consistency do you achieve?
- Which practice prevents SQL Injection attacks?
- What is 'Bi-Temporal' data modeling (e.g., in SQL:2011 standard)?
- Adding an Index to a database column generally improves Read performance. What is the negative trade-off?
- Log Systems Merge (LSM) Trees (used in RocksDB, Cassandra) optimize for fast writes. What is their primary downside regarding Disk I/O?
- What is the primary objective of normalizing a relational database schema (e.g., to 3NF)?