Why your data pipelines keep breaking (and how data contracts fix it)
Silent schema changes are the number one cause of broken pipelines. Data contracts turn those failures into caught, owned, and versioned changes; here is how to adopt them.
Most pipeline outages don’t start with a dramatic failure. They start with a well-meaning change three teams away: someone renames a column, tightens a type, or drops a field that “nobody uses.” Hours later, a dashboard is wrong, a model is scoring garbage, and an on-call engineer is bisecting commits at 3am.
The root cause is almost never the code; it’s the missing agreement about what the data is supposed to look like. That agreement is a data contract.
What a data contract actually is
A data contract is a versioned, machine-readable specification of a dataset that producers and consumers both commit to. At minimum it covers:
- Schema: field names, types, and nullability.
- Semantics: what each field means, and its allowed values.
- Quality guarantees: freshness, completeness, and uniqueness expectations.
- Ownership: who is responsible when the contract is violated.
Crucially, the contract lives in version control next to the code that produces the data; not in a wiki page that goes stale the day it’s written.
Enforce it in CI, not in production
A contract that isn’t enforced is just documentation. The pattern that works:
- Producers declare the contract as code (for example, a
dbtmodel contract or a schema registry entry). - Every change to a producing job runs a check in CI that compares the new output against the contract.
- A breaking change fails the build; the producer either updates the contract deliberately (bumping its version) or fixes the regression.
# A simple dbt model contract
models:
- name: orders
config:
contract: { enforced: true }
columns:
- name: order_id
data_type: string
constraints: [{ type: not_null }]
- name: total_amount
data_type: numeric
The change that used to slip out silently now shows up as a red build, reviewed by the person who owns the downstream impact.
The payoff
Teams that adopt contracts stop treating data quality as a firefighting activity. Breaking changes become visible, negotiated, and versioned. Consumers can build on a dataset knowing it won’t shift under them without warning; and when it does change, they get a deprecation window instead of a 3am page.
You don’t need to contract every table on day one. Start with the handful of datasets that feed your most important dashboards and models, prove the pattern, and expand from there. Reliability compounds.
Ready to put this into practice?
Send us a message and we’ll review where these ideas fit your stack.
Get in touch