A data contract is an explicit agreement between data producers and consumers about a dataset's schema, semantics, freshness, and quality rules. It turns "tribal knowledge" into enforceable expectations.
A contract might specify:
- Schema and types
- Primary key / grain
- Ownership and SLAs
- Allowed nullability
- Compatibility policy for changes
producer (checkout service) publishes orders.v1 under contract consumer (warehouse team) builds fct_orders assuming contract holds
Why platforms adopt them
Without contracts, app teams "helpfully" rename fields and break every dashboard overnight.
Interview tip: Say contracts shift quality left to producers, with CI checks on schema changes, not only downstream firefighting.