Pre-mortem exercise: assume a nightly load has failed badly six months from now, and write the headlines. These are hypothetical, but I think each one is common. Next to each is the cheapest check I’d add.
1. “Revenue is double on Tuesdays”
Likely cause: a rerun after a failure inserted the same rows again.
Check: make the load idempotent (merge/upsert on a key, or replace a whole partition), and compare row counts by key after each run.
2. “Yesterday’s numbers are missing”
Likely cause: the source delivered late, and the job ran on whatever was there.
Check: a freshness check on the source (latest timestamp or file arrival) before the job starts, with a clear fail or wait.
3. “The job succeeded, but every value in a column is NULL”
Likely cause: the upstream renamed a column, and a lenient parser filled it with NULL.
Check: validate the schema (names and types) at ingest, and alert if the null rate of a column jumps compared with the previous runs.
4. “The load succeeded with zero rows”
Likely cause: an empty file or an empty query result counted as success.
Check: a minimum row count, or a comparison with the recent average, as a gate between extract and load.
5. “Daily totals are off by a few percent near midnight”
Likely cause: the source stores UTC, the report assumes local time (or the reverse), so some rows fall on the wrong day.
Check: state the time zone of each timestamp column in the pipeline, and test the day boundary with rows just before and after midnight.
6. “A backfill overwrote corrected data”
Likely cause: the backfill reloaded history from the source, replacing manual fixes made downstream.
Check: keep a dry-run mode that reports what would change, and require a row-level diff or count of changed rows before the write.
A pattern across these: most checks are cheap (a count, a null rate, a max timestamp), and most failures were silent, not loud. A job that fails loudly is easier than one that succeeds with wrong data.
Where I’d stop: I wouldn’t add every check to every table. Pick the few tables whose wrong numbers would cause the most damage, and start there.
Which headline would you add, and what check would have caught it?