Stackbook Logo
data-stateestablished · medium operational burden

Medallion Architecture

Also known as: bronze-silver-gold, multi-hop-architecture

Intent

Organize lakehouse data into progressively refined bronze, silver and gold layers.

Problem

Raw data lands in a lake in many shapes, and consumers query it directly with inconsistent cleaning and business rules. Quality problems surface in dashboards instead of at ingestion.

Forces

  • •Preserve raw data for replay versus provide clean data fast
  • •Shared cleaning logic versus team-specific marts
  • •Storage cost of multiple copies versus recompute cost
  • •Clear quality guarantees per layer

Solution

Overview

Medallion architecture, popularized by Databricks, is a layering convention for lakehouse tables. Bronze is raw, silver is validated and conformed, gold is curated for consumption. Each layer has a defined quality bar and owner.

How it works

Ingestion appends records exactly as received, plus load time and source file. Silver jobs read bronze incrementally, apply rules, and merge into keyed tables. Gold jobs aggregate for dashboards, ML features or data products.

sources --> BRONZE (raw, append-only)
        --> SILVER (deduped, typed, validated)
        --> GOLD (aggregates, star schemas)

A typical silver step in SQL:

MERGE INTO silver.orders s
USING (SELECT * FROM bronze.orders WHERE _load_ts > :watermark) b
ON s.order_id = b.order_id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;

Quality rules, such as not-null keys or valid ranges, run between layers. Failing records go to a quarantine table instead of blocking the pipeline.

Pitfalls

  • Treating layers as a rigid three-hop rule: some domains need extra intermediate tables, others fewer.
  • No contracts between layers: schema drift in bronze silently breaks silver.
  • Business logic scattered in gold: duplicate definitions of revenue or active user emerge. Centralize metrics in shared silver or a semantic layer.
  • Open access to bronze: raw tables often hold sensitive fields; apply access control per layer.
  • Unbounded retention of every layer wastes money; set lifecycle rules.

Key takeaways

  • Bronze preserves truth, silver provides trusted entities, gold serves use cases.
  • Incremental merges keep layers cheap to maintain.
  • Gate promotion with automated quality checks and quarantine bad rows.
  • Layers are a convention, so enforce them with naming, permissions and ownership.

✓ When to Use

  • •Lakehouse with many sources and consumers
  • •Need reproducible reprocessing from raw data
  • •Quality expectations differ for raw, cleaned and curated data

✗ When Not to Use

  • •Single source feeding one report
  • •Strict low-latency serving where extra hops hurt
  • •Team cannot enforce layer ownership and naming

Pros

  • +Clear quality contract per layer
  • +Raw data preserved for audit and replay
  • +Incremental processing limits recompute

Cons

  • −Storage duplication across layers
  • −Extra hops add latency
  • −Layers can sprawl without governance

Cost Profile

Infrastructure

Medium - storage multiplied per layer

Operational

Medium - many pipelines and checks

Cognitive

Low - easy to explain

Failure Modes

  • Consumers bypass silver and read raw bronze

  • Bad data promoted because quality checks are missing

  • Gold tables diverge in metric definitions

Real-World Examples

Alternatives

    Related Patterns

      Competency Domains

      data statereliability ops