dbt gives you multiple tools for schema and data validation — contracts, data tests, dbt-expectations — but they’re not interchangeable. They fire at different points, cover different things, and cost different amounts to run. Once you understand the differences, you can layer them deliberately rather than piling on tests hoping something sticks.
This hub connects the notes that cover those layers, the gaps between them, and what happens when you wire the governance features together around the models that actually matter.
The Problem
Contracts guarantee model shape. Tests guarantee content. But sources have no contract protection, and content validation requires separate tests from either. And when you’re building models that other teams depend on — across project boundaries, in Mesh setups, in high-stakes dashboards — structural guarantees alone aren’t enough. You need the full governance stack.
Prerequisites
These notes assume you’re familiar with dbt Model Contract Mechanics and the dbt Testing Taxonomy. If not, start there.
Reading Order
dbt Validation Mechanisms Compared — The three-mechanism comparison: contracts (compile-time, zero compute, structural only), data tests (post-build, SQL queries, content), and dbt-expectations (post-build, SQL queries, schema + content). The comparison table and the timing discussion are the load-bearing parts.
dbt Source Schema Validation — Contracts don’t apply to sources, so this covers the workaround: using dbt-expectations directly on sources to catch column drift before transformations run. Includes the practical split between metadata-only tests on sources and content tests on base models.
dbt Mesh Governance Triad — How contracts, access controls, and model versioning work individually and what changes when you apply all three together. The data mesh connection and which models actually deserve this treatment.
Contract-First Development in dbt — The inverse of retrofitting: define the contract before writing the SQL. The API design analogy, the workflow, and how the ODCS Data Contract CLI can generate dbt YAML from a broader organizational contract.
Related Hubs
-
Data Contracts Hub — The full context: what data contracts are, the ODCS spec, ownership models, tooling ecosystem, and adoption challenges. The series this article closes out.
-
dbt-expectations Hub — dbt-expectations in detail: setup, test reference, the row_condition pattern, severity tuning, and BigQuery implementation patterns.