ENES

Data contract

A written, checkable promise about the shape and quality of data one team gives another.

A producer team and a consumer team connected through a signed document listing fields, types and a freshness promise, with a check that blocks a change that would break it

A data contract is an agreement between the team that produces some data (say, the engineers of the checkout app) and the teams that consume it (analysts, finance, a machine learning model). It spells out what the data will look like: which fields exist, their types, which ones can be empty, what values are allowed, how fresh the data will be and who to call when something goes wrong. Crucially, it is written as a file in code, usually YAML, so machines can check it.

It exists because of a very common accident. An app developer renames customer_id to client_id or changes prices from dollars to cents, which is a perfectly reasonable change for the app, and the next morning every revenue dashboard is broken. Nobody did anything wrong; the producer simply did not know who depended on that table. A contract makes the dependency explicit, and an automated check in CI/CD can block the change, or at least warn, before it ships.

Contracts are often versioned like APIs: compatible changes are fine, breaking ones need a new version and a migration period. They are a key idea in data mesh, where each domain team owns and publishes its data as a product. There are open specifications, such as the Open Data Contract Standard, and tools that validate them. The hard part is less the file than the habit: producers have to treat their data as something other people rely on.

Keep in mind

Go deeper

Related terms

More in Data