Everything You Need to Know About Medallion Architecture
How the bronze, silver and gold layers organise data in a lakehouse, and why the pattern improves quality step by step.
Medallion Architecture is a framework used to organize and manage data through different stages of processing. It is typically applied in data lakes or data warehouses to ensure data quality, transformation, and accessibility for analytics. The architecture is divided into three main layers, often referred to as Bronze, Silver, and Gold, each serving a distinct purpose based on the data’s stage of processing and readiness.
The Three Layers of Medallion Architecture:
- Bronze Layer: Raw, unprocessed data that is at its initial stage.
- Silver Layer: Cleansed, transformed, and enriched data, but not yet optimized for specific business use cases.
- Gold Layer: Aggregated, curated, and business-ready data for reporting and analytics.
Key Principle:
The key principles of Medallion Architecture revolve around organizing data in a way that ensures quality, scalability, and efficient analytics through different stages of data processing. Here are the core principles:
1. Data Staging Based on Processing Maturity
- Layered Approach: Data is organized into distinct layers (Bronze, Silver, Gold) based on its processing maturity. Each layer represents a specific stage in the data pipeline, ensuring data is progressively refined.
- Data Readiness: The architecture ensures that data is stored in the right layer depending on how ready it is for analysis or business use.
2. Raw Data in the Bronze Layer
- The Bronze Layer holds raw, unprocessed data directly ingested from various sources. It ensures the preservation of the original state of data, offering traceability and backup for reprocessing when necessary.
3. Data Transformation in the Silver Layer
- The Silver Layer is where data is cleansed, enriched, and transformed. It is not yet ready for direct business use but is prepared for more advanced processing and analysis.
- This layer involves operations like data filtering, deduplication, and schema mapping.
4. Business-Ready Data in the Gold Layer
- The Gold Layer is the final stage, where data is aggregated, curated, and enriched with business logic to make it ready for direct consumption.
- Data in this layer is often denormalized and structured for specific business use cases, such as reporting, machine learning models, and analytics.
5. Progressive Refinement
- Data progressively moves through the layers, starting from raw in the Bronze Layer to cleaned and transformed in the Silver Layer and finally to business-ready and optimized in the Gold Layer.
- This progressive refinement ensures data quality improves over time, making it suitable for downstream analytical and business tasks.
6. Traceability and Flexibility
- Medallion Architecture allows for traceability back to raw data in the Bronze Layer, enabling auditing, reprocessing, and lineage tracking.
- The layers are designed to be flexible so that changes to data or transformations can be easily incorporated, without affecting the overall pipeline.
7. Optimized for Analytics and Scalability
- The architecture is designed to scale efficiently, supporting large volumes of data.
- Data in the Gold Layer is optimized for high-performance analytics, reporting, and business decision-making.
8. Data Governance and Compliance
- By maintaining data in separate layers, Medallion Architecture facilitates better data governance. This ensures compliance with data policies, and auditing standards, and enables easy data recovery and traceability.
In summary, Medallion Architecture’s key principles are centred on organizing data based on its maturity and readiness for consumption, ensuring quality, scalability, and flexibility throughout the data processing lifecycle.
Q&A
In what scenarios should Medallion Architecture be used?
Medallion Architecture is well-suited for large-scale data pipelines that need structured processing, cleansing, and transformation. As mentioned earlier, it organizes data into three layers—Bronze (raw), Silver (transformed), and Gold (business-ready)—to ensure scalability, data quality, and traceability. This approach is especially beneficial for managing complex analytical use cases, integrating data from various sources, and offering flexibility in data processing to support efficient, high-quality analytics.
Does the Medallion Architecture focus more on the current stage of the data and how it should be stored in the respective layer, rather than just the flow of data from one layer to another?
Yes, the Medallion Architecture primarily focuses on the current stage of the data and how it should be stored in the respective layer based on its processing status and readiness for use. It’s not just about how data flows between layers, but about categorizing data according to its maturity level at each stage:
- Bronze Layer: Raw, unprocessed data.
- Silver Layer: Transformed and cleaned data, ready for further processing but not yet business-ready.
- Gold Layer: Aggregated, curated, and business-ready data for analytics and reporting.
This approach ensures that data is stored in the layer that best matches its processing state, making the architecture more efficient and manageable.
If data comes from an external source and is already well-formatted and ready for business use cases, where should it be stored?
If the data coming from an external source is already well-formatted, clean, and ready for business use cases, it can be stored directly in the Gold Layer without passing through the Bronze and Silver Layers.
However, this depends on a few factors:
- If the data needs further processing (e.g., enrichment, deduplication, or business-specific transformations), it should go through the Silver Layer before reaching the Gold Layer.
- If the data is already optimized for direct consumption, it can be ingested straight into the Gold Layer.
When should you avoid using Medallion Architecture?
Medallion Architecture may not be the best choice in the following scenarios:
- Simple Data Pipelines: When the data processing requirements are straightforward, with minimal cleansing or transformation, Medallion Architecture may introduce unnecessary complexity. In such cases, simpler architectures can be more efficient.
- Real-Time Data Processing: If you require real-time streaming or near-real-time data processing where data needs to be consumed and acted upon immediately (e.g., in low-latency systems), the layered approach of Medallion Architecture may introduce delays that are not suitable.
- Limited Data Volume: If you are working with small datasets or a simple application that doesn’t require heavy data transformation or aggregation, the overhead of managing multiple layers could be excessive.
- Low Data Governance Needs: If traceability, auditing, and data lineage are not important for your system, the complexities of maintaining distinct layers for raw, transformed, and business-ready data might be unnecessary.
- Tight Storage or Resource Constraints: Medallion Architecture involves storing data at multiple stages (raw, transformed, and business-ready), which can require significant storage resources. If your system has tight storage or resource limitations, a simpler architecture might be more suitable.
Originally published on LinkedIn. See the original post and its comments.