Part D · Chapter 17 · Trust

17. Data quality 3: gates in the pipeline

Checks belong in the pipeline, at the gates between its layers: a bad row is set aside, a bad batch stops the load, and an unusual but true row passes with a warning. Beside the gates, data observability watches the loads themselves.

Records meeting the gates between layers
Playback speed

The clip sends Kestrel's nightly claims through the medallion layers. All of them land in bronze as they arrived. At the silver gate, claims with no reported date or an unknown cause are quarantined, with their keys; at the gold gate, impossible reserves and claims on a missing policy are quarantined and the late reports pass with a warning; the rest reach gold. On another night, one day's payments arrive twice and the gate stops the load. Last, four monitors watch a week of loads, and Saturday's reserves in euros pass every gate but not the distribution monitor.

The idea: three actions at each gate, and monitors beside them

In a medallion platform (chapter 26), data moves from bronze (as it arrived) to silver (typed, checked, conformed) to gold (what reports read). Each move is a gate where rules run, and each rule does one of three things when rows fail:

  • Quarantine: set the failing rows aside, with their keys and the rule they failed, for the steward to fix; let the rest through. For defects in single rows.
  • Stop the load: let nothing through until someone looks. For a whole batch that is wrong (a file loaded twice, half the rows missing), where delivering the rest would give a wrong total.
  • Warn: let the rows through and flag them. For data that is unusual but true, such as a claim reported late.

Gates check records. Data observability watches the pipeline: is the data fresh (did tonight's load arrive on time?), is the volume normal, is the schema the one agreed, is the distribution of values the usual one? A batch can pass every rule and still be wrong.

Remember Quarantine bad rows, stop a bad batch, warn on the unusual but true; and watch freshness, volume, schema and distribution beside the gates.

A worked example: Kestrel's claims through the gates

Of 40 claims landed in bronze, 5 are quarantined at the silver gate and 4 at the gold gate; 2 late reports pass with a warning, and 31 claims reach gold. Nothing good was held back, and nothing bad got through.

Kestrel's claims at each gate
GateArrivePassQuarantinedWith a warningQuarantined keys
Silver4035505, 17, 21, 26, 38
Gold3531429, 15, 28, 31

And the week of loads beside the gates, with what each monitor found:

A week of Kestrel's nightly loads
NightArrivedRowsColumns as agreedMedian reserveAlert
Monday01:4840Yes€8,750No alert
Tuesday07:4041Yes€8,750Freshness
Wednesday01:5139Yes€8,750No alert
Thursday01:4518Yes€8,750Volume
Friday01:5042No€8,750Schema
Saturday01:4740Yes€88Distribution
Sunday01:5238Yes€8,750No alert
Try this In the Quality workbench, switch to Kestrel and set the rule that a claim's policy exists to stop the load at silver: nothing reaches gold.

Why it matters for Alex

The combined lakehouse will load both companies every night. Without gates, Kestrel's bad rows reach the board pack; with gates that stop on everything, the board pack is empty every other morning. Alex designs which rule sits where and what it does, so that bad data is held back and good data still arrives.

The monitors protect against what no rule was written for: the feed that arrived late, the column someone renamed, the unit that changed.

Where it goes wrong

  • Stopping on everything. Two bad claims hold back thirty-eight good ones. Quarantine rows; stop only for a bad batch.
  • Quarantine nobody empties. Set-aside rows need an owner and a deadline (chapter 16), or they are lost data.
  • Checking only at the end. A check at gold finds the problem after every layer has copied it. Check structure and validity at silver, business rules at gold.
  • Gates without monitors. Rules see rows, not the absence of rows: an empty file passes every rule.

Exercises

The lab checks each one against facts written down in advance, so any answer the brief allows passes. A pass is kept in this browser.

Place each rule at a gate

Last night nothing of Kestrel's claims reached gold: the rule that a claim's policy exists was set to stop the load, and two claims point at a policy that does not exist. Place Kestrel's claims rules at the silver and gold gates so that claims with no reported date, an unknown cause, an impossible reserve or a missing policy are set aside, every other claim reaches gold, and the late reports (true claims, reported late) arrive with a warning.

The lab checks that:

  • Every claim without one of those defects reaches gold, the late reports included.
  • No claim with a missing reported date, an unknown cause, an impossible reserve or a missing policy reaches gold.
  • The late reports reach gold with a warning.
Open the brief in the Quality workbench, change where each rule sits and what it does until the brief is met, and press Check there.

Quarantine, stop or warn?

Each line is something a gate finds in tonight's load. Choose what the gate should do.

Two claims name a policy that does not exist.
Every payment of one day is in the file twice.
Two claims were reported months after the loss, but correctly.
Tonight's file has half the usual number of rows.
One claim has a cause code nobody knows.

Which monitor raises the alert?

Look at the week of Kestrel's loads in the chapter (when each arrived, its rows, its columns, its median reserve). For each night, choose the monitor that raises an alert, if any.

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

On Azure

Checked against Microsoft's documentation on 18 October 2026.

On Azure, gates are written in the pipelines that move data between the layers:

  • Azure Databricks: Lakeflow Declarative Pipelines (formerly Delta Live Tables) declare expectations on each table, and each expectation warns (keeps the rows and records them), drops the failing rows, or fails the update: warn, quarantine and stop. A quarantine table is one more table fed by the failing rows.
  • Microsoft Fabric: notebooks and pipelines run the checks in SQL or PySpark, write failing rows to a quarantine table in the lakehouse, and stop the pipeline when a batch-level check fails.
  • Observability: Azure Monitor and Log Analytics alert on pipeline runs (late, failed, row counts); Microsoft Purview's data quality checks freshness on a schedule; Azure Databricks can monitor a table's statistics and their drift.

Record every quarantined row with the rule it failed and when, so the steward's queue is a table, not an email.

Take it to work

Gate design

Decide, for one table, which rule sits at which gate and what it does.

The table

  • Which layers does it pass through, and who reads each?

The rules

  • For each rule: silver or gold?
  • Quarantine, stop or warn, and why?

Quarantine

  • Where do set-aside rows go, who empties it, and by when?

Monitors

  • Freshness: by when must it arrive?
  • Volume, schema and distribution: what is normal?
  • Who is alerted?

Tools in this chapter

  • Quality workbench · Write quality rules, set thresholds, inject defects, and see the scores per dimension and per domain.

Terms taught here: Quality gateQuarantineData observability

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to the Cloud Data Architecture Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.