Published · By Henry Palma
Databricks Data Engineer Associate Exam Prep, Lesson 10: Gold Layer Views, Materialized Views and Streaming Tables
Databricks Data Engineer Associate exam prep: choose a view, materialized view, streaming table or table for gold, and why late updates need a materialized view.
Exam-style question: An analyst dashboard shows daily sales by region from silver.orders. On Nov 4, a late update changes order 5002, a Nov 2 order, from 30.00 to 36.00. Which gold object keeps the Nov 2 total correct without writing your own merge logic: a streaming table or a materialized view? A materialized view. A streaming table processes each input row only once and expects an append-only source, so it does not go back and recompute Nov 2. A materialized view recalculates its results on each refresh to reflect the current state of its sources, so the Nov 2 Texas total moves from 58.50 to 64.50. This post follows Lesson 10 of the Databricks Data Engineer Associate exam prep series, in Section 3 of the August 2026 exam guide, Data Transformation and Modeling (22% of the exam).

The notebook and cheat sheet are in the A10 folder on GitHub. The PDF cheat sheet is in the same folder. This is independent study material, not official Databricks training.
The exam objective
Section 3 of the exam guide lists this objective: understand the difference between, and how to build, Gold layer objects such as materialized views, views, streaming tables, and tables for business intelligence (BI) and analytics teams in Unity Catalog.
In practice, the exam gives you a gold requirement and four objects to choose from. You pick by asking four questions: how fresh must it be (latency), how does it get updated (refresh), can old data change (late data), and what does it cost to keep it current (cost).
Everything here fits in Databricks Free Edition, which runs on serverless compute with Unity Catalog. One documented Free Edition limit matters for this lesson: Lakeflow pipelines are limited to one active pipeline per pipeline type, and every standalone materialized view or streaming table is backed by a pipeline. The view and table results in this post were checked with a local Apache Spark 4.0 run, not on Databricks. Local Spark cannot create materialized views or streaming tables, so those results are marked as expected, based on the Databricks docs.
The four gold objects
| Object | Stores data? | How it stays current | Best for | |---|---|---|---| | View | No | Recomputed every time it is queried | Ad-hoc slices, light logic, saving storage | | Materialized view | Yes | Recomputed on refresh (manual, scheduled, or when the source updates), incrementally when possible | Aggregates and joins for dashboards, sources that get updates and deletes | | Streaming table | Yes | Each new input row is processed once, from an append-only streaming source | Ingestion and low-latency processing of data that only grows | | Table | Yes | Only when you write to it (for example, a CREATE TABLE AS SELECT (CTAS) runs once) | Data you load and own yourself |
These definitions come straight from the Databricks pipeline concepts page. A streaming table: "Each record is processed exactly one time, assuming an append-only source." A materialized view: "Results are recomputed as needed to reflect the current state of the data." A view: "Evaluated on demand, not persisted." CREATE VIEW in the SQL reference describes a view as "a virtual table that has no physical data."
Materialized views and streaming tables are both Unity Catalog managed tables. You can define them in a Lakeflow Spark Declarative Pipeline, or create them standalone with SQL, in which case Databricks creates and manages a serverless pipeline for you.
The scenario: gold for the analyst dashboard
The retail dataset from Lessons 8 and 9 continues. silver.customers has four customers. In this small dataset, a customer's state is the region:
| customerid | customername | state | |---|---|---| | 101 | Ana Lopez | TX | | 102 | Ben Wu | TX | | 103 | Cara Diaz | CO | | 104 | Dev Shah | OK |
silver.orders holds the latest version of each order, the output of the Lesson 9 dedupe. At the end of Nov 3 it looks like this. Order 5002's late update has not arrived yet:
| orderid | customerid | order_date | amount | |---|---|---|---| | 5001 | 101 | 2026-11-02 | 28.50 | | 5002 | 102 | 2026-11-02 | 30.00 | | 5003 | 103 | 2026-11-03 | 13.50 | | 5004 | 101 | 2026-11-03 | 40.00 | | 5005 | 104 | 2026-11-03 | 18.00 |
The analysts ask for two things:
gold.dailysalesby_regionfor the dashboard: order count and total sales per day and region. It is read many times a day, so it should be fast, and it must be right after late updates.- A way to slice orders ad hoc by region, date or amount, always current, without storing another copy.
The gold query
Both requirements start from the same join and aggregate:
SELECT o.order_date,
c.state AS region,
COUNT(*) AS order_count,
SUM(o.amount) AS total_sales
FROM silver.orders o
JOIN silver.customers c ON o.customer_id = c.customer_id
GROUP BY o.order_date, c.state;
Local run on Nov 3 data:
| orderdate | region | ordercount | total_sales | |---|---|---|---| | 2026-11-02 | TX | 2 | 58.50 | | 2026-11-03 | CO | 1 | 13.50 | | 2026-11-03 | OK | 1 | 18.00 | | 2026-11-03 | TX | 1 | 40.00 |
On Nov 4, order 5002 is updated in silver.orders from 30.00 to 36.00. Its order date is still Nov 2, so the correct Nov 2 Texas total becomes 28.50 + 36.00 = 64.50.
Materialized view for the dashboard
CREATE OR REPLACE MATERIALIZED VIEW gold.daily_sales_by_region
SCHEDULE EVERY 1 HOUR
AS SELECT o.order_date,
c.state AS region,
COUNT(*) AS order_count,
SUM(o.amount) AS total_sales
FROM silver.orders o
JOIN silver.customers c ON o.customer_id = c.customer_id
GROUP BY o.order_date, c.state;
Expected result after the first refresh that runs after the Nov 4 update: the Nov 2 TX row shows 64.50. The docs say each time a materialized view is refreshed, its query results are recalculated to reflect changes in upstream datasets, including updates and deletes, not only new rows. The other rows stay the same.
What to know about refresh:
CREATE MATERIALIZED VIEWruns the initial load right away. After that, the view is only as current as its last refresh.- You choose how it refreshes: run
REFRESH MATERIALIZED VIEW gold.dailysalesby_region;yourself, add a schedule such asSCHEDULE EVERY 1 HOURorSCHEDULE CRON, or useTRIGGER ON UPDATEto refresh when the source tables change. - A refresh is incremental when Databricks can do it that way, and a full recompute when it cannot or when a full recompute is cheaper. Incremental refresh needs Delta source tables with row tracking enabled.
- The refresh runs on a serverless pipeline, not on your SQL warehouse, and its cost scales with the data processed. Dashboard reads hit the stored result, so they are fast and cheap.
Regular view for ad-hoc slices
CREATE OR REPLACE VIEW gold.orders_by_region AS
SELECT o.order_id, o.order_date, c.state AS region, o.amount
FROM silver.orders o
JOIN silver.customers c ON o.customer_id = c.customer_id;
SELECT * FROM gold.ordersbyregion WHERE region = 'TX'; ```
Local run, before the update:
| orderid | orderdate | region | amount | |---|---|---|---| | 5001 | 2026-11-02 | TX | 28.50 | | 5002 | 2026-11-02 | TX | 30.00 | | 5004 | 2026-11-03 | TX | 40.00 |
A view stores no data, so there is nothing to refresh. Every query re-runs the join on the current silver.orders. In the local run, after the Nov 4 update, a view with the gold aggregate returned 64.50 for Nov 2 Texas without any refresh step. The trade-off is cost and latency: every dashboard click pays for the full query again. That is fine for small, ad-hoc slices. It is a poor fit for a heavy aggregate that hundreds of people open every morning.
The trap: a streaming table for the daily aggregate
It is tempting to build gold.dailysalesby_region as a streaming table, because streaming sounds fresher. Here is why that breaks:
- A streaming table processes each input row only once and is designed for append-only sources. A row that was already processed is not re-queried with later updates.
- The Nov 4 change to order 5002 is an update to an existing row in
silver.orders, not a new row. The Databricks docs say a streaming read of a Delta table throws an error when the source is modified byUPDATE,DELETE,MERGE INTOor an overwrite. If you setskipChangeCommitsto avoid that error, the change is skipped, not applied. - Either way, the dashboard does not get 64.50 for Nov 2 Texas until someone runs a full refresh, which reprocesses everything.
The docs say this directly: use a materialized view when your query performs aggregations or joins, or when the source data can change due to updates and deletes rather than only growing. The docs also note that streaming table joins do not recompute when dimensions change, while materialized views do.
The same check catches the fourth object. A CTAS table is a one-time snapshot. In the local run, gold.dailysalessnapshot, created on Nov 3 with CTAS, still showed 58.50 for Nov 2 Texas after the update, because nothing rewrote it.
Where a streaming table does fit
Streaming tables are the right choice upstream, where data only grows. New order files land in a volume, and each file should be read exactly once:
CREATE OR REFRESH STREAMING TABLE bronze.orders_raw
AS SELECT *
FROM STREAM read_files('/Volumes/workspace/retail/landing/orders/', format => 'json');
This is the expected pattern from the CREATE STREAMING TABLE reference: STREAM read_files(...) uses Auto Loader to pick up only new files, and each row is appended once. For sources that send updates and deletes, the docs point to change data capture (CDC) with AUTO CDC flows into a streaming table instead of a plain append.
Object-choice checklist
Before you build a gold object, answer four questions:
- Latency. Must every read be fully current? A view is always current. A materialized view is current as of its last refresh. A streaming table has low latency for new rows.
- Refresh. Who updates it? A view needs no refresh. A materialized view refreshes manually, on a schedule, or on source updates. A streaming table processes new input on each update. A table changes only when you write to it.
- Late data. Can old rows change, through updates, deletes or corrections? If yes, and the object aggregates or joins, choose a materialized view. A streaming table processes each row once and expects append-only input.
- Cost. How often is it read? A view pays the full query on every read. A materialized view pays at refresh time, often incrementally, and reads are cheap. In Free Edition, keep in mind the one active pipeline per pipeline type limit.
Rule of thumb for the medallion layers: streaming tables for append-only ingestion into bronze, materialized views for gold aggregates that must stay correct, regular views for light ad-hoc slices.
The reusable snippet, one of each:
-- bronze: append-only files, each row once
CREATE OR REFRESH STREAMING TABLE bronze.orders_raw
AS SELECT * FROM STREAM read_files('/Volumes/workspace/retail/landing/orders/', format => 'json');
-- gold: aggregate that must reflect late updates CREATE OR REPLACE MATERIALIZED VIEW gold.dailysalesbyregion SCHEDULE EVERY 1 HOUR AS SELECT o.orderdate, c.state AS region, COUNT(*) AS ordercount, SUM(o.amount) AS totalsales FROM silver.orders o JOIN silver.customers c ON o.customerid = c.customerid GROUP BY o.order_date, c.state;
-- gold: light ad-hoc slice, always current, no storage CREATE OR REPLACE VIEW gold.ordersbyregion AS SELECT o.orderid, o.orderdate, c.state AS region, o.amount FROM silver.orders o JOIN silver.customers c ON o.customerid = c.customerid; ```
Practice exam-style question
A data engineer must load new JSON order files that land in a Unity Catalog volume every few minutes into a bronze table. Files are never changed after they land, and each file must be processed only once, with low latency. Which object fits best?
- A) A regular view over the volume
- B) A materialized view that refreshes every hour
- C) A streaming table that reads the files with
STREAM read_files - D) A table created once with CREATE TABLE AS SELECT
Answer: C. The source only grows, every row should be handled once, and latency matters, which is exactly what streaming tables are designed for. A stores nothing and would re-read every file on each query. B recomputes on a schedule, which adds latency and is meant for aggregations, joins, and sources that change. D is a one-time snapshot that misses every file that lands later.
Key takeaways
- A view stores no data and is recomputed on every read. A table changes only when you write to it.
- A materialized view stores results and recalculates them on each refresh, so aggregates and joins stay correct after updates and deletes in the source.
- A streaming table processes each input row once and expects an append-only source. Use it for ingestion, not for aggregates that must reflect late updates.
- Choose with the checklist: latency, refresh, late data, cost.
- Memory trick: streaming tables read each row once. Materialized views recompute the answer.
Next lesson (Lesson 11): Data quality checks.
Check your understanding
1. Which gold object stores no data and runs its query every time it is read?
- A) Materialized view
- B) Streaming table
- C) View
- D) Table created with CREATE TABLE AS SELECT
2. A streaming query reads silver.orders with default options. Someone runs an UPDATE on silver.orders. What happens to the stream?
- A) It applies the update to the downstream table
- B) It fails with an error
- C) It silently recomputes all prior results
- D) It converts the target into a materialized view
3. Order 5002 changes from 30.00 to 36.00 in the source. When does gold.dailysalesby_region, a materialized view, show the new Nov 2 total?
- A) Never, materialized views ignore updates
- B) Immediately on the next dashboard query, with no refresh
- C) After its next refresh, manual, scheduled, or triggered by the source update
- D) Only after you drop and recreate it
4. What is the documented Databricks Free Edition limit for Lakeflow pipelines?
- A) No pipelines are allowed
- B) One active pipeline per pipeline type
- C) Five active pipelines per workspace
- D) Pipelines run only on classic compute
5. gold.dailysalessnapshot was created on Nov 3 with CREATE TABLE AS SELECT. On Nov 4, order 5002 is updated from 30.00 to 36.00. What does the snapshot show for Nov 2 Texas?
- A) 58.50
- B) 64.50
- C) 36.00
- D) An error
Answer key
- C. A view is a virtual table with no physical data. It is evaluated on demand.
- B. Structured Streaming accepts only appends from a Delta source and throws an error on updates, deletes, merges or overwrites.
skipChangeCommitsskips the change instead of applying it. - C. A materialized view is current as of its last refresh. Each refresh recalculates results to reflect changes in the source.
- B. Free Edition allows one active pipeline per pipeline type.
- A. CTAS stores the result once. Nothing rewrites it, so it keeps 28.50 + 30.00 = 58.50. The local run confirmed this.