What is a data contract?
A formal agreement between data producers and consumers: schema, semantics and SLAs, versioned and automatically enforced in CI.
A data contract is the formal agreement between whoever produces a dataset and whoever consumes it. Like an API contract between microservices, it defines schema, semantics and service levels: which fields arrive, their types, what they mean, how often they refresh and who answers when something breaks. What sets it apart from classic documentation is its form: not a wiki page that goes stale, but a file versioned alongside the code and checked automatically on every change. In practice the file lives in the producer's repository, typically as YAML or JSON, and enters the same CI pipeline that checks the application code: if a change violates it, say a renamed column or a changed type, the build fails before the broken data reaches anyone downstream, instead of being discovered weeks later by whoever reads a wrong dashboard or a broken model.
How it works
In practice the contract is a machine-readable file (typically YAML or JSON), it lives in the producer's repository and gets enforced in CI: if a change violates it, say a renamed column or a changed type, the build fails before the broken data reaches anyone downstream. The problem it solves is the most common one on data platforms: the typical breakage is not a bug but a legitimate upstream change (a field renamed in the ERP, a new value in a closed list) that silently breaks dashboards and models downstream. The contract moves discovery from "the report has been wrong for three weeks" to "the pipeline fails CI". The same checks can also feed runtime monitoring, since not every violation goes through code.
Why it matters for your business
A data contract shifts quality responsibility to the data producer, where fixing is cheap, instead of dumping it on a central data team that discovers problems downstream. It reduces silent incidents, gives data quality an objective baseline (a contract is measurable, good intentions are not) and matters even more with AI: agents and models consume data with no human in the loop to spot the anomaly. The honest caveat: a contract is worth as much as the organizational will to honor it. Rolled out everywhere at once it turns into bureaucracy; it works when you start from the few critical interfaces where breakage actually hurts.
Related terms
- Data quality · How fit your data is for its intended use: complete, correct, fresh and consistent across systems. Measured, not declared.
- Data governance · The rules, roles and processes that make company data reliable, secure and usable: who can do what, on which data, at what quality.
- Data lineage · The map of your data's journey: which source it comes from, which transformations it goes through and which reports, models or systems it feeds.
- Contract testing · Verifies that an API's consumer and provider honor a shared contract, without a full integration environment.
- Database-per-service · Each microservice owns its own datastore and no other service reads it directly, only through its exposed interfaces.
A term that hits close to home? Let's talk.
CONTACT ME