Learning Hub

Data Contracts Explained: ODCS and ODPS in Practice

Written by Mimacom | Dec 3, 2026, 1:21:07 AM

A data contract is a machine-readable file in which the team that provides a dataset states what it promises consumers: the schema, the quality rules, the owner, the service levels, and the terms of use. Because the file is code rather than a wiki page, tools can test the data against it, generate documentation from it, and use it to set up catalog entries and access. This article explains what goes in a data contract, how the two open standards ODCS and ODPS fit together, and what a contract can automate on platforms such as Databricks and Confluent.

What is a data contract?

The closest comparison is an API specification. A service team publishes an OpenAPI file so that other teams can call its endpoints without reading its code. A data contract does the same for a dataset: it describes the interface that consumers can rely on, and it stays stable while the pipeline behind it changes. When the provider needs to break that interface, it publishes a new contract version and gives consumers time to move.

A contract is published by the provider and refers to no specific consumer. That makes it a promise to anyone who reads the data, which is why it belongs next to the data in a catalog rather than in a project folder. Most teams write contracts in YAML and keep them in Git, so every change has an author, a review, and a history.

What a data contract is not

A data contract is not the DDL of a table. The DDL tells the database which columns and types it will accept. The contract adds what the database cannot express, such as what a field means, how fresh the data must be, who to call when it breaks, and what consumers may use it for.

It is also not a data product. A data product is the unit a team owns and runs: pipelines, storage, and one or more output ports that consumers read from. Each output port is described by a data contract, so one product can carry several contracts.

Finally, a data contract is not a legal agreement, although the name suggests one. It is a one-sided published promise. The two-sided part, where a specific consumer requests access for a stated purpose and the provider approves it, is usually called an access agreement and is handled by the platform’s access process.

Why data contracts matter

The most common reason teams adopt data contracts is to stop upstream changes from breaking downstream work. A developer renames a column in a source system, the nightly load still succeeds, and a finance dashboard shows wrong numbers for a week before anyone notices. With a contract in place, that rename fails a test in the provider’s own pipeline, before the change reaches production and before any consumer is affected.

Contracts also settle ownership. Every contract names a team and a support channel, so when data is late or wrong, consumers know who to contact instead of opening a ticket with a central data team that did not build the dataset. In a data mesh architecture, where many domain teams publish data to each other, this is what keeps the arrangement workable as the number of teams grows.

The newest reason is AI. Agents and AI assistants that query enterprise data need the same context a human analyst would ask for: what a field means, which values are valid, and what the data may be used for. A contract gives them that context in a form they can read, instead of relying on column names and guesswork.

What goes in a data contract

The Open Data Contract Standard (ODCS) defines the structure most teams now use. Version 3.2.0 organizes a contract into the sections below. Only the fundamentals are strictly required, so teams usually start with the schema, quality rules, and owner and add the rest as consumers ask for it.

ODCS sectionWhat it describesExample
FundamentalsIdentity, version, status, and a description of purpose, usage, and limitationsorders, version 1.2.0, active
SchemaTables and fields with logical and physical types, keys, and classificationcustomer_email is a string, classified as restricted
Data qualityRules the data must pass, written as plain text, library checks, or SQLNo order may have a negative total
Support and communicationWhere consumers ask questions and get announcementsA Slack or Teams channel
Team and rolesWho owns the contract and which access roles existOwner, data steward, read-only role
Service-level agreementPromises on freshness, latency, availability, and retentionUpdated daily by 6 AM UTC
ServersWhere the data physically livesCatalog and schema on a Databricks workspace
PricingCost of using the data, where it is charged internallyOptional; often left out
Custom propertiesAnything else the organization needsCost center, data domain

A minimal contract for an orders table looks like this:

apiVersion: v3.2.0
kind: DataContract
id: orders
name: Orders
version: 1.2.0
status: active
description:
  purpose: All confirmed customer orders, one row per order.
  limitations: Excludes test orders and orders cancelled before payment.
schema:
  - name: orders
    physicalType: table
    properties:
      - name: order_id
        logicalType: string
        primaryKey: true
      - name: order_total
        logicalType: number
        quality:
          - type: sql
            description: Order totals are never negative.
            query: SELECT COUNT(*) FROM orders WHERE order_total < 0
            mustBe: 0
      - name: customer_email
        logicalType: string
        classification: restricted
team:
  name: order-management

Everything in this file can be read by people and checked by tools. The classification on customer_email, for example, is documentation for a human reader and an instruction for a platform that masks restricted fields.

ODCS and ODPS: The two open standards

Both standards come from Bitol, a Linux Foundation project. Before ODCS became the common format, several vendors and open source projects had their own contract formats. The best known, the Data Contract Specification, was deprecated in favor of ODCS from version 3.1, which leaves most of the ecosystem working from one standard.

Open Data Contract Standard (ODCS)

ODCS describes one dataset behind one interface: the schema, quality rules, owners, and service levels covered above. It is a YAML format with a published JSON Schema, so editors and CI pipelines can validate a contract before anyone relies on it. A growing number of catalogs, quality tools, and data platforms can read it directly.

Open Data Product Standard (ODPS)

ODPS describes the data product as a whole. Its file names the product, its domain, its owning team, and its status, and then lists the product’s ports. Input ports declare which contracts the product consumes. Output ports declare what it publishes, and each output port points to an ODCS contract by its ID and version.

That link is what makes the two standards useful together. The ODPS file answers “what is this product and who owns it”, and each ODCS file answers “what exactly does this port promise”. A product that publishes a full dataset for internal analysts and a filtered version for a wider audience has two output ports and two contracts, and both can be versioned independently.

Watch the name

ODPS is also the abbreviation of the Open Data Product Specification, a separate standard maintained by opendataproducts.org. It has its own structure and versioning and does not use ODCS for its ports in the same way. When a vendor or a colleague says “ODPS”, check which one they mean before you compare tools or examples.

What a data contract can automate

A contract that only sits in a repository is documentation. Its value comes from the systems that read it. These are the uses we see most often in production platforms:

  • Tests in the provider’s CI/CD pipeline that check the schema and quality rules against the real data before a change is deployed
  • Generated table definitions, schemas, and documentation, so the contract and the implementation cannot drift apart
  • Catalog entries created or updated from the contract, including the owner, description, and classification
  • Breaking-change checks that compare a new contract version with the previous one and block incompatible changes
  • Access requests and approvals tied to a specific output port and its contract
  • Masking or filtering of fields that the contract classifies as personal or restricted

The order matters. Most teams start with tests, because they catch problems immediately and need no new platform components. Generation and catalog sync come next. Driving access and masking from the contract gives the biggest return, but it needs a platform built around contracts.

Data contracts in streaming: Confluent Schema Registry

Streaming platforms reached data contracts from a different direction. Confluent Schema Registry has long stored the schema for each Apache Kafka topic and enforced compatibility rules when producers change it. Confluent now calls the combination of a schema with tags, metadata, and rules a data contract, and supports it in both Confluent Platform and Confluent Cloud.

The rules are where it goes beyond schema checks. Domain rules validate content as messages are produced, for example rejecting an order event without a customer ID, and can route failing messages to a dead letter queue. Migration rules transform messages between schema versions, so consumers on the old version and the new version can both keep reading during a breaking change. Our article on stream governance explains how these rules fit with lineage, catalogs, and access control for data in motion.

A Schema Registry contract and an ODCS contract are different formats that solve the same problem. Organizations that run both Kafka and a lakehouse often keep ODCS as the cross-platform description and use Schema Registry rules for enforcement at the point where events are produced.

Data contracts on Databricks

Databricks does not have a native contract format, but ODCS fits its structure well. Unity Catalog already organizes data as catalog, schema, and table, and holds owners, comments, tags, and grants. A contract can describe each of those, and the open source Data Contract CLI can work in both directions with Unity Catalog.

To start from existing tables, datacontract import databricks reads a Unity Catalog table and generates an ODCS contract from it. The team then adds quality rules, an owner, and service levels. After that, datacontract test runs the schema and quality checks against the live table. The same test can run in a CI/CD pipeline, on a schedule, or inside a notebook or job with the existing Spark session.

Larger platforms go further and treat the contract as the input for deployment. The contract sits in the same repository as the pipeline code, and the deployment process creates the schema, applies tags and grants, and publishes the catalog entry from it.

How to get started with data contracts

There are two ways in. Data-first means generating contracts from tables that already exist and then tightening them. It is the faster route for an established platform, and the import tooling makes the first draft almost free. Contract-first means writing the contract before building the pipeline, the same way an API team agrees on a specification before writing code. It gives consumers a say in the interface and suits new data products.

Either way, start small. Pick the datasets whose failures cost the most, such as the tables behind financial reporting or a model in production, and put contracts on those first. Keep contracts in Git next to the pipeline code, run the tests in CI from the first day, and treat a failing test the way you would treat a failing unit test.

The harder part is organizational. A contract only works if the provider accepts responsibility for it, and that means the providing team needs the time and the authority to keep its promises. Agree on who reviews contract changes and how consumers hear about new versions before you roll contracts out widely.

FAQs

What is a data contract in data engineering?

In data engineering, a data contract is a versioned file, usually YAML, that describes a dataset’s schema, quality rules, owner, and service levels. Pipelines and tools read it to test data, generate documentation, and catch breaking changes before they reach consumers.

What is the difference between a data contract and a data product?

A data product is the unit a team owns and operates, including its pipelines, storage, and output ports. A data contract describes what one output port promises. A single data product often has several contracts, one for each port or version it publishes.

Is a data contract a legal contract?

No. A data contract is a technical promise that the provider publishes to all consumers. A specific consumer’s permission to use the data for a stated purpose is a separate access agreement, which the platform grants after the provider approves the request.

Data contracts turn promises into tests

The idea behind data contracts is simple: write down what a dataset promises, in a format machines can check. ODCS gives that promise a common structure, and ODPS ties contracts to the data products that publish them. The real payoff comes when the platform reads the contract and acts on it, with tests in CI, generated schemas, catalog entries, and access that follows the contract instead of a ticket queue.

How Mimacom can help

Mimacom builds Databricks platforms where data contracts do the work. We design the Unity Catalog structure, set up ODCS and ODPS as the source of truth for each data product, and connect them to deployment, catalog, and access so that teams can publish and consume data without waiting on a central team. If you already run Kafka, our Confluent practice connects Schema Registry contracts to the same model.

Planning data contracts on Databricks? Talk to our Databricks team about a contract-driven data product platform.

Databricks Consulting · Contact us