cleandataengineering.aiData Platform, from the big picture to the code
You are here: Start here › Silver to gold › Write-audit-publish

Data PlatformZoom level 2

Write, audit, publish: never show anyone data that has not been checked

Write-audit-publish is a way of never showing anyone half-checked data. New gold is built where nobody is reading, checked there, and only swapped in if the checks pass. If they fail, users keep seeing the last good version and nobody has to undo anything.

New datafrom the inputs atpinned versions1. Writeinto a staging tablenobody reads2. Auditcounts, totals, keys,known answers3. Publishone atomic swapinto goldGoldwhat users readAudit failednothing is swapped,alert is raisedLast good goldkeeps being servedpassesfails
The new data is written to a staging table. The audit decides. Only a pass swaps it into gold.

The three steps

StepWhat happensIn our gold
WriteThe new result is built into a table that no report reads.The gold harness builds the windows and dimensions into a staging table, not into gold.
AuditChecks run against the staging table, and nothing else can be affected.Row counts and control totals against an independent query on the inputs at the same pinned versions, key checks, no orphaned members, the semantic layer's known answers.
PublishOne step makes the staging table the live one. It either happens completely or not at all.A swap of what the gold name points to (for example a view pointing to the new table, or a branch fast-forward in Iceberg).

Why it matters more when the silver is not ours

With our own silver, we control the inputs, so a bad input means a bug in our own stages that our tests should catch. With a virtual silver (Integration map) the inputs are a provider's tables that can change at any time. The input gate checks the inputs, and write-audit-publish checks the result. Together they mean a provider mistake stops a run before it reaches a report, and gold keeps serving the last good version.

It is not only for virtual silver. Every gold build benefits: a bug in our own join, a late file, or a wrong mapping is caught in the audit, not by a user.

Where the idea comes from

Netflix described it around 2017. It is now common with Apache Iceberg, where a branch plays the part of the staging table and publishing is a fast-forward of the branch onto the main table. AWS, Dremio and Tabular all document it. On Delta tables the same effect comes from a staging table and a swap of what the live name points to.

What it does not do

LimitWhat it means
It cannot find a rule nobody wrote downAn audit checks what we thought to check. A wrong business rule in the provider's data passes if no check names it.
Stopping is still an outage of freshnessUsers see the last good gold, which gets older until someone fixes the cause.
Several tables published togetherOne swap per table is not one swap for all. A set of dimensions and facts needs the swap to be treated as one step, or a catalog that can switch many tables together.
Not built yet, or known gaps
  • Today the gold harness writes straight into the gold tables, replacing windows in place. A failed audit after that write cannot be undone with one step. So this is not yet write-audit-publish.
  • There is no staging build, audit step or swap in the platform. It is stage P4 of the virtual silver proof plan.
  • The audit's checks exist in pieces (reconciliation, key checks, known answers) but not as one gate in front of publishing.