# What is the medallion architecture?

Organising a lakehouse in 3 layers of rising quality: bronze for raw data, silver for cleaned and joined data, and gold for tables shaped for reports and AI.

- Page: https://tecyfy.com/concepts/medallion-architecture
- Subject: Data engineering in the AI era (https://tecyfy.com/concepts)
- Level: intermediate
- Also called: Bronze, silver, gold, Multi-hop architecture

Once raw files and finished tables live in the same [Lakehouse](https://tecyfy.com/concepts/lakehouse), someone opening a table needs to know which kind it is. Is this the data as it arrived, or has someone checked it? The medallion architecture answers with 3 names borrowed from sports medals: bronze, silver and gold.

## 3 layers of rising trust

**Bronze** is the data as it arrived from the source, kept close to its raw form. Most fields are often stored as plain strings or semi-structured values, so nothing is lost if the source sends something unexpected. Full history is kept, so everything downstream can be rebuilt from it.

**Silver** is the data checked and cleaned. Duplicates are removed, strings become dates and numbers, [quality rules](https://tecyfy.com/concepts/data-quality) run, and records that arrived late or out of order are put right. Silver tables are joined into a consistent picture: an order with its customer and its products.

**Gold** is data shaped for a use: daily revenue by region, a customer's lifetime value, the table behind one dashboard. It is often summed up rather than row by row, and it is what most people outside the data team should read.

## Follow one order through

A customer places an order. The shop's database records it, and change data capture copies the change into a **bronze** table exactly as it came, including a duplicate sent twice after a network retry.

In **silver**, the duplicate is dropped, the amount becomes a number, the email is removed because no report needs it, and a rule drops any order with a negative total. On Databricks that rule is a pipeline expectation that drops, keeps or stops on a bad row.

In **gold**, the order is one of thousands summed into yesterday's revenue for its region. That number is what the finance dashboard shows, and what an AI assistant should quote.

(An interactive demo goes here on the page: https://tecyfy.com/concepts/medallion-architecture)

## A convention, not a law

Databricks calls the medallion architecture a recommended practice, not a requirement. Some teams use 2 layers, some use 5. The names matter less than the rule they encode: every table says how far it can be trusted, and data only moves towards gold through checks.

Because each layer is a versioned table in an [open table format](https://tecyfy.com/concepts/open-table-format), a mistake in silver can be fixed and silver rebuilt from bronze, without going back to the source. That is the reason to keep bronze raw.

## Why it matters for AI

The layers tell an AI system what to read. An assistant answering a question about revenue should read gold tables, or a [semantic layer](https://tecyfy.com/concepts/semantic-layer) defined on them, where the definitions were agreed. Pointed at bronze, it will count the duplicate order and the test records too, and give the wrong total with complete confidence.

Documents follow the same path. Raw PDFs are bronze; parsed, cleaned text is silver; the chunks and vectors an assistant searches are a gold product of their own, made by an [embedding pipeline](https://tecyfy.com/concepts/embedding-pipeline).

## Related

- [Lakehouse](https://tecyfy.com/concepts/lakehouse): One store for all of an organisation's data: cheap files in cloud storage, as in a data lake, with the tables, transactions and fast queries of a data warehouse on top.
- [ELT](https://tecyfy.com/concepts/elt): Loading raw data into the warehouse or lakehouse first and transforming it there, the reverse of the older ETL order, which transformed data before loading it.
- [Data Quality](https://tecyfy.com/concepts/data-quality): How far data can be trusted: complete, correct, on time and in the expected shape. Pipelines check it with rules and stop or flag rows that fail.

## Sources

- [What is the medallion lakehouse architecture?](https://docs.databricks.com/aws/en/lakehouse/medallion)
- [Manage data quality with pipeline expectations](https://docs.databricks.com/aws/en/ldp/expectations)
- [What is Delta Lake in Databricks?](https://docs.databricks.com/aws/en/delta/)
- [Unity Catalog metric views](https://docs.databricks.com/aws/en/metric-views/)
