Theory
dbt's bet: transformation is software
dbt does one thing: it compiles your .sql files into warehouse SQL and runs them in dependency order. The leverage comes from the conventions:
- Models — one SQL
SELECTper table/view.ref('stg_orders')wires the DAG so dbt builds them in the right order. - Tests —
unique,not_null,accepted_values,relationships, plus arbitrary SQL tests. They fail the build, not just a dashboard. - Snapshots — automatic SCD-2 for source tables that lack history.
- Contracts (dbt 1.5+) — declare a model's column names, types and constraints; consumers depend on the contract, not the implementation.
Combined, dbt brings code review, CI, version control and testing — the basics of software engineering — to a layer that used to live in stored procedures and tribal knowledge.