← All insights

Data contracts: the API your data never had

Software teams stopped breaking each other's systems when they agreed interfaces, and data teams are now doing the same. What a data contract contains, how the open standard works, and how to stop silent breaking changes.

On Monday morning the board pack is wrong. After two hours of digging, someone finds the cause: on Friday a source team renamed status to policy_status in a table they considered internal. Nobody told the three teams downstream, because nobody knew they existed. The pipeline did not fail. It filled a column with nulls.

Every data team has a version of this story. Software engineering solved the equivalent problem years ago: a service publishes an API, the API has a specification, and changes that break callers get a new version. Data contracts apply the same rules to data.

What a data contract is

A data contract is a machine-readable agreement between the team that produces a dataset and the people who consume it. It states what the data looks like, what it means, how good and how fresh it will be, who owns it, and on what terms it may be used.

Thoughtworks' 2026 review of data mesh practice lists the enablers that matter as "robust, versioned data contracts that define schema, guarantee data quality SLOs and specify terms of use and access policies", and adds that contracts are still among the hardest parts to get right (Thoughtworks, 2026).

Machine-readable is what separates a contract from documentation. A wiki page describing a table can only be read by people, while a pipeline can check a contract on every run.

What goes into a contract

A complete contract usually answers six questions:

QuestionContract sectionExample
What is it?Description, purpose, limitations"Monthly lapse probability per policy. Not for individual pricing decisions."
What does it look like?SchemaColumns, logical types, keys, required fields
What does it mean?SemanticsColumn descriptions, business terms, examples
How good is it?Quality rulesKeys unique, no null policy IDs, probability between 0 and 1
How fresh and available?Service levelsUpdated by 06:00 on business days; retained for seven years
Who and on what terms?Team, roles, accessOwning team, support channel, who may read it, classification

The open standard

For years every vendor and every company invented its own contract format. That has mostly settled. The Open Data Contract Standard (ODCS) is maintained by the Bitol project, now a graduated project of the Linux Foundation AI & Data, and licensed under Apache 2.0 (Bitol). With its sibling, the Open Data Product Standard (ODPS), it covers schema and semantics, service-level expectations, quality metrics, ownership, access and governance.

Adoption has followed. In November 2026 the Thoughtworks Technology Radar placed ODCS in its Adopt ring "as a sensible default for teams building data products", and noted that the maintainers of the Data Contract CLI are deprecating their own earlier format in favour of ODCS (Thoughtworks Technology Radar).

The standard has moved quickly. Version 3.1, released in December 2025, added relationships (foreign keys), a team object and a library of quality metrics. Version 3.2, released in September 2026, added a context block that tells AI agents "how to use your data, what is verified, and what they must never do", plus synonyms, measures and dimensions, deprecation and nine new server types including Iceberg (ODCS releases).

An abridged ODCS contract looks like this:

apiVersion: v3.2.0
kind: DataContract
id: 7c1e2f9a-lapse-risk
domain: risk
dataProduct: lapse_risk
version: 2.0.0
status: active
description:
  purpose: Monthly probability that each policy lapses within three months.
  limitations: Model output; not for decisions about individual customers.
schema:
  - name: lapse_risk
    physicalType: table
    properties:
      - name: policy_id
        logicalType: string
        primaryKey: true
        required: true
        description: Policy business key.
      - name: month_end
        logicalType: date
        primaryKey: true
        required: true
      - name: lapse_probability
        logicalType: number
        required: true
        description: Modelled probability in [0, 1] of lapse within 3 months.
        quality:
          - metric: nullValues
            mustBe: 0
            type: library
            dimension: completeness
slaProperties:
  - property: latency
    value: 1
    unit: d
  - property: retention
    value: 7
    unit: y
team:
  name: team-risk-analytics

Nobody wants to write that by hand for hundreds of tables, and nobody has to. The most reliable contracts are generated from the definition the team already maintains and checked on every change, so the contract cannot drift from the data.

Versioning

An unenforced contract is just another document. Contracts become useful with a rule borrowed from APIs: a breaking change gets a new major version, so consumers are never broken without warning.

Deciding what counts as breaking is mostly mechanical. Removing or renaming a column, narrowing a type, changing a key, making an optional field required for consumers and tightening the meaning of a value all break consumers. Adding an optional column, widening a type, adding a quality check and improving a description do not.

When a change is breaking, the producer publishes a new version of the output (lapse_risk_v2, or the same name in a versioned schema) and keeps the old one running for an agreed period, with a deprecation date. Consumers migrate on their own schedule. Two versions side by side is usually enough, and a third quickly becomes a maintenance burden.

breaking change → v2 published v1 deprecation date lapse_risk_v1 non-breaking changes ship in place retired lapse_risk_v2 two versions side by side: consumers move on their own schedule v1 live migration window v2 only
Breaking changes get a new version that runs next to the old one until its deprecation date. Non-breaking changes ship in place.

The Friday rename would have been caught in the pull request. A column disappeared from a published output, so CI would have refused the merge until the change was reverted or released as a new version.

Consumer expectations

Producers cannot know every consumer's needs. Consumer-driven contract testing in microservices offers a useful addition: consumers register what they rely on, for example "we read policy_id, status and start_date, and we need data no older than 26 hours." A change that would break a registered expectation is blocked before it merges, and the producer knows exactly whom to talk to.

Quality targets with numbers

A contract gives quality a measurable target. SYNQ's guide to reliable data products suggests tying service levels to priority: a business-critical product might target 99.9 percent reliability, while a lower tier accepts more failures and slower response times (SYNQ). The exact figure matters less than having one that is written down, measured and owned.

Quality rules stay useful when they check what consumers care about. Uniqueness of keys, completeness of required fields, valid ranges and freshness catch most real incidents, while hundreds of generic checks mostly produce noise and cost compute. Each rule also needs a defined consequence: quarantine the bad rows, hold the release, or publish with a warning. A rule that only writes to a log changes nothing.

Contracts and AI

Contracts used to protect dashboards, and now they increasingly protect agents as well. An AI assistant answering a question about lapse rates needs what a contract already holds: what each column means, which values are valid, how fresh the data is, and what it must not be used for. With the AI context block in ODCS 3.2, the standard now treats the contract as the instructions an agent reads before it touches your data.

How to start

  1. Pick the five datasets that would hurt most if they broke silently, usually the ones feeding regulatory reports, finance and pricing.
  2. Generate a first contract from what exists: schema from the catalogue, descriptions from comments, owners from the team that answers when it breaks.
  3. Add the rules consumers care about: keys, required columns, freshness.
  4. Put the contract in Git next to the code, and make CI compare the contract of every change with the published one.
  5. Turn on versioning, so a breaking change fails the build unless it ships as a new version.
  6. Invite consumers to register expectations, starting with the teams who were burned last time.

Contracts let a producer change things quickly, because every change is checked against what consumers rely on before it ships. APIs made the same trade for software services, and it holds for data.

Sources

  1. Werner, S., Prakash, K., Aliyeva, L., Sato, D. and Spens, J. (16 January 2026). The state of data mesh in 2026: From hype to hard-won maturity. Thoughtworks.
  2. Bitol project. bitol.io. Linux Foundation AI & Data.
  3. Thoughtworks Technology Radar (4 November 2026). Open Data Contract Standard (ODCS). Adopt.
  4. Bitol. Open Data Contract Standard releases (v3.1.0 and v3.2.0) and the ODCS specification.
  5. Janda, P. and Dengsøe, M. The Definitive Guide to Building Reliable Data Products. SYNQ.