The Four Places to Put Data Contracts in Your Data Architecture

A data contract is one file, but it earns its keep at four gates in your data architecture: at the supplier, on ingest, on delivery, and in CI/CD. Where each one sits, what it checks, and what happens when it fails.

Written by Chris Bergh on November 30, 2026

Data Quality DataOps TestGen Open Source DataOps Data Contracts
The Four Places to Put Data Contracts in Your Data Architecture

Key points

  • A data contract earns its keep at four gates in a data architecture: at the supplier, on ingest, on delivery, and in CI/CD. Each gate has its own failure action.
  • At the supplier, the supplier runs your contract before the file leaves their building. It only works with open source, because no supplier buys a license to prove their own file is right.
  • On ingest, run the contract the moment data lands in bronze and check data quality plus freshness, volume, and schema. A failing file goes to quarantine, and the supplier gets the failed terms.
  • On delivery, run the contract on the gold tables before the export or feed goes out. If the contract fails, the export does not ship.
  • In CI/CD, every pipeline change runs the contracts for the tables it touches, in a test environment with yesterday's data and today's code, and merges only if green.
  • Start by bookending your pipelines with one contract at the supplier and one on delivery. A coverage floor of 3 tests per table plus about 2 per column comes to about 430 tests for ten tables of 20 columns each.

Where a data contract runs

Most writing about data contracts argues about what goes in the YAML. The more useful question is where you run it.

Webinar slide, One contract, four gates: at the supplier, on ingest, on delivery, and in CI/CD, each with what happens when the contract fails
From the webinar: one contract, four gates, each with its own failure action.

Picture your architecture the way DataKitchen draws it, as the DataOps “T” diagram. Data flows left to right: from suppliers, through your landing zone and your bronze, silver, and gold layers, out to consumers (apps, models, dashboards, AI). Code flows up from the bottom into production. A contract is one file, and it earns its keep at four gates on those two flows: at the supplier, on ingest, on delivery, and in CI/CD. In an earlier post, Data Contracts Are Communication for Data Teams Who Dislike Each Other, I covered the who. This post covers the where.

The T has two flows, and they need different checks. Data moves left to right through the value pipeline to consumers, and it needs tests that tell you whether today’s data is right. Code moves up into production through development and testing, and it needs tests that tell you whether a change broke something. That is DataOps in one picture.

Where is the better question because the same file does different jobs in different places. A contract is a description with teeth: the tests are its terms and conditions, and they check the data against what the description promises.

The 1:10:100 rule from manufacturing explains where the gates sit. A problem caught at the source costs 1. Fixed after it’s created, it costs 10. Once it reaches a customer, it costs 100. A contract is “a description that tells you whether it’s working or not,” so you run it early, which is the idea behind shifting left and shifting down. Each gate also has its own failure action, and that’s what makes the four different from each other.

Here are the four, with what each does when it fails. The supplier fixes the file. Ingest quarantines it. Delivery holds the export. CI/CD breaks the build.

Gate 1: At the supplier, before the file leaves their building

Your supplier sends you data once a day or once an hour. It’s amazing how many data suppliers don’t check whether their own data is right.

Webinar slide, gate 1 of 4: At the supplier, before the file leaves their building. Send the supplier the tool and the contract
Gate 1: the supplier runs your contract before the file leaves their building.

So create a contract, send it to them with a link to the open source tool, and say “run this every time before you give it to me.” Now both sides check the same thing. If they find a problem first, they fix it.

When it fails, the supplier fixes the data and you never see the bad file.

This gate only works with open source. No supplier buys a license to prove their own file is right. And if they don’t like the tool, they can pick another contract tool, because the contract is a standard: the Open Data Contract Standard (ODCS).

Most DataKitchen customers have 50 to 100 data sources and maybe a dozen suppliers. “Data suppliers forget that you exist.” A contract in their hands reminds them, and you stop playing goalie for somebody else’s mistakes. I think this is where the biggest value in data contracts will be.

Gate 2: On ingest, the moment it lands

Gate 2 is the second line of defense. You need it when your supplier won’t run a contract, when you don’t trust them, or when you want to know the delivery came on time.

Webinar slide, gate 2 of 4: On ingest, the moment it lands. Test data quality, freshness, volume and schema in bronze
Gate 2: the contract runs the moment the data lands in bronze.

Test the data the moment it lands in bronze. Maybe it’s the same contract you gave the supplier. Test data quality and delivery monitoring together: freshness, volume, and schema. Those are the data observability checks, and they belong in the same file as the quality rules.

When it fails, the file can go to a quarantine table. It does not flow into silver and gold. The supplier gets the failed terms. “Stop the line.”

Gate 3: On delivery, prove what you shipped

You could put a contract at the end of every layer: bronze, silver, and gold. That can work. I prefer the final one.

Webinar slide, gate 3 of 4: On delivery, prove what you shipped. Run the contract on the gold tables before the customer delivery
Gate 3: the contract runs on the gold tables, and a failing export doesn't ship.

Run the contract on the gold tables, the integrated, customer-ready form, before the export or feed goes out. When it fails, the export doesn’t ship.

The contract is the receiving team’s spec sheet and your receipt. Over the years my teams have said, “I ran 10,000 checks on this data. I know you think the data is wrong. Tell me exactly what’s wrong.” That sentence changes the conversation. (More on the contract as your receipt in another post.)

And when a customer does find an error, love your errors. Add a new term to the contract together, so it gets caught next time. Data teams sit between a rock and a hard place, with suppliers sending bad data and consumers wanting everything yesterday. This gate is how you stop absorbing both.

Gate 4: In CI/CD, break the build, not the dashboard

This gate sits on the code flow, not the data flow. Everything is green. Then a customer asks for a change: you modify a schema, add a data set, or change a calculation.

Webinar slide, gate 4 of 4: In CI/CD, break the build, not the dashboard. Run the contracts for the tables a change touches before merge
Gate 4: the contract runs on every pull request, and a failing change doesn't merge.

How do you prove the change works and that you haven’t caused a regression? You test the code change with realistic data. Run the pipeline in development with yesterday’s data and today’s code, and the contract proves they work together.

Every pipeline change runs the contracts for the tables it touches, in a test environment, before merge. It merges only if green. When it fails, the build breaks, not the dashboard.

Here the tests in the contract matter more than the description. The prose tells a human what the table is for. The tests tell the pull request whether you broke it. “Five minutes in a pull request beats a Monday in production.” Contract results are evidence, and a failed run is evidence you got for free.

Where to start

Could there be more places? Bronze, silver, gold, “titanium” levels? Perhaps. But these four are the place to start.

My favorite is to bookend your pipelines: one contract at the supplier and one on delivery. If you can’t get the supplier to run it, run it yourself on ingest and on delivery.

What if the supplier refuses? “You just run it for them. You can lead a cow to water but you can’t make it drink.” With a contract on your side, you check the data the instant it arrives.

Who owns the contract, the producer or the consumer? Both. If the consumer can edit and version it to improve quality, why wouldn’t the producer want that?

To measure each gate, start with the simple facts: did it pass or fail, and which term failed (table, column, threshold). Then track pass rate per contract over time, and coverage. The rule of thumb from the webinar for a coverage floor is 3 tests per table (freshness, volume, and schema) plus about 2 per column. Ten tables of 20 columns each comes to about 430 tests. For the longer argument, read the definitive guide to test coverage.

Put a gate in the fence

Nobody wants to write 430 tests by hand, and with open source TestGen you don’t. In the webinar demo on the Jaffle Shop sample data, six tables, TestGen generated about 80% of the contract’s tests in about 60 seconds from profiling. An LLM working through the TestGen MCP server took it toward 90%, and business users added the last terms in the UI. The same contract file runs at all four gates. Install TestGen or watch the webinar. Good fences make good neighbors: let your contract be your fence, and put a gate in it.


FAQ

What are the key points in this blog?

A data contract is one file that earns its keep at four gates. At the supplier, the supplier runs it before the file leaves their building. On ingest, it checks quality, freshness, volume, and schema the moment data lands in bronze. On delivery, it runs on the gold tables, and a failing export does not ship. In CI/CD, a pipeline change merges only if the contracts for the tables it touches pass.

Where should data contracts run in a data pipeline?

Run a data contract at four places: at the supplier before the file is sent, on ingest when the data lands in bronze, on delivery against the gold tables, and in CI/CD before a code change merges. The first three sit on the data flow of the DataOps T diagram, and the fourth sits on the code flow. Start with one at the supplier and one on delivery.

What happens when a data contract fails on ingest?

When a contract fails on ingest, the file can go to a quarantine table instead of flowing into silver and gold, and the supplier gets the failed terms. The ingest contract checks data quality and delivery monitoring together: freshness, volume, and schema. It is the second line of defense when a supplier will not run the contract or you do not trust the delivery.

Why run a data contract in CI/CD?

Running a data contract in CI/CD catches regressions before customers do. Every pipeline change runs the contracts for the tables it touches, in a test environment, with yesterday’s data and today’s code, and merges only if green. A schema change, a new data set, or a changed calculation breaks the build instead of the dashboard. Five minutes in a pull request beats a Monday in production.

What if my data supplier refuses to run the contract?

Run it for them. With a contract on your side, you check the data on ingest, the instant it arrives, and send the supplier the terms that failed. Getting suppliers to run the contract themselves works best with an open source tool, because no supplier buys a license to prove their own file is right.

Who owns a data contract, the producer or the consumer?

Both. Treat a data contract as shared ownership between producer and consumer. If the consumer can edit and version the contract to improve quality, the producer gets better terms without writing them alone. When a customer finds an error the contract missed, add a new term together so the next delivery catches it. The contract becomes a point of collaboration instead of blame.

Install Open Source TestGen Free, no vendor lock-in Request a Demo See TestGen Enterprise in action
Chris Bergh

Chris Bergh

CEO and Head Chef at DataKitchen. He is a leader of the DataOps movement and is the co-author of the DataOps Cookbook and the DataOps Manifesto.

LinkedIn →