Skip to content
BENIBIX Learn

Data Contract

Also known as Data Contracts, Schema Contract

A written deal on what data will look like. Its maker keeps to it.

Think of it like

A baker promises a cafe ten loaves each morning. The cafe plans its day around that.

Example

The app team wants to rename a column. The contract check fails in their pull request, so they talk to the analytics team before the change ships.

Why it matters

Most broken pipelines start with a change no one was told about. A contract turns that shock into a talk.

Definition

A data contract is a written agreement between the team that makes data and the teams that use it. It lists the columns, their types and what each one means. It sets quality rules and how fresh the data will be. It names an owner to contact. The contract is kept as a file, and checks enforce it on every change. A change that would break it must be agreed first.

Example code

yaml
models:
  - name: orders
    config:
      contract:
        enforced: true
    columns:
      - name: order_id
        data_type: int
        constraints:
          - type: not_null
A dbt model contract. The build fails if the table's columns or types drift from this file.
The contract sits between maker and user. A breaking change stops there until both sides agree.

Common mistake

Writing the contract as a page nobody checks. Without a test in code, it drifts from the truth within weeks.

Key takeaways

  1. 1
    Maker and user. Both sides agree the terms.
  2. 2
    Shape and quality. Columns, types, rules and freshness.
  3. 3
    Enforced in code. Checks fail on a breaking change.