DatabricksSrilekha Dornadula, Luís CabralTutorial
How to get the most out of running dbt on Databricks
Summary
Tens of thousands of organizations use dbt, and where it runs directly affects pipeline cost, speed, and operational complexity. Running dbt on Databricks provides an open, unified platform, yet many teams underutilize its capabilities. The post details practices to reduce costs, such as applying appropriate incremental strategies and replacing full recomputes with materialized views, which delivered a 17x speedup in a benchmark. It also covers automating data layout with Liquid Clustering and Predictive Optimization, and attributing every dollar to specific models via query tags. For operational simplicity, it recommends bringing ingestion into dbt with streaming tables, standardizing metrics through Unity Catalog Semantics, and orchestrating pipelines natively with Lakeflow Jobs.
Context
The supplied text is a blog post aimed at teams that run dbt on Databricks, offering practices to reduce pipeline costs, improve speed, and simplify operations. It is addressed to technical audiences who already use dbt.
Approach / What changed
The blog describes practices to optimize dbt on Databricks across cost, performance, and operations. It recommends using incremental strategies, materialized views, Predictive Optimization, Liquid Clustering, query tags for cost attribution, streaming tables for ingestion, Unity Catalog Semantics for metric governance, Lakeflow Jobs for native orchestration, Declarative Automation Bundles for versioned deployment, and in-project governance via tags, grants, and row/column-level security.
Takeaways
Choosing the right incremental strategy per model reduces full table rebuilds; replace_where is more efficient than merge when changes can be described with a predicate.
Materialized views on Databricks automate incrementalization with a one-line config change and delivered a 17x speedup in a TPC-DI benchmark at the serving layer.
Lakeflow Jobs collapse ingestion, dbt, and downstream tasks into a single native DAG with built-in scheduling, retries, and alerts, removing the need for a third-party orchestrator.
FAQ
Which incremental strategy should I choose?
Use append for inserts only, merge for upserts on the same key, replace_where for narrow time windows, insert_overwrite for whole partitions, delete+insert for key-based replacement without column-level update logic, and microbatch for time-series data with structured backfill needs.
How do materialized views improve performance?
Materialized views automate incrementalization by tracking underlying data changes and refreshing only affected results. Switching from full recompute to materialized views at the serving layer delivered a 17x speedup in a TPC-DI benchmark.
How do query tags attribute costs to dbt models?
Every dbt query run on Databricks is stamped with model name, dbt version, and materialization type. These tags surface in system.query.history, and joining against system.billing.usage attributes serverless warehouse spend to dimensions like model, team, or domain.
Source and freshness
- Source
- databricks.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.