Data contracts: who owns the number
A scene that will be familiar. Three dashboards say the company had 1.2 million, 1.4 million and 980,000 active users last month. Each was built by a competent team from the same underlying data. A meeting is convened to decide which is right, and it cannot, because "active user" is defined in SQL, in three places, by three people, two of whom have left.
This is not a tooling failure. It is the predictable result of derived data having no contract, and it is the tier's last lesson because everything above creates copies — and a copy without an owner drifts.
Why data breaks differently from APIs
Here is the asymmetry that makes this worth a lesson of its own.
When an API breaks, something returns a 500. Someone is paged, a dashboard turns red, the deploy is rolled back within the hour. The failure is loud.
When a pipeline breaks, a column is null. Nulls aggregate perfectly well — AVG skips them, SUM treats them as nothing, and the chart keeps drawing a smooth line. The number is simply wrong, by 4%, for six weeks, until somebody notices the trend does not match their intuition. Nothing pages, because nothing failed.
So the discipline runs the opposite way to intuition. Data needs more contract enforcement than APIs, not less, precisely because it lacks the crash that would otherwise tell you.
The structural cause: reading a database that made no promises
Most pipelines start the fastest way — point the extraction tool at the production database and read the tables. Which means 5.03's problem, again, with a longer fuse: the schema became an API nobody designed, and now the analytics plane is a reader the owning team does not know exists.
A backend engineer renames status to state on Tuesday. Their tests pass, their service is fine, no consumer complained. On Wednesday, revenue-by-status is quietly wrong. The engineer did nothing unreasonable; the coupling was invisible to them, and nobody was ever told they were a producer.
What a data contract actually contains
Not a document. A checked artefact, with five parts:
- Schema — fields, types, nullability. The mechanical part, and the only part most teams get to.
- Semantics — what the field means, in prose, versioned with the schema. "Active user: distinct user with at least one authenticated request in the trailing 28 days, excluding internal accounts and automated traffic." That sentence is the artefact the opening meeting was missing.
- An owner — a team, not a person. The team that produces the data, which is the important part below.
- An SLA — freshness ("by 06:00 daily") and completeness ("at least 95% of yesterday's rows"). Without numbers, "the data is late" is an argument rather than an incident.
- A change process — additive changes ship freely; breaking changes need a version and a notice period. Tier 1's schema evolution, applied to a producer who did not know they had consumers.
Enforcement, weakest to strongest
- Documentation. A wiki page describing the schema. Correct on the day it is written. Useful only alongside something below.
- A schema registry with compatibility checks in CI. The producer's build fails when a change would break a registered consumer. This is the first rung that actually works, because it moves discovery from Wednesday's dashboard to Tuesday's pull request.
- The producer emits events instead of exposing tables. The strongest version. Rather than change data capture scraping whatever the schema happens to be, the service publishes
OrderCompletedwith fields it deliberately chose — an interface it knows it owns. Internal refactoring stops being a downstream event, because the internal schema is no longer the contract. - Quality tests as pipeline gates. Freshness, row counts against expectation, null rates, referential checks, distribution shifts. Crucially, a failed check must stop the pipeline, not log a warning. Serving no number is recoverable; serving a wrong number that people act on for six weeks is not.
Define the metric once
Schemas stop fields disappearing. They do nothing about the opening scene, because all three teams read valid columns and computed different things. That needs a semantic layer: metric definitions written once, in one place, that every dashboard and notebook computes from — so "active users" resolves to one expression regardless of who asks. It is unglamorous and it is the fix, because the alternative is a definition copied into every tool that touches it, diverging from the moment it is pasted.
Ownership sits with the producer
The instinct is to let the data team own data quality. It fails structurally: the data team cannot prevent the breakage, only discover it — usually last, usually from a stakeholder. Every incident is someone else's change and their emergency.
The contract belongs to the producing team, because they are the only ones who can honour it. When a service publishes an event with a schema, an owner and an SLA, breaking it is their build failing, not somebody else's Wednesday. Strip data mesh of its vocabulary and this is the one claim worth keeping: the team that generates the data owns it as a product, with consumers they are accountable to. Conway's law, in 14.05, has already explained why the alternative cannot work.
The data team quietly patching bad data in the pipeline — a COALESCE here, a hardcoded mapping for the three known-broken values there. It makes today's number right, and it guarantees the producer never finds out, so the patches accumulate into a layer that is now the real definition of the business: undocumented, in SQL, owned by whoever has not left yet. The fix is to let it break loudly and route the alert to the team that caused it. That is uncomfortable exactly once per producer, which is the point.