===== Write ===== .. meta:: :description: Choose the right Lakehouse Plumber write target β€” a standard streaming table, CDC or snapshot CDC for dimensions, a materialized view for aggregates, or an external sink. A ``write`` action persists a flow into a target. The write **mode** you choose depends on how the data changes and what shape you need downstream. .. list-table:: :header-rows: 1 :widths: 30 40 30 * - You need to… - Reach for - Guide * - Append or upsert rows into a table as they arrive - A **standard streaming table** - :doc:`streaming-table-standard` * - Track row changes over time (a slowly changing dimension) from a change feed - **CDC** into a streaming table (``mode: cdc``) - :doc:`streaming-table-cdc` * - Build a dimension from periodic full **snapshots** instead of a change feed - **Snapshot CDC** (``mode: snapshot_cdc``) - :doc:`streaming-table-snapshot-cdc` * - Keep a current-state table from **partial snapshots** (replace all rows for each grouping key) - **Replace** (``mode: replace``) - :doc:`streaming-table-replace` * - Keep the history but recompute the **recent rows** (for example the last 7 days) from a batch source on every refresh - **Replace where** (``mode: replace_where``) - :doc:`streaming-table-replace-where` * - Serve a query result that Databricks keeps fresh (an aggregate, a join) - A **materialized view** - :doc:`materialized-view` * - Send rows out to Kafka, Delta, or another external system - An **external sink** - :doc:`sinks` .. tip:: Streaming table vs materialized view, in one line: a **streaming table** is *incremental* β€” it processes new rows as they arrive. A **materialized view** is *declarative* β€” it re-derives its full result when its inputs change. Use a streaming table for ingestion and CDC; a materialized view for aggregates and joins over existing tables. .. toctree:: :maxdepth: 1 :hidden: Streaming table CDC (change feed) CDC (snapshots) Replace (replace using) Replace where (recent rows) Materialized view External sinks