Medallion Architecture from CDC History Tables
Transform Lakebase Change Data Feed history tables into a medallion architecture with silver (current state) and gold (aggregations) layers using Lakeflow Declarative Pipelines.

Build with AI
- Copy the prompt below
- Paste into Cursor, Claude Code, Codex, or any coding agent
- Your agent builds it — asking questions along the way so the result is exactly what you want
New to templates? Learn more here
When done, you will have:
- A bronze layer provided by the upstream Lakebase Change Data Feed history tables (input to this recipe)
- A silver layer with deduplicated, current-state materialized views for each entity
- A gold layer with business aggregations and metrics as materialized views
- A scheduled Lakeflow Declarative Pipeline refreshing silver and gold layers incrementally
- All layers queryable as Unity Catalog tables via SQL, Spark, BI tools, and Genie
Prerequisites
This template builds a Lakeflow Declarative Pipeline on top of existing Lakebase Change Data Feed (CDF) history tables. Verify these Databricks workspace features are enabled before starting.
- Lakeflow Declarative Pipelines (serverless) available. Run
databricks pipelines list --profile <PROFILE>and confirm the command succeeds (an empty list is fine). A permission ornot enablederror means Lakeflow Pipelines is not available to this identity. - Unity Catalog access with a writable destination schema. Run
databricks catalogs list --profile <PROFILE>and confirm your destination catalog is listed. You will needUSE_CATALOGon the catalog andUSE_SCHEMA+CREATE_TABLEon the destination schema to publish silver and gold tables. - Bronze CDC history tables already in Unity Catalog. Complete the Lakebase Change Data Feed (Autoscaling) template first so
lb_<entity>_historytables exist in the bronze schema. This template reads from those tables; it does not create them.


