CertSafari
    Databricks Certified Data Engineer Professional - October 9 onwards· Lessons

    Domain 1 · Lesson 6/45

    Streaming tables vs materialized views in Lakeflow pipelines

    Choose between a streaming table and a materialized view for a given latency, cost, and refresh requirement.

    15 min read
    1.92% of exam
    7 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Explain how a streaming table processes each input row once and why its existing rows stay as they are when the query or a joined dimension changes
    • Explain how a materialized view stays correct by choosing between an incremental refresh and a full recompute, and what each one costs
    • Choose a streaming table or a materialized view for a dataset based on how mutable its source is, the latency it needs, the cost of a full recompute and how often it refreshes

    Key concept

    Process once vs. always correct — A streaming table reads each new source row once, appends the result and never goes back to it, which makes it cheap and fast. A materialized view always returns the same result as running its query as a batch over the current source data, and it pays to recompute whatever is needed to stay correct.

    1.Streaming tables: each row once, never revisited

    A Lakeflow pipeline can write its results to two kinds of dataset: streaming tables and materialized views. Choose the wrong one and you get one of two problems. A dashboard quietly shows numbers built from outdated data, or a pipeline recomputes months of history every time it runs. Both kinds are Delta tables that one pipeline defines and keeps up to date. The difference is how each one treats data it has already processed.

    A streaming table is a Delta table that processes each input row exactly once. On each update, its flows read only the new data from a streaming source and append the results. That fits ingestion, where data keeps arriving and you need to capture every record without reprocessing the ones you already have. Supported sources include cloud object storage through Auto Loader and message buses such as Apache Kafka, Azure Event Hubs and Google Pub/Sub. The Auto Loader setup is covered in building streaming pipelines with Auto Loader. In SQL, you read the source with the STREAM keyword, and a standalone streaming table can carry its own refresh schedule.

    A standalone streaming table that uses Auto Loader (read_files) to ingest JSON files from a volume every hoursql
    CREATE OR REFRESH STREAMING TABLE sales
      SCHEDULE EVERY 1 hour
      AS SELECT * FROM STREAM read_files(
        "/Volumes/my_catalog/my_schema/my_volume/path/to/data",
        format => "json"
      );

    Checkpoints are what make the process-once guarantee work. A streaming table uses checkpoint management to remember how far each flow has read. Each refresh then picks up only the records that arrived since the last update, which is why streaming tables suit low-latency work and large volumes of append-only data. If you turned the checkpoints off, the table would lose that guarantee rather than gain anything. For the lowest latency, a pipeline can run in real-time mode, which delivers sub-second end-to-end latency.

    Because rows are never revisited, a streaming table does not recompute when something upstream changes. If you edit the query, only rows processed after the edit follow the new logic. You need to keep track of every earlier version of the query that has run on the table. Joins behave the same way. When a streaming table joins a stream to a dimension table and a dimension row later changes, the rows that were already written keep the old dimension values. That can be acceptable when you want results fast and can tolerate some being wrong. It is not acceptable when the result must always be correct.

    A full refresh is how you bring old rows up to date. It truncates the table, clears the flow checkpoints and reprocesses every record from the source. If the source has already discarded data, those records are lost. A Kafka topic past its retention window is the usual example. A second option, resetting the streaming flow checkpoints, reprocesses the source through the selected flows but keeps the data already in the table.

    Streaming tables also expect bounded state. The stream must either end naturally, like a fixed directory of files, or be bounded by a watermark. A watermark tells the engine how long to wait for late events before it treats a time window as complete. An unbounded stream without a watermark can make the pipeline fail from memory pressure. A watermark limits how much state the stream keeps. It does not let an append-only table absorb updates or deletes from a changing table. How watermarks work is covered in watermarks and stateful streaming. When the source itself updates or deletes rows, the tool is AUTO CDC, which applies those changes to a streaming table instead of appending them. See AUTO CDC and SCD types.

    Checkpoint 1 of 7· Fill the gap

    This standalone streaming table ingests JSON files with Auto Loader. Which keyword makes the query read its source with streaming semantics, so each file is processed only once?

    CREATE OR REFRESH STREAMING TABLE sales
      SCHEDULE EVERY 1 hour
      AS SELECT * FROM  ?  read_files(
        "/Volumes/my_catalog/my_schema/my_volume/path/to/data",
        format => "json"
      );

    Checkpoint 2 of 7· Check yourself

    A streaming table joins an orders stream to a customers dimension table. After many orders are written, a customer's region changes in the dimension table. What does the next default refresh do to the orders already in the streaming table?

    Sources12

    2.Materialized views: precomputed results that stay correct

    A materialized view stores the result of a query and keeps it in step with its sources. A standard view runs its query every time someone reads it. A materialized view caches the result and refreshes it on a schedule or when the pipeline is triggered, so reads are fast. You write an ordinary batch query with joins, aggregates and filters. Databricks tracks changes in the upstream data and decides how to bring the stored result up to date.

    A materialized view that joins two tables and keeps the result up to datesql
    CREATE OR REPLACE MATERIALIZED VIEW regional_sales
      AS SELECT *
      FROM partners
        INNER JOIN sales USING (partner_id);

    Correctness is the guarantee. A refreshed materialized view gives the same result as running its query as a batch over all current source data. That holds for late data, out-of-order data, and updates and deletes in any input. If a row in partners changes, the joined result changes with it. This is exactly what a streaming table join does not do.

    How much a refresh costs depends on how much Databricks has to recompute. A default refresh tries an incremental refresh first, which finds what changed since the last update and merges only the affected results. In one example, 200 new customers in three countries and their transactions arrive. An incremental refresh of a sales report grouped by country rewrites three rows instead of the whole report. Databricks runs a cost analysis and uses either the incremental refresh or a full recompute, whichever is cheaper. Both produce the same output. You can set a refresh policy that makes the refresh fail instead of falling back to a full recompute.

    How each refresh type behaves for each dataset type
    Update typeMaterialized viewStreaming table
    Refresh (default)Updates results to match the current output of the query. Incremental when that is cheaper.Processes only new records and appends them, using the current definition
    Full refreshRecomputes the whole result. The data is identical to a default refresh.Truncates the table, clears flow checkpoints and reprocesses every source record
    Reset streaming flow checkpointsNot applicableClears checkpoints and reprocesses the source, keeping existing table data

    Being correct has costs. Some changes to the inputs force a full recompute, which can be expensive, and some computations can't be done incrementally at all. Materialized views are also not built for low latency: a refresh takes seconds or minutes, not milliseconds. Finally, if a UDF called by the view changes behaviour in a way Databricks doesn't detect, such as after a library upgrade, you have to run the full refresh yourself.

    Checkpoint 3 of 7· Check yourself

    Your team's Lakeflow pipeline runs on classic compute. It defines a materialized view that sums a very large transactions table by country, and each day only a few thousand new rows arrive. What does each default refresh of this view do?

    Checkpoint 4 of 7· Exam question

    A daily_region_revenue dataset aggregates SUM(order_amount) by region and joins against a customers dimension table that receives updates and deletes throughout the day. Business analysts query this dataset directly for dashboards and expect the aggregate to reflect the latest state of customers, but do not need sub-second freshness. Which approach correctly defines this dataset in Lakeflow Spark Declarative Pipelines? CREATE OR REFRESH ??? daily_region_revenue AS SELECT c.region, SUM(o.order_amount) AS total_revenue FROM orders o JOIN customers c ON o.customer_id = c.customer_id GROUP BY c.region;

    Sources314

    3.Choosing between a streaming table and a materialized view

    Start from the source: is it append-only, or do rows change? If new rows only ever arrive, as with files from Auto Loader, Kafka events or clickstream logs, a streaming table processes each one once, with low latency and low cost per update. If the result depends on rows that are updated or deleted, or on joins and aggregates over the full current state of several tables, choose a materialized view. Only it recomputes so the output reflects that state.

    Deciding factors and which dataset type each one favors
    RequirementStreaming tableMaterialized view
    Source shapeAppend-only. Each record processed once.Joins and aggregates over data that is updated or deleted
    Correctness after upstream changesExisting rows are not recomputedAlways matches a batch run of the query
    LatencyLow, down to sub-second in real-time modeSeconds or minutes per refresh
    Cost of refreshOnly new recordsIncremental where possible, otherwise a full recompute
    Source keeps no history (Kafka) or old data is deletedCorrect choiceAvoid: a full refresh would lose records

    Cost points the same way from both directions. A materialized view's sources must be able to handle a full refresh, because one can always happen. When a full recompute would cost too much, for example over a very large table, use a streaming table to get exactly-once processing. Never define a materialized view over a source whose records must be processed only once. That includes Kafka topics that don't keep history, Auto Loader ingestion, and tables where you delete or archive old partitions but still need their information downstream. A full refresh over such a source would reflect only what is left in it.

    When many consumers read the same result, that favors a materialized view. Dashboards, reports and several teams running the same expensive join or aggregate each pay its cost on every query against a standard view. A materialized view computes the result once per refresh and serves the stored copy, which lowers both query latency and compute. Designing dimensional models around this is covered in materialized views for dimensional models.

    The medallion architecture puts these rules into practice. Bronze ingestion is mostly stateless appends of large volumes, so it suits streaming tables. Silver transformations involve joins, aggregations and deduplication. They default to materialized views with incremental refresh, and use streaming only where speed matters much more than accurate results. Gold aggregations are usually smaller and stateful, and belong in materialized views.

    How often a dataset refreshes is a separate setting from which type it is. Pipeline mode doesn't change the dataset type: streaming tables and materialized views both run in triggered or continuous mode. Triggered mode processes the data available at the start of the update and then stops. It suits refreshes every 10 minutes, hourly or daily, and is cheaper because compute runs only for the update. Continuous mode suits freshness between about 10 seconds and a few minutes, but it needs an always-running cluster. Standalone streaming tables and materialized views always refresh in triggered mode. Running a materialized view continuously does not turn it into a low-latency table, and a schedule does not make a streaming table recompute its old rows.

    Checkpoint 5 of 7· Match them up

    A team is designing a Lakeflow pipeline and has four requirements. Match each requirement to the dataset type or pipeline mode that meets it.

    Tap a term, then the definition that fits it.

    Checkpoint 6 of 7· Exam question

    A Lakeflow Spark Declarative Pipelines pipeline uses Auto Loader (cloudFiles) to land append-only clickstream JSON files. Downstream consumers need every event processed exactly once, with the lowest possible latency and compute cost per micro-batch. Which table type should the engineer define for this dataset? from pyspark import pipelines as dp @dp.table def clicks_raw(): return (spark.readStream .format("cloudFiles") .option("cloudFiles.format", "json") .load("/Volumes/raw/clickstream/"))

    Checkpoint 7 of 7· Exam question

    Which of the following are valid, technically accurate reasons for a data engineer to choose a materialized view instead of a streaming table for a given dataset in a Lakeflow Spark Declarative Pipelines pipeline? (Select 3)(Select 3)

    0 of 3 selected

    Sources4567

    Sources

    (7)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Each input row is handled only once, which models the vast majority of ingestion workloads”
      ↩︎ Streaming tables: each row once, never revisited
      “Streaming tables use checkpoint management, which makes them well-suited for low-latency streaming.”
      ↩︎ Streaming tables: each row once, never revisited
      “An unbounded stream that does not have a watermark can cause a pipeline to fail due to memory pressure.”
      ↩︎ Streaming tables: each row once, never revisited
      “To stream source data that changes over time (for example, records that are updated or deleted at the source), use AUTO CDC”
      ↩︎ Streaming tables: each row once, never revisited
      “Materialized views are always correct because they automatically recompute joins when dimensions change.”
      ↩︎ Materialized views: precomputed results that stay correct
      “Joins in streaming tables do not recompute when dimensions change.”
      ↩︎ Exam trap 1
      “A row that has already been appended to a streaming table will not be re-queried with later updates to the pipeline.”
      ↩︎ Prediction
      “Joins in streaming tables do not recompute when dimensions change.”
      ↩︎ Checkpoint
    2. 2.
      “A full refresh of a streaming table can drop records if the source no longer retains the original data”
      ↩︎ Streaming tables: each row once, never revisited
      “a default refresh of a streaming table trades data correctness for lower time and resource costs.”
      ↩︎ Key concept
      “On classic compute, a materialized view is always fully recomputed.”
      ↩︎ Exam trap 2
    3. 3.
      “Unlike standard views, which recompute results on every query, materialized views cache the results and refresh them on a specified interval.”
      ↩︎ Materialized views: precomputed results that stay correct
      “The latency of updating a materialized view is in the seconds or minutes, not milliseconds.”
      ↩︎ Materialized views: precomputed results that stay correct
    4. 4.
      “Databricks runs a cost analysis to choose the cheaper option between an incremental refresh and a full recompute.”
      ↩︎ Materialized views: precomputed results that stay correct
      “For queries where a full refresh would be cost-prohibitive, use streaming tables to guarantee exactly-once processing.”
      ↩︎ Choosing between a streaming table and a materialized view
      “Do not define a materialized view against a data source if records should only be processed once.”
      ↩︎ Exam trap 3
      “Only materialized views updated using serverless pipelines can use incremental refresh. Materialized views that do not use serverless pipelines are always fully recomputed.”
      ↩︎ Checkpoint
      “Do not define a materialized view against a data source if records should only be processed once. Instead, use streaming tables.”
      ↩︎ Checkpoint
    5. 5.
      “By precomputing expensive or frequently used queries, Materialized views lower query latency and resource consumption.”
      ↩︎ Choosing between a streaming table and a materialized view
    6. 6.
    7. 7.
      “Continuous pipelines require an always-running cluster, which is more expensive but reduces processing latency.”
      ↩︎ Choosing between a streaming table and a materialized view
      “Pipeline mode is independent of the type of table being computed.”
      ↩︎ Exam trap 4

    Spotted a mistake, or was something unclear? Tell us.