Özer Cem KELAHMETKELAHMET
AI Simulations · Data management

Medallion architecture in action: bronze, silver, gold and a quality gate

Fourteen days of an orders feed flow through bronze, silver and gold. Change the quality gate and the deduplication rule and watch which days reach the gold tables, how many rows survive each layer and where the data is lost.

Download Markdown

Interactive simulation. It needs JavaScript; the text below explains what it shows.

What you are looking at

Each row of the table is one day of an orders feed: the rows that landed, how many were duplicates from retries and replays, and how many failed validation. The orange columns follow each day through the layers: its share of bad rows, the rows that make it into silver, whether the day passes the quality gate, and the rows published to gold.

On the chart, the white dots are the rows landed in bronze each day and the orange rings are the rows published to gold. A ring on the bottom line is a day the gate held back. The dashed line is the trend of bronze volume. The bar chart below shows each day's share of invalid rows, which is what the gate compares with its limit.

The algorithm

The medallion architecture organises a lakehouse into three layers of tables, usually stored in an open table format such as Delta Lake or Apache Iceberg.

Bronze stores data exactly as it arrived, append only. Nothing is cleaned or dropped, so any later mistake can be fixed by reprocessing from bronze, and auditors can always see what the source sent.

Silver is the cleaned, conformed version. The pipeline removes duplicates, using a business key and the latest version of each record, and validates every row against rules such as required keys, valid dates and non-negative amounts. Failing rows are quarantined in a separate table rather than silently deleted, so they can be inspected and replayed.

Gold holds tables shaped for use: aggregates, star schemas and features for reports and models. Because people make decisions on gold, many teams put a quality gate in front of it: if a load looks wrong, for example too many invalid rows, it is held for review instead of published.

With the defaults, 678,134 rows land in bronze. Removing duplicates (1.8% of bronze) and invalid rows leaves 659,114 rows in silver. Days 4 and 9 have 2.92% and 4.83% invalid rows, above the 2% gate, so they are held, and 559,507 rows reach gold: a yield of 82.5%. The two held days are not lost; they wait in silver until someone fixes the source problem or approves them.

Things to try

  • Raise the gate to 5% and every day passes: gold gets more rows, but also the days with broken data.
  • Lower it to 0.4% and every one of the fourteen days is held: a gate that is too strict blocks the business as surely as a broken pipeline.
  • Keep duplicates and watch silver grow to 671,412 rows; on day 12 a replay sent 4,100 duplicate rows, about six times a normal day.
  • Paste your own daily load counts and duplicate and reject counts from your pipeline's logs to set a gate that would have caught your past incidents.
  • Download the results CSV to keep the day-by-day reconciliation.

How it works in real systems

A good gate compares each load with the history of the feed rather than with a fixed number: the share of invalid rows, the row count against the trend (the dashed line), the freshness of the newest record and the distribution of key columns. A load that is far outside the usual range is the signal, whatever its absolute size.

On Databricks, the layers are typically Delta tables built with Lakeflow Declarative Pipelines (formerly Delta Live Tables), where expectations declare row rules and choose whether to warn, drop or fail. On Snowflake, the same pattern is built with staged loads, streams and tasks or with dbt models and dbt tests. Tools such as Great Expectations and Soda add volume, freshness and distribution checks, and data contracts with the source team stop many bad loads before they land.

Sources

Last updated Nov 23, 2026
Type to search.
    ↑↓ navigate↵ open