Skip to main content
← CONCEPTS / DEVOPS & PLATFORM ENGINEERING
An end-to-end domain learning journey

Data Warehousing, Data Lake
& Medallion Architecture.

A Data Lakehouse unifies the low-cost, open-format object storage of a Data Lake with the ACID transactions, schema enforcement, and fast SQL performance of a Data Warehouse—typically organized via Medallion (Bronze, Silver, Gold) layers.
Start the journey7 sections· Last modified Nov 29, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

If latency budgets leave no room for synchronous retries, Data Lake & Medallion Architecture, store data once in open table formats (Apache Iceberg or Delta Lake) on cloud object storage, using Bronze/Silver/Gold tiers to progressively refine raw events into governed, query-ready business tables.

TL;DR30-second simplified summary
▾

Core Mechanics: A Data Lakehouse places an open transactional metadata layer (Apache Iceberg, Delta Lake, or Apache Hudi) directly over immutable Parquet/ORC files in S3/GCS.

Visual & Structural Flow: Depicts How Apache Iceberg Achieves ACID & 99% File Pruning on Immutable S3 (Catalog CAS -> metadata.json -> Manifest List -> Manifest File -> Parquet (128-512MB)); Bronze -> Silver -> Gold Pipeline on Shared Object Storage (Kafka / Debezium -> Bronze Iceberg -> Silver Iceberg -> Gold (Z-Ordered)).

Trade-Offs & Production: Choose CoW vs MoR based on your read/write ratio and CDC MERGE frequency. Enforce strict layer boundaries via catalog RBAC: restrict BI service accounts to Gold schemas, isolate backfills on Iceberg branches, and enable Deletion Vectors (Delta).

Failure Modes & Application: Explore real-time lakehouse architectures, CDC ingestion, Spark shuffle skew tuning, and dimensional star schemas.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
PRIME Core Invariants & Workload Constraints
Establish concrete scale, latency, memory, and concurrency bounds for Data Warehousing, Data Lake & Medallion Architecture before selecting data structures or storage components.
Failure Boundaries & Operational Trade-Offs
Identify hot-key skew, partial failures, resource leaks, and when simpler single-node or standard alternatives outperform complex designs.
Full walkthrough · 7 stages
01
STAGE 01 · WHAT IT ISL4 · FUNDAMENTALS

What is a Data Lakehouse & Medallion Architecture.

Why this matters: The mechanism: understand how a Data Lakehouse & Medallion Architecture works from first principles.

A Data Lakehouse places an open transactional metadata layer (Apache Iceberg, Delta Lake, or Apache Hudi) directly over immutable Parquet/ORC files in S3/GCS. Object stores lack in-place updates, so Iceberg maintains an atomic metadata.json catalog CAS pointer -> manifest list -> manifest files (with per-file min/max column stats) -> Parquet data files.

Data flows through three Medallion tiers: Bronze (raw append-only history), Silver (cleansed, deduplicated, conformed entities via MERGE INTO), and Gold (Z-ordered business aggregates & ML feature tables).

Iceberg Metadata Tree

How Apache Iceberg Achieves ACID & 99% File Pruning on Immutable S3

Catalog CAS -> metadata.jsonAtomic snapshot pointerManifest ListManifest FilePage 0ParquetPage 2Page 3

Atomic catalog CAS swaps on metadata.json provide snapshot isolation and time travel without S3 ListObjects scans.

02
STAGE 02 · WHY WE NEED ITL4 · FUNDAMENTALS

Why Two-Tier Lake + Warehouse Pipelines Break Down.

Why this matters: The problem: see what breaks without Why Two-Tier Lake + Warehouse Pipelines Break Down under real concurrency or scale.

Think of Why Two-Tier Lake + Warehouse Pipelines Break Down as the intuition layer for Data Warehousing, Data Lake & Medallion Architecture: The problem: see what breaks without Why Two-Tier Lake + Warehouse Pipelines Break Down under real concurrency or scale.

Classic two-tier architectures force teams to pay twice: raw files sit in an ungoverned S3 Data Lake for ML, while curated subsets are copied nightly into an expensive proprietary Data Warehouse for BI—creating sync lag, duplicated storage, and painful multi-partition rewrites for GDPR deletes.

Medallion Refinement

Bronze -> Silver -> Gold Pipeline on Shared Object Storage

Kafka / DebeziumRaw CDC streamBronze IcebergAppend-only +…Silver IcebergDeduplicated + PII…Gold (Z-Ordered)BI + ML Feature TablesRaw CDC streamAppend-only +_ingested_atDeduplicated + PIImasked

Storing all three Medallion tiers in Iceberg on S3 lets Spark, Trino, Snowflake, and DuckDB query one canonical copy.

Engineering Decision Framework
Problem
How to implement Data Warehousing, Data Lake & Medallion Architecture without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
If latency budgets leave no room for synchronous retries, data Lake & Medallion Architecture, store data once in open table formats (Apache Iceberg or Delta Lake) on cloud object storage, using Bronze/Silver/Gold tiers to progressively refine raw events into governed, query-ready business tables.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Data Warehousing, Data Lake & Medallion Architecture experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

Media Platform 400 TB Lakehouse Migration

Eliminated a 4.5-hour nightly Redshift COPY of 60 TB by migrating to Apache Iceberg on S3 with Spark + Trino, cutting storage + compute cost by 42% and enabling row-level GDPR deletes via Merge-on-Read.

Fleet Telemetry Medallion Pipeline (80,000 Trucks)

Out-of-order GPS pings were ingested into Bronze Delta Lake, deduplicated by (truck_id, event_ts) in Silver via MERGE INTO, and aggregated into hourly Gold route-efficiency tables.

03
STAGE 03 · WHERE IT IS USEDL5 · APPLIED DESIGN

Where a Lakehouse Fits (and Where OLTP / Managed Warehouses Win).

Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.

Think of Where a Lakehouse Fits (and Where OLTP / Managed Warehouses Win) as the intuition layer for Data Warehousing, Data Lake & Medallion Architecture: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.

Lakehouses shine for multi-terabyte unified BI + ML without vendor lock-in, but are the wrong tool for sub-10ms OLTP lookups or tiny <1 TB SQL-only datasets.

ChoiceWhat it buysWhat it costs
Use: Multi-TB Unified BI + Spark/PyTorch MLRaw S3 cost (~$23/TB/mo), multi-engine access (Trino, Spark, DuckDB), ACID time travel.Requires automated compaction, Z-ordering, and snapshot expiration jobs.
Avoid: Small <1 TB SQL-Only WorkloadsServerless BigQuery, Snowflake, or DuckDB requires zero file-compaction ops.Managing Iceberg catalogs and compaction adds unnecessary overhead.
Avoid: Sub-10ms Point Lookups / <100ms AlertingUse PostgreSQL/DynamoDB for OLTP and ClickHouse/Pinot/Flink for sub-second OLAP.Object-store Parquet scans cannot serve single-row OLTP SLAs.
04
STAGE 04 · HOW IT IS MANAGEDL5 · APPLIED DESIGN

How to manage Compaction, Z-Ordering & Hidden Partitioning.

Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.

Keep a Lakehouse fast with four automated maintenance jobs:

  1. Bin-Packing Compaction: Merge streaming 50 KB files into 128–512 MB Parquet files (rewrite_data_files) to prevent planner OOMs.
  2. Z-Ordering / Clustering: Sort rows inside Parquet by common filter keys (customer_id, tenant_id) so row-group min/max stats skip 95%+ of blocks.
  3. Snapshot Expiration & Vacuum: Expire snapshots >7 days and remove orphan files >24h.
  4. Hidden Partitioning: Use PARTITIONED BY (days(event_ts)) in Iceberg so queries filtering WHERE event_ts >= '2026-11-01' prune partitions automatically.
Component Topology

How to manage Compaction, Z-Ordering & Hidden Partitioning

requestdispatchread/writeCALLERROUTER__APIPROCESSORSTATE_LAYER
-- Apache Iceberg table with hidden daily partitioning & maintenance procedures (Spark SQL)
CREATE TABLE silver.orders (
 order_id BIGINT,
 customer_id BIGINT,
 status STRING,
 total_cents BIGINT,
 event_ts TIMESTAMP
) USING iceberg
PARTITIONED BY (days(event_ts));

-- Periodic bin-packing compaction + Z-order clustering + snapshot expiration:
CALL system.rewrite_data_files(table => 'silver.orders', strategy => 'sort', sort_order => 'zorder(customer_id)');
CALL system.expire_snapshots(table => 'silver.orders', older_than => TIMESTAMP '2026-11-10 00:00:00');
05
STAGE 05 · ALTERNATIVESL6 · SCALE & TRADE-OFFS

Alternatives: Copy-on-Write vs. Merge-on-Read & Warehouse vs. Lake.

Why this matters: The trade-off: compare competing approaches across latency, consistency, and operational cost.

Think of Alternatives: Copy-on-Write vs. Merge-on-Read & Warehouse vs. Lake as the intuition layer for Data Warehousing, Data Lake & Medallion Architecture: The trade-off: compare competing approaches across latency, consistency, and operational cost.

Choose CoW vs MoR based on your read/write ratio and CDC MERGE frequency.

Lifecycle & Failure Recovery

Alternatives: Copy-on-Write vs. Merge-on-Read & Warehouse vs. Lake

Before · Alternatives: Copy-on-Write
  • Bounds & SLOs
  • Bounds & SLOs
After · . Merge-on-Read & Warehouse vs. Lake
  • Bounded outcome
  • Deterministic invariant enforcement
ChoiceWhat it buysWhat it costs
Copy-on-Write (CoW)Fastest BI read latency—no delete files to merge at query time.Rewrites entire 256 MB Parquet files even for a single-row update.
Merge-on-Read (MoR)Fast CDC upserts and GDPR deletes via lightweight positional/equality delete files.Reads slow down if delete files accumulate before background compaction.
Proprietary Cloud Warehouse (Snowflake/Redshift)Zero manual compaction or vacuuming; lowest ops burden.Higher bundled storage/egress costs and tighter engine lock-in.
06
STAGE 06 · PRODUCTION ARCHITECTUREL7 · STAFF / PRINCIPAL

Production Architecture: Medallion Governance & File Health.

Why this matters: Production architecture: see how the components compose end to end under real load.

Think of Production Architecture: Medallion Governance & File Health as the intuition layer for Data Warehousing, Data Lake & Medallion Architecture: Production architecture: see how the components compose end to end under real load.

Enforce strict layer boundaries via catalog RBAC: restrict BI service accounts to Gold schemas, isolate backfills on Iceberg branches, and enable Deletion Vectors (Delta) or Puffin NDV sketches (Iceberg) to accelerate MERGE mutations.

Avoid Over-Partitioning

Never partition by user_id or hour + country + device_type, which creates sparse 200 KB files that destroy Parquet compression and planning speed.

Prevent Catalog Divergence

Never write directly to S3 Parquet paths bypassing the Iceberg REST / Unity Catalog—direct writes create invisible rows and stale metadata.

07
STAGE 07 · PROBLEMS SOLVED & FURTHER DEEP DIVEL7 · STAFF / PRINCIPAL

Problems solved & Related Concepts.

Why this matters: Applied problems: connect these internals to concrete system design and debugging scenarios.

Think of Problems solved & Related Concepts as the intuition layer for Data Warehousing, Data Lake & Medallion Architecture: Applied problems: connect these internals to concrete system design and debugging scenarios.

Explore real-time lakehouse architectures, CDC ingestion, Spark shuffle skew tuning, and dimensional star schemas.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 4
Score: 0/4

A streaming Flink job commits 1,000 tiny 50 KB Parquet files per hour into an Iceberg table partitioned by `hour + country + device_type`, causing Trino query planners to OOM. What are the two root fixes?

Recommended Learning Flow