REVOLT BI IS NOW PART OF JOYFUL CRAFTSMEN. READ MORE →

Databricks Declarative Pipelines: An Introduction

Katerina Protivenskyi
27. August 2026

You can have all the AI in the world, but if it’s on a shaky data foundation, then it’s not going to bring you any value.

Carol Clements, Chief Digital and Technology Officer at JetBlue

Right now, all we hear about is AI. But every AI conversation circles back to the same place: the data underneath it. AI output is only as good as the underlying data. As we say, garbage in, garbage out.

Most data teams are now responsible for preparing data so that it’s AI-ready. But the majority of them still do it the old, imperative way.

In an imperative pipeline, you write the step-by-step instructions for how the data should be processed. You’re responsible for the control flow: read this source, run this transformation, write to this table, then read that table, join it, handle the order of operations, manage what runs when, and deal with incremental loading, retries, and dependencies. You control the “how,” and the burden of correctness, ordering, idempotency, and recovery is on you.

But there is another way: declarative pipelines in Databricks. In a declarative pipeline, you describe what the end result should look like. You’re not telling the engine when to run, in what order, or how to handle incremental files. You’re simply stating: “this table should be the result of this query.” The framework then reads all your table definitions, builds the dependency graph automatically, decides the execution order, manages incremental processing, handles retries and recovery, and enforces your data-quality constraints.

This article explains what declarative pipelines are, how to build one layer by layer, and where they fit in a modern data platform.

What Is a Declarative Pipeline?

Declarative means you define what each output table should contain. You do not write the scheduler, the dependency resolver, the retry handler, or the checkpoint manager. You define the output; Databricks determines how and when to produce it.

In a declarative model you write a SQL or Python definition that says: “Table B should contain this transformation of Table A.” That is the entire definition. Databricks parses that reference to Table A, infers the dependency, and handles when B runs, in what order, whether it retries, and how it tracks incremental progress.

At runtime, Databricks parses every table definition in your pipeline, resolves the table_name references, and constructs a directed acyclic graph (DAG). Tables with no upstream dependencies execute first. Tables that reference others wait for their sources to complete successfully. If a table fails mid-pipeline, Databricks marks it and all of its downstream dependents as failed for that update, while preserving the results of upstream tables that completed successfully. You don’t lose clean data because of a downstream failure.

A Note on Naming

The product has had three names in three years. Databricks launched it as Delta Live Tables (DLT) in 2022, and for years everybody called it DLT. In 2024–2025, Databricks reorganised its data engineering products under an umbrella called Lakeflow: Lakeflow Connect (managed connectors), Lakeflow Declarative Pipelines (the renamed DLT), and Lakeflow Jobs (workflow orchestration). Then in 2025, Databricks open-sourced the engine to the Apache Spark project as Spark Declarative Pipelines. The Databricks product is now called Lakeflow Spark Declarative Pipelines (SDP).

Older blog posts say DLT. Newer ones say Lakeflow or SDP. They all mean the same thing.

The Medallion Architecture

Before we build anything, one piece of vocabulary, because it shapes every example that follows. Most analytics pipelines are organized into three layers, known as the medallion architecture:

  • Bronze holds raw data, ingested as-is from the source. It’s your landing zone and audit trail.
  • Silver holds cleaned, validated, and deduplicated data, correct types, no bad rows, consistent formatting.
  • Gold holds business-ready data, usually shaped for analytics, such as a star schema that a BI tool can query directly.

Data flows in one direction: bronze → silver → gold. In an imperative world, you would wire those layers together and schedule them in order. In a declarative pipeline, you simply define the tables at each layer, and Databricks works out the rest. That’s what takes the medallion architecture to the next level — and it’s exactly what we’ll build now. Medallion architektury na vyšší úroveň. A přesně takovou pipeline si nyní společně vytvoříme.

Building the Pipeline

Bronze: Ingesting Raw Data

We start by landing raw customer and sales data into bronze tables. We use a streaming table here. A table built for data that arrives continuously. It processes each record once, append-style, and remembers what it has already ingested, so every run picks up only the new files.

Note: the catalog and schema need to be created beforehand.

code source: https://www.youtube.com/watch?v=8v150KsR5ak

The key function is cloud_files(...), which is Auto Loader. It watches a directory, incrementally picks up new files as they land, and crucially remembers which files it has already processed. In an imperative pipeline you’d write that bookkeeping yourself. Here you just point it at a folder and declare the table.

Silver: Cleaning and Enforcing Quality

Bronze data is raw, which means messy: missing values, inconsistent casing, duplicates, malformed dates. The silver layer cleans it up. We use a materialized view here, a table defined by a query over existing data that always reflects the current result of that query, maintained incrementally where possible. That makes materialized views the natural fit for transformations: cleaning, joining, aggregating, and deduplicating.

We also attach data-quality constraints directly to the table definition.

code source: https://www.youtube.com/watch?v=8v150KsR5ak

A constraint attaches a data-quality rule to a table and is evaluated per row on write. Instead of writing code that loops through rows and logs problems, you state the rule once: “email should look like an email,” “quantity should be positive” right next to the table, where anyone reading the code can see it. There are exactly two violation modes, set with an ON VIOLATION clause:

That’s useful in development, where you want to see how dirty your data is before deciding whether to drop or fail on it.

Gold: A Star Schema for Analytics

Finally, we reshape the clean data into the form business users and BI tools love: a set of dimension tables (the “who, what, when”) and a fact table (the measurable events). This is the gold layer.

code source: https://www.youtube.com/watch?v=8v150KsR5ak

Putting It Together: The Auto-Built DAG

Here’s the payoff. Notice that nowhere did we tell the pipeline that dim_customers depends on customers_cleaned, or that customers_cleaned depends on customers_raw. We just wrote queries that reference other tables by name.

Databricks builds the execution DAG entirely from those references. When fact_sales selects from sales_cleaned, Databricks knows sales_cleaned must complete first. No explicit dependency declaration exists anywhere in the code — the reference is the declaration.

Zero scheduler config. Zero retry logic. Databricks executes bronze first, silver second, gold third, and draws the lineage graph for you.

Auto-Built Dag: https://www.youtube.com/watch?v=8v150KsR5ak

Going Further

The pipeline above covers the everyday case. One more capability is worth knowing once you’re comfortable with the basics.

Auto CDC

AUTO CDC simplifies tracking inserts, updates, and deletes from a source database and applying them to downstream tables without writing complex MERGE logic.

KEYS identifies the row, SEQUENCE BY tells Databricks how to order incoming changes so the latest one wins, and STORED AS SCD TYPE 1 overwrites the record with the newest values. Use SCD TYPE 2 instead when you need to keep historical versions of each row.

Wrapping Up

With three short layers — raw ingestion, cleaning with data-quality constraints, and a star schema for analytics — we built a complete pipeline without writing a single line of orchestration code. That’s the whole promise of declarative pipelines, and the reason Databricks built a product line around the idea: you describe the tables you want, and the platform produces them correctly, in the right order, every time.

If your data foundation is what makes or breaks your AI, this is a foundation worth building well.

Resources

Kateřina Protivenskyi


Katerina is a Senior Data Engineer at Revolt BI with a strong focus on modern data platforms and data architecture.


IS YOUR DATA READY FOR AI?

We’ll review your data platform and tell you exactly what’s standing between your data and real AI use.

Read some of our other articles