Data pipelines break because data producers and data consumers have different assumptions. The producer assumes the consumer can handle null values in a column. The consumer assumes the column is never null. The producer changes a field from a string to an integer because it makes more sense. The consumer’s parsing logic fails. The producer updates data every six hours. The consumer expects updates every hour. None of these are bugs. They are mismatches in implicit expectations.
A data contract makes these expectations explicit. It is a written agreement between the team that produces a dataset and the teams that consume it, covering the schema, the quality guarantees, the update cadence, and the change management process. When both sides sign the contract, they have a shared understanding of what the data will look like, when it will arrive, and what happens when something changes.
The contract does not prevent all data incidents. It prevents the class of incidents caused by misaligned expectations, which is a surprisingly large class. It also provides a basis for automated validation — contract terms can be encoded as data quality checks that run on every data delivery.
This guide provides a data contract template and a negotiation framework for establishing contracts between data producers and consumers.
When you need a data contract
Not every dataset needs a formal contract. Internal datasets used by a single team can rely on shared understanding. Datasets that cross team boundaries need contracts. Specifically:
- Any dataset consumed by a team other than the team that produces it.
- Any dataset that feeds a production system (AI model, dashboard, operational workflow).
- Any dataset sourced from an external vendor.
- Any dataset that feeds regulatory or financial reporting.
If the data crosses a team boundary or a system boundary, it needs a contract.
The data contract template
A data contract has seven sections. Each section addresses a specific category of expectations.
Section 1: Dataset identification
- Dataset name: The canonical name used by both producer and consumer.
- Owner: The team responsible for producing and maintaining the dataset.
- Consumers: The teams or systems that consume the dataset.
- Business purpose: What this dataset represents and why it exists. This section prevents datasets from accumulating consumers who use the data for purposes it was never designed to support.
- SLA tier: Critical (production systems depend on it, outages cause business impact), Important (operational systems depend on it, outages cause inconvenience), or Standard (analytics use, outages are tolerable).
Section 2: Schema definition
Define every field in the dataset:
- Field name: The column or attribute name.
- Data type: The expected type (string, integer, float, boolean, timestamp, array, object).
- Nullable: Whether the field can be null. If yes, specify the expected null rate. A field that is nullable but has a 99.9% fill rate is functionally non-null — any null should be treated as a data quality incident.
- Description: What the field represents in business terms. This is critical for fields with ambiguous names. A field called “status” means nothing without a description of the valid values and their meanings.
- Constraints: Valid value ranges, enumerated values, format patterns, or cross-field dependencies. “Order amount must be non-negative.” “Country code must be ISO 3166-1 alpha-2.” “Ship date must be after order date.”
- PII classification: Whether the field contains personally identifiable information, and if so, what handling requirements apply.
Do not define schema as a verbal description or a sample file. Define it as a structured specification that can be validated programmatically. JSON Schema, Avro schema, or Protobuf schema all work. The key property is that the schema can be used as an automated validation target.
Section 3: Quality guarantees
The producer commits to specific quality properties:
- Completeness: The expected fill rate for each field. “Customer ID will have a fill rate of 99.5% or higher.”
- Freshness: The maximum acceptable delay between data generation and data availability. “Events will be available within 15 minutes of generation.”
- Uniqueness: Whether certain fields or field combinations must be unique. “Transaction ID is unique.”
- Accuracy: How accuracy is measured and what the acceptable threshold is. “Product price matches the source system within 0.01.”
- Volume stability: The expected range of row counts per delivery. “Daily delivery will contain between 50,000 and 200,000 rows.”
Each guarantee should have a defined measurement method and a threshold. Vague guarantees (“data will be high quality”) are not enforceable.
Section 4: Delivery terms
- Delivery format: The file format or API format (Parquet, JSON, CSV, database table, streaming topic).
- Delivery cadence: How often data is delivered (real-time streaming, hourly, daily, weekly).
- Delivery window: For batch deliveries, the time window by which data must be available. “Daily delivery available by 06:00 UTC.”
- Delivery location: Where the data is delivered (S3 path, database schema, Kafka topic name).
- Partitioning: How the data is partitioned (by date, by region, by customer). Partition scheme must be documented because consumers may depend on it for query performance.
Section 5: Change management
This is the most important section for preventing production incidents.
- Schema changes: What constitutes a breaking change versus a non-breaking change. Adding a field is non-breaking. Removing a field, renaming a field, or changing a field’s data type is breaking. Define the categories clearly.
- Notification requirements: How far in advance the producer must notify consumers of breaking changes. Thirty days is standard. Non-breaking changes require notification but not advance notice.
- Approval process: Whether breaking changes require consumer approval. For critical SLA tier datasets, they should.
- Versioning: How contract versions are numbered and how consumers reference a specific version.
- Deprecation process: How a field or dataset is deprecated. Deprecation means the field is marked for removal in a future version. Consumers have the deprecation window to update their systems.
Section 6: Incident handling
- Data quality incident definition: What constitutes an incident. A completeness rate dropping below the guaranteed threshold is an incident. A schema violation is an incident. A delivery delay beyond the SLA is an incident.
- Notification channel: How the producer notifies consumers of incidents. Email, Slack, PagerDuty — specify the channel and the expected response time.
- Resolution timeline: How quickly the producer commits to resolving different severity levels of incidents.
- Consumer fallback: What consumers should do when data is unavailable or unreliable. Should they use the previous delivery? Should they alert their own stakeholders? Should they switch to a fallback data source?
Section 7: Validation and enforcement
- Validation responsibility: Who runs the quality checks. Ideally, the producer runs checks before delivery and the consumer runs checks after receipt. Both sides validating catches issues that single-sided validation misses.
- Validation tooling: What tools or scripts validate the contract terms. If both sides use the same validation tool, discrepancies in interpretation are eliminated.
- Escalation path: What happens when a contract violation occurs repeatedly. Escalation should go from the producer team lead to the data platform owner to the engineering director. Define the path in advance so escalation does not stall.
Negotiation framework
Establishing a data contract requires negotiation between producer and consumer. The producer wants broad guarantees (flexible schema, relaxed quality thresholds, long change notification windows). The consumer wants tight guarantees (rigid schema, strict quality thresholds, short delivery windows). The negotiation finds the intersection.
Step 1: Consumer writes requirements
The consumer writes what they need from the data. Not what they want — what they need. The difference matters. Wanting daily freshness when the use case only requires weekly updates inflates the contract and creates unnecessary producer obligations.
For each contract section, the consumer specifies their minimum acceptable terms. These become the negotiation starting position.
Step 2: Producer writes capabilities
The producer writes what they can actually deliver. Not aspirational capabilities — current, demonstrated capabilities. If the producer’s pipeline currently delivers data with a 97% completeness rate, promising 99.9% in the contract requires pipeline improvements that may not be funded.
Step 3: Gap analysis
Compare consumer requirements against producer capabilities. Every gap is a negotiation point. There are three resolution options for each gap:
- Producer improves: The producer invests in pipeline improvements to meet the consumer’s requirement. This requires time and resources.
- Consumer relaxes: The consumer accepts a lower standard than originally requested. This requires the consumer to adjust their system to handle the lower standard.
- Both compromise: The producer improves partially and the consumer relaxes partially.
Document the gap analysis and the agreed resolution for each gap. This document becomes the contract appendix.
Step 4: Sign and operationalize
Both teams sign the contract. “Signing” in this context means both team leads acknowledge the terms and commit to meeting them. The contract is a living document — it should be reviewed and updated when either side’s capabilities or requirements change.
Encode the contract terms as automated validation checks. Run these checks on every data delivery. A contract that is not validated is a document, not a contract.
This diagram requires JavaScript.
Enable JavaScript in your browser to use this feature.
Common failure modes
Contracts without enforcement. A data contract that is not validated automatically is a gentleman’s agreement. It will be violated within weeks. Encode every contract term as a validation check that runs on every data delivery.
Over-specifying. A contract with fifty quality guarantees per field is a contract that nobody reads. Specify the guarantees that matter for the consumer’s use case. Leave the rest unspecified. Over-specification creates noise that drowns out the important terms.
No change management. The most common cause of data contract violations is unannounced schema changes. The change management section of the contract must be explicit about what changes require notification, how far in advance, and through what channel.
Producer-consumer power imbalance. If the producer is a platform team and the consumer is a product team, the producer may dictate terms that do not meet the consumer’s needs. The negotiation framework requires the consumer to articulate their minimum requirements and the producer to explain their constraints. Both sides must compromise.
One-time contracts. Data contracts should be reviewed quarterly. Data pipelines change. Consumer requirements change. A contract that was appropriate six months ago may be too loose or too tight today.
Next step
Pick the most critical data pipeline that crosses a team boundary. Write a data contract for it using the template above. Do not try to contract all your data pipelines at once. Start with one, work through the negotiation process, and learn what works before scaling to other pipelines. The first contract takes the most effort because you are establishing the process. Subsequent contracts are faster.