Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 32

Medallion Architecture: Bronze, Silver, and Gold Layers

This lesson is built with resources from youtube.com, learn.microsoft.com and 1 more site.

Hello! Welcome back to our module on building the data lakehouse.

In our last lesson, we established that cloud object storage (like S3 or ADLS Gen2) provides the scalable, decoupled foundation for a modern data platform. We now have a massive, cost-effective place to store our data. The next critical question for an architect is: how do we organize this data to prevent it from becoming a "data swamp" and instead turn it into a reliable source of truth?

This lesson addresses exactly that. Our learning outcome is to describe the medallion architecture pattern (bronze, silver, gold layers). This is a powerful and widely adopted data design pattern, popularized by Databricks, for logically structuring data within a lakehouse. As an enterprise architect, you're familiar with design patterns that bring order and scalability to complex systems; the Medallion Architecture does the same for data.

Why Do We Need a Structure?

A data lake without a deliberate organizational strategy quickly becomes difficult to use. Raw data from various sources is dumped together, leading to what the article "Medallion Architecture: A Comprehensive Overview" calls:

  • Disorganization: Inconsistent and redundant data makes it hard for teams to find, trust, or reuse information. Data lineage becomes nearly impossible to track.
  • Data Overload & Inefficiency: Analysts must repeatedly perform the same cleaning and preparation steps on raw data for every new project, wasting time and computational resources.

The Medallion Architecture solves these problems by creating a multi-layered approach that progressively improves the quality and structure of data as it moves through the system.


The Three Layers of the Medallion

The architecture gets its name from the three medals—Bronze, Silver, and Gold—which represent the increasing quality and value of the data at each stage.

To get a clear overview of these layers and their purpose, let's watch a video that introduces the concept and walks through each stage.

What is Medallion Architecture? Scalable Data Lakes | 2023

This video from the 'Make With Data' channel provides a concise and clear explanation of the Medallion Architecture and the role of each layer.

Please watch from the beginning to 09:02. Focus on: The core goal: to incrementally and progressively improve data structure and quality. The characteristics and purpose of the Bronze layer (raw data). The transformations that happen in the Silver layer (cleaning, filtering). The purpose of the Gold layer (aggregation, business-specific views).


A Closer Look at Each Layer

The video gave a great introduction. Let's solidify that understanding by breaking down the characteristics of each layer. The core idea is to move data through a series of tables, adding structure and quality along the way.

The official Azure Databricks documentation provides a helpful summary, which I've adapted here:

Layer State of Data Typical Operations Intended Users Analogy
Bronze Raw, Unaltered Ingestion as-is from source systems. Append-only. Data Engineers, Auditors A verbatim transcript of a conversation.
Silver Cleaned, Validated Deduplication, data type casting, null handling, joining sources. Data Engineers, Data Scientists, Analysts An edited, spell-checked, and clarified version of the transcript.
Gold Aggregated, Business-Ready Aggregations (e.g., daily sales), dimensional modeling. Business Analysts, BI Developers, Executives A summary report with key insights derived from the conversation.

Let's now watch a segment from another video that explains the flow between these layers from a more architectural perspective. This will help you understand the transformational logic that connects one layer to the next.

How to approach data architecture | Design Lakehouse Architecture | Data Platform Solution Design

The 'Learning Journal' channel offers a deep dive into the Medallion Architecture, focusing on the design philosophy. This segment explains what happens between the layers.

Please watch from 06:03 to 16:00. Pay close attention to: Bronze -> Silver: The primary goal here is improving data quality. The video discusses removing duplicates, standardizing formats (like dates), and fixing other data quality issues. Silver -> Gold: The focus shifts from cleaning to business value. This is where you create aggregations and data models that are ready for consumption by end-users for reporting and analytics.

Key Architectural Principles

As the videos highlighted, the Medallion Architecture isn't just about creating three folders. It embodies several key principles you'll appreciate as an architect:

  1. Single Source of Truth (Bronze): The Bronze layer contains the raw, immutable history of all data that has entered the system. If a bug is found in a downstream pipeline, you can always go back to the Bronze data and reprocess it from scratch without having to re-ingest from the source systems. This is invaluable for debugging and auditing.
  2. Decoupling of Concerns: The structure decouples the complex, messy work of ingestion and cleaning (Bronze to Silver) from the business-focused aggregation and modeling (Silver to Gold). Different teams can work on different layers, and a single, clean Silver table can serve as the source for multiple Gold tables, reducing redundant work.
  3. Progressive Data Quality: Data quality is not a one-time event but a continuous process. Basic checks are applied to create Silver tables. More complex business rules and aggregations are applied to create Gold tables.
Test your understanding!

Imagine you are designing a data platform for an e-commerce company. One of the raw data sources is a stream of click events from the website, arriving as JSON objects. The business wants a dashboard showing the number of unique visitors and total clicks per product page, updated daily.

Describe what the data would look like and what key transformations would occur in the Bronze, Silver, and Gold layers for this requirement.

Show answer
  • Bronze Layer (clickstream_raw):

    • Data: This table would store the raw, unaltered JSON data for every single click event. Each record would likely be the full JSON string, plus metadata like an ingestion timestamp. The data is appended as it arrives.
    • Transformation: Minimal to none. The primary operation is simply ingesting the raw JSON from the stream and landing it in the table.
  • Silver Layer (clickstream_cleaned):

    • Data: This table would have a structured, tabular format. The JSON would be parsed into distinct columns like user_id, session_id, product_id, event_timestamp, event_type (e.g., 'page_view', 'add_to_cart').
    • Transformation (Bronze -> Silver):
      • Parsing: Flatten the nested JSON structure into columns.
      • Cleaning: Handle null or invalid values (e.g., clicks with no product_id).
      • Type Casting: Convert event_timestamp from a string to a proper timestamp data type.
      • Deduplication: Remove any duplicate events if they occur.
  • Gold Layer (daily_product_summary):

    • Data: This is a highly aggregated table, designed specifically for the dashboard. It would have columns like date, product_id, unique_visitor_count, and total_clicks. Each row represents one product for one day.
    • Transformation (Silver -> Gold):
      • Filtering: Select only the relevant events from the Silver table (e.g., 'page_view').
      • Aggregation: Group the clean data from the Silver table by date and product_id.
      • Calculation: Use aggregate functions like COUNT(DISTINCT user_id) to get unique_visitor_count and COUNT(*) to get total_clicks.

Conclusion

Today, we've layered a crucial organizational pattern on top of our data lake foundation. The Medallion Architecture provides a methodical way to transform raw, unreliable data into valuable, analytics-ready assets.

Key Takeaways:

  • The Medallion Architecture organizes a data lakehouse into Bronze (raw), Silver (cleaned), and Gold (business-ready) layers.
  • This multi-hop pattern provides incremental data quality improvement, ensuring that data becomes progressively more structured and reliable.
  • Bronze serves as the immutable source of truth, crucial for reprocessing and auditing.
  • Silver provides validated, conformed data that can be used by data scientists and analysts for exploration and as a source for further transformation.
  • Gold tables are optimized for business intelligence and reporting, containing aggregated data that directly answers business questions.

This structure gives us a roadmap for our data pipelines. But as we move data between these layers, how do we handle things like updates, deletes, or failed jobs without corrupting our data? A standard data lake built on Parquet files struggles with this.

In our next lesson, we will explore the technology that makes the Medallion Architecture truly robust: Delta Lake. We'll see how table formats like Delta Lake provide reliability and ACID transactions to the data lake, bringing data warehouse-like guarantees to your lakehouse architecture.