All patterns
ReliabilitySnowflakeAWS

An audit ledger for every pipeline run

One row per run, one row per unit of work, a handful of canonical statuses, and a rule that nothing is finished until downstream has confirmed it. Reruns become idempotent and a backfill is just running it again.

The problem
Pipelines that fail quietly, half-load a day, or get rerun by hand with no record of what already landed.
The outcome
Operators can answer who loaded what and when from one table; failed loads self-heal on the next trigger; backfills need no special mode.

The problem

Most ingestion pipelines report success when the function that ran them exited cleanly. That is the wrong question. The right one is whether the data is sitting where the business reads it, and whether anyone can tell afterwards which files, stores or days were covered by which run.

The pattern

Every pipeline writes to the same two tables.

  • One run row per invocation: a run id that encodes the trigger, the pipeline and the UTC timestamp; the mode (incremental or backfill); the request and result payloads; unit counts; and an error summary that names the affected units.
  • One unit row per piece of work (a file, a store, a table): what was extracted, what was loaded, how long it took, and a details column for anything the source makes you care about.
  • Canonical statuses only. Terminal: success, success_no_data, partial_success, failed. Non-terminal: running, processing. Notifications and reports are built on these words, so nobody invents new ones.
  • A run stays non-terminal until downstream processing is confirmed. When the landing pattern is stage table, stream and triggered merge task, the loader waits until the stream has drained or the task history shows a failure. “The task ran” is not the success criterion; “the stream is empty” is.
  • Unit selection is ledger-driven and claim-guarded. The next run selects units with no successful row, claims each one with a processing row before touching it, and treats stale claims as abandoned. Two overlapping invocations cannot double-process the same file.

What it changes

Reruns are safe by construction, so on-call can rerun first and investigate second. Backfill is not a mode; it is the same run with a date range. Vendor outages and late deliveries are picked up automatically because the ledger, not a cursor, decides what is still owed.

What carries over

Start with the two tables and the status vocabulary. Add the claim guard the first time two runs overlap. Resist adding a third table until the first two have been boring for a quarter.

Want this in your warehouse?

We can usually tell from one conversation whether the pattern fits and what it would take.

Start a conversation