11 min read

    πŸ—οΈ Data Architectures: Data Lakes, Mesh & Medallion

    datawarehousearchitecturedatalakelakehousemedallion

    πŸ—οΈ Data Architectures

    Analogy

    Think of how cities store water:

    • A reservoir serves the whole city (EDW)
    • A local tank serves one neighbourhood (Data Mart)
    • A massive open lake stores everything unfiltered (Data Lake)
    • A smart lake with pipes gives you both raw and clean water (Lakehouse)
    • A mesh of decentralized water plants each managing their own area (Data Mesh)

    Different architectures exist because different businesses have different needs β€” size, speed, cost, flexibility.


    1️⃣ Enterprise Data Warehouse (EDW)

    A single, centralized warehouse that serves the entire organization β€” all departments, all subjects, all data in one place.

    All Sources β†’ ETL β†’ One Central EDW β†’ All Departments query it
    

    Characteristics:

    • Organization-wide scope (not just one department)
    • Single source of truth for the entire enterprise
    • Governed, structured, historical data
    • Typically built on: Snowflake, Teradata, IBM Db2, Oracle

    Best for:

    • Large enterprises needing consistent data across all departments
    • Heavily regulated industries (Banking, Insurance, Healthcare)
    Tip

    EDW = DW at enterprise scale. Every department feeds into it and queries from it.


    2️⃣ Data Marts

    A department-scoped subset of the EDW (covered in Ch04).

    EDW β†’ [subset] β†’ Sales Mart
        β†’ [subset] β†’ Finance Mart
        β†’ [subset] β†’ HR Mart
    
    Info

    Data Marts are not a standalone architecture β€” they work on top of an EDW or DW. They give teams faster, focused access without querying the full warehouse.


    3️⃣ Data Lake

    Analogy

    A giant lake that accepts everything β€” clean water, muddy water, salt water. You store it all first, figure out what to do with it later.

    A Data Lake stores raw, unprocessed data in its native format β€” structured, semi-structured, and unstructured β€” at massive scale.

    FeatureData Lake
    Data formatRaw (CSV, JSON, Parquet, images, logs, video)
    SchemaSchema-on-read (define structure when you query)
    Storage costVery cheap (cloud object storage: S3, ADLS, GCS)
    UsersData scientists, ML engineers
    ProcessingSpark, Hive, Presto

    Best for:

    • Storing massive volumes of diverse data cheaply
    • ML/AI workloads that need raw data
    • When you don't know exactly what questions you'll ask yet
    Warning

    Without proper governance, a Data Lake becomes a Data Swamp β€” full of data nobody trusts or can find. Metadata and cataloguing are critical.


    4️⃣ Lakehouse

    Analogy

    A lakehouse is a lake with the plumbing of a warehouse β€” you get the storage flexibility of a lake with the ACID transactions and performance of a warehouse.

    A Lakehouse combines the best of Data Lake and Data Warehouse into one architecture.

    FeatureData LakeData WarehouseLakehouse
    Stores raw dataβœ…βŒβœ…
    ACID transactionsβŒβœ…βœ…
    BI & SQL queriesLimitedβœ…βœ…
    ML workloadsβœ…βŒβœ…
    CostLowHighMedium
    Schema enforcementOn readOn writeBoth

    Technologies:

    • Delta Lake (Databricks)
    • Apache Iceberg
    • Apache Hudi
    Tip

    Lakehouse is the modern default for most data teams β€” one platform for BI, ML, and streaming.


    5️⃣ Data Mesh

    Analogy

    Instead of one central water plant for the whole city, each neighbourhood runs its own water plant and is responsible for quality. They share using common standards.

    Data Mesh is a decentralized architecture where data ownership is distributed to individual domain teams (e.g., Sales team owns Sales data, HR team owns HR data).

    4 Core Principles:

    1. Domain ownership β€” each team owns, builds, and maintains their own data products
    2. Data as a product β€” each domain treats its data as a product with SLAs and documentation
    3. Self-serve platform β€” central team provides infrastructure; domains use it themselves
    4. Federated governance β€” global standards enforced, but each domain has autonomy
    Sales Domain  β†’ owns β†’ Sales Data Product
    Finance Domain β†’ owns β†’ Finance Data Product
    HR Domain     β†’ owns β†’ HR Data Product
             ↓ shared via common standards
         Consumers query across domains
    

    Best for:

    • Large organizations with many autonomous teams
    • When a central data team becomes a bottleneck
    Warning

    Data Mesh requires strong organizational maturity β€” it fails when teams lack the skills or ownership culture to maintain their own data products.


    6️⃣ Medallion Architecture (Bronze β†’ Silver β†’ Gold)

    Analogy

    Like refining crude oil β€” raw oil (Bronze) β†’ refined oil (Silver) β†’ premium fuel ready to use (Gold).

    Medallion Architecture is a layered data design pattern used inside Lakehouses (especially Databricks Delta Lake) that progressively refines data quality across 3 layers.

    LayerAlso CalledWhat It ContainsQuality
    BronzeRaw layerRaw ingested data β€” exactly as received from sources❌ Dirty
    SilverCleaned layerDeduplicated, validated, standardized dataβœ… Clean
    GoldBusiness layerAggregated, modelled data ready for reporting & MLβœ…βœ… Curated
    Source Data
        ↓
    πŸ₯‰ Bronze  β€” raw, as-is (JSON logs, CSV dumps, API responses)
        ↓ clean + deduplicate
    πŸ₯ˆ Silver  β€” validated, standardized, joined tables
        ↓ aggregate + model
    πŸ₯‡ Gold    β€” business-ready fact/dimension tables, KPIs, dashboards
    

    Real Example (E-commerce):

    Bronze β†’ Raw order events from Kafka (JSON, duplicates, nulls)
    Silver β†’ Cleaned orders table (deduped, currency standardized, nulls handled)
    Gold   β†’ Daily_Sales_Summary table (SUM revenue by region/product β€” feeds Power BI)
    
    Tip

    Bronze = never delete (audit trail). Silver = analyst-ready. Gold = business-ready.


    7️⃣ Virtual Data Warehouse

    A Virtual Data Warehouse does not physically store data β€” instead it creates a virtual layer on top of existing source systems and presents them as if they were a warehouse.

    Source DB 1 ─┐
    Source DB 2 ──→ Virtual Layer (query federation) β†’ Analyst queries
    Source DB 3 β”€β”˜
    

    Best for:

    • Quick implementation with no ETL pipelines
    • When data cannot be moved (regulatory, privacy reasons)
    • Ad hoc analysis on existing systems
    Warning

    Virtual DWs have performance limitations β€” queries hit live source systems. Not suitable for heavy, complex analytics.


    βš”οΈ DW vs EDW

    AttributeData Warehouse (DW)Enterprise Data Warehouse (EDW)
    ScopeDepartment or limited subject areasEntire organization
    UsersOne or few teamsAll departments
    Data coveragePartialComplete enterprise-wide
    ComplexityLowerHigher
    GovernanceModerateStrict, enterprise-grade
    ExampleSales DW for one regionGlobal DW for all of Infosys
    Info

    EDW is just a DW that has been scaled and governed to serve the whole enterprise. Every EDW is a DW β€” not every DW is an EDW.


    πŸ—ΊοΈ Architecture Comparison Summary

    ArchitectureData TypeSchemaBest For
    EDWStructuredFixedEnterprise-wide reporting
    Data MartStructuredFixedDept-level analytics
    Data LakeAny (raw)On readML, raw storage, exploration
    LakehouseAnyBothUnified BI + ML platform
    Data MeshAnyDomain-ownedLarge orgs, decentralized teams
    MedallionAny (layered)LayeredProgressive data refinement
    Virtual DWStructuredVirtualQuick access, no movement

    πŸ§ͺ Practice Drill

    text
    // Try answering these:
    // Q1. What is the key difference between a Data Lake and a Data Warehouse in terms of schema?
    // Q2. A startup stores raw clickstream logs, images, and CSV sales data all in one place cheaply for future ML use. Which architecture are they using?
    // Q3. Name the 3 layers of Medallion Architecture and what each contains.
    // Q4. A large bank has 20 departments all querying inconsistent data from their own databases. Which architecture solves this at scale?
    // Q5. Why would a company choose a Virtual Data Warehouse? What is its main limitation?
    // Q6. Match the architecture to its best use case:
    // | Use Case | Architecture |
    // |---|---|
    // | Each domain team owns and serves its own data | ? |
    // | Progressive data refinement: raw β†’ clean β†’ curated | ? |
    // | One warehouse for the entire global enterprise | ? |
    // | BI + ML on the same platform without data movement | ? |
    
    πŸ’‘ Click for Solutions

    A1.

    • Data Lake β†’ Schema-on-read (structure defined when queried, not when stored)
    • Data Warehouse β†’ Schema-on-write (structure enforced when data is loaded)

    A2. Data Lake β€” stores raw, diverse data cheaply with no predefined schema

    A3.

    • πŸ₯‰ Bronze β€” raw data exactly as received from sources (dirty, unprocessed)
    • πŸ₯ˆ Silver β€” cleaned, deduplicated, standardized data (analyst-ready)
    • πŸ₯‡ Gold β€” aggregated, business-modelled data ready for dashboards and ML

    A4. Enterprise Data Warehouse (EDW) β€” centralizes all departments into one governed, consistent source of truth

    A5.

    • Chosen when: data cannot be moved (compliance/privacy), or a quick no-ETL solution is needed
    • Main limitation: queries hit live source systems β†’ poor performance for heavy analytics

    A6.

    Use CaseArchitecture
    Each domain team owns and serves its own dataData Mesh
    Progressive data refinement: raw β†’ clean β†’ curatedMedallion Architecture
    One warehouse for the entire global enterpriseEDW
    BI + ML on the same platform without data movementLakehouse

    ← Previous Topic | Next Topic β†’ Next Topic