Data & Retrieval

Data Contract

An explicit, enforced agreement about the schema and semantics of data passed between a producer and its consumers.

A data contract is a formal, version-controlled agreement between a data producer and its consumers about the structure, types, semantics, and quality guarantees of the data they exchange — making an implicit dependency explicit and testable. It brings API-style discipline to data pipelines.

Worked example: the events team commits a contract declaring “user_id is a non-null string, signup_ts is UTC epoch millis”; a CI check rejects any producer change that would violate it, so the downstream warehouse pipeline never silently breaks. Gotcha: data pipelines usually break because an upstream team changes a column with no warning (a rename, a type change, a newly-null field) — a data contract catches that at the source instead of as corrupted dashboards days later; without enforcement, though, a “contract” is just a document nobody reads.