How-To Guide

How to Layout a Medallion Lakehouse

Organise a lakehouse into bronze, silver and gold layers, with clear responsibilities, contracts and reprocessing so each layer earns its keep.

On this page

  1. Introduction
  2. The Three Layers and Their Jobs
  3. Bronze: Fidelity and Immutability
  4. Silver: Cleaning with Contracts
  5. Gold: Business Aggregates with Owners
  6. Lineage and Reprocessing
  7. Cross-Cutting Concerns
  8. Common Pitfalls and Conclusion

Introduction

A lakehouse without a layout becomes a swamp: raw files, partially cleaned tables and business aggregates mixed together, with no one sure which table is trustworthy. The medallion architecture gives the data lake a shape: a bronze layer that holds data as it arrived, a silver layer that holds cleaned, conformed data, and a gold layer that holds business-level aggregates. Each layer has a clear job, a clear contract with the next, and enough lineage that you can reprocess any layer from the one below it.

The Three Layers and Their Jobs

Bronze is the raw landing zone: data as it arrived, immutable and append-only, a faithful record of what the source sent. It is not cleaned or typed beyond what the format requires. Its job is fidelity and replayability: you can always rebuild everything above it from bronze.

Silver is cleaned, conformed data: deduplicated, typed, validated, joined into entities that make sense across sources, but not yet aggregated for a specific business question. Gold is the business layer: aggregates and marts shaped for reporting and analytics, often per domain or per use case. The rule of thumb is that each layer should be queryable on its own and answer a different class of question.

# lakehouse layers
bronze: raw arrival, immutable, append-only; fidelity + replay
silver: cleaned, typed, deduped, conformed entities; cross-source truth
gold:   business aggregates/marts per domain; ready for BI
# each layer is queryable and answers a different class of question
# you can rebuild any layer from the one below it

Bronze: Fidelity and Immutability

Bronze should not transform beyond what is needed to store. Keep the original payload, the ingestion timestamp and the source metadata, and do not overwrite. If a source sends a correction, it is an additional record with a later timestamp, not an update to the earlier one, because the earlier record is the evidence of what arrived.

Store bronze partitioned by arrival time, not by the event time inside the data, because the question bronze answers is “what did we receive, and when”. Partitioning by arrival time also means late data does not force rewriting old partitions. Compress and keep it cheap, because bronze is often the largest layer.

# bronze table shape
bronze.events_raw(
  _ingested_at   timestamp,     -- arrival time (partition key)
  _source        string,        -- which source/feed
  _raw           string/json,   -- the payload as received
  _source_offset string         -- position for idempotent replay
)
PARTITIONED BY (_ingested_at date);   -- arrival, not event time

Silver: Cleaning with Contracts

Silver does the real work: parse, type, deduplicate, validate against expectations, and conform entities so a customer is the same customer across sources. Because silver is where correctness is established, it should reject or quarantine records that fail validation rather than silently passing them, and the quarantine is inspectable.

Each silver table has a contract with its consumers: the columns, their meanings and the update semantics. Gold depends on silver, so a change to a silver column is a breaking change to gold; version or extend silver rather than silently changing a column’s meaning. The contract is what makes the layering safe rather than a chain of accidental couplings.

-- Silver: dedup and validate; quarantine failures instead of dropping.
CREATE TABLE silver.orders AS
SELECT order_id, customer_id,
       CAST(amount AS DECIMAL(18,2)) AS amount,
       status, created_at
FROM (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY order_id ORDER BY _ingested_at DESC) AS rn
  FROM bronze.orders_raw
  WHERE order_id IS NOT NULL           -- basic validity
) t
WHERE rn = 1;                            -- latest record per order id

Gold: Business Aggregates with Owners

Gold tables are shaped for a question: daily revenue by region, active users, fulfilment time. Each gold table should have a named owner and a documented definition, because a number that means something ambiguous to three teams is worse than no number. Gold is where semantic disputes live, so make the definition explicit.

Keep gold narrow and purpose-specific rather than one giant wide table. A gold table that answers one domain’s questions is cheaper to maintain and clearer to consume. When a new domain needs an aggregate, build a new gold table from silver rather than adding columns to an existing one until it serves everyone and pleases no one.

-- Gold: a domain aggregate with a clear definition and owner.
CREATE OR REPLACE VIEW gold.daily_revenue AS
SELECT date_trunc('day', created_at) AS day,
       region,
       SUM(amount)  AS revenue,
       COUNT(*)     AS orders
FROM silver.orders
WHERE status = 'paid'                  -- definition: paid orders only
GROUP BY 1, 2;
COMMENT ON VIEW gold.daily_revenue IS 'Owner: finance-analytics. Revenue = sum of paid orders by region/day.';

Lineage and Reprocessing

The value of the layering is that you can reprocess any layer from the one below. A bug in the cleaning logic is fixed by re-running silver from bronze, then gold from silver, without touching bronze. That property requires each layer to be a deterministic function of the layer below, so a re-run produces the same result.

Record lineage: which bronze data produced which silver rows, and which silver produced which gold. Idempotent writes keyed on a natural key let a re-run replace rather than duplicate, and a partition-level recompute lets you fix only the affected dates. Without determinism and idempotency, reprocessing a layer corrupts the ones above it.

# reprocessing property
bronze (immutable) -> silver (deterministic from bronze) -> gold (from silver)
# a fix at silver: re-run silver partition, then gold partition
# requires:
[ ] silver is a pure function of bronze (same input => same output)
[ ] writes are idempotent (upsert/overwrite partition, not append)
[ ] partition-level recompute so only affected dates are rebuilt

Cross-Cutting Concerns

Quality checks belong at each boundary: validation when moving bronze to silver, and reconciliation when moving silver to gold. A failed check should stop promotion rather than letting bad data flow upward. This is the same assertion discipline as in a pipeline, applied per layer.

Access control should follow the layers: bronze may be locked down because it contains raw sensitive data, silver is where sensitivity is classified and masked, and gold is broadly consumable. Classifying sensitivity at silver means gold inherits a known posture rather than an unknown one, and the raw data stays behind stronger controls.

# per-layer concerns
bronze: strongest access control (raw, possibly sensitive); cheap storage
silver: validation + dedup + classification/masking; the correctness layer
gold:   broad consumption; reconciliation checks before promotion
# quality gates at each boundary; a failed gate stops the promotion

Common Pitfalls and Conclusion

Do not let bronze transform beyond storage; fidelity is its purpose. Do not put business logic in silver; conform, do not aggregate. Do not build one giant gold table for everyone. Do not change a silver column without treating it as a breaking change for gold. And do not reprocess a layer without idempotent writes, or the layer above becomes wrong.

The medallion layout gives a lakehouse a shape: bronze for fidelity and replay, silver for cleaned and conformed truth, gold for business aggregates with owners. Each layer is queryable, each has a contract with the next, and each can be rebuilt from the one below because the transformations are deterministic and the writes are idempotent. Then the lake is navigable rather than a swamp.

Sources: Databricks: Medallion architecture, Delta Lake: Table design, Apache Iceberg: Table format.

FAQ

Why keep bronze if silver has the cleaned data?
For fidelity and replay. Bronze is the immutable record of what arrived, so when the cleaning logic changes you rebuild silver from bronze without re-ingesting from the source. Without bronze you cannot reprocess past data.
What goes in silver versus gold?
Silver holds cleaned, typed, deduplicated, conformed entities with no business aggregation. Gold holds business-level aggregates and marts shaped for a specific question. Keep the boundary: conform in silver, aggregate in gold.

Related Examples