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.
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).
How Apache Iceberg Achieves ACID & 99% File Pruning on Immutable S3
Atomic catalog CAS swaps on metadata.json provide snapshot isolation and time travel without S3 ListObjects scans.
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.
Bronze -> Silver -> Gold Pipeline on Shared Object Storage
Storing all three Medallion tiers in Iceberg on S3 lets Spark, Trino, Snowflake, and DuckDB query one canonical copy.
- 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.
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.
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.
| Choice | What it buys | What it costs |
|---|---|---|
| Use: Multi-TB Unified BI + Spark/PyTorch ML | Raw 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 Workloads | Serverless BigQuery, Snowflake, or DuckDB requires zero file-compaction ops. | Managing Iceberg catalogs and compaction adds unnecessary overhead. |
| Avoid: Sub-10ms Point Lookups / <100ms Alerting | Use PostgreSQL/DynamoDB for OLTP and ClickHouse/Pinot/Flink for sub-second OLAP. | Object-store Parquet scans cannot serve single-row OLTP SLAs. |
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:
- Bin-Packing Compaction: Merge streaming 50 KB files into 128–512 MB Parquet files (
rewrite_data_files) to prevent planner OOMs. - 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. - Snapshot Expiration & Vacuum: Expire snapshots >7 days and remove orphan files >24h.
- Hidden Partitioning: Use
PARTITIONED BY (days(event_ts))in Iceberg so queries filteringWHERE event_ts >= '2026-11-01'prune partitions automatically.
How to manage Compaction, Z-Ordering & Hidden Partitioning
-- 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');
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.
Alternatives: Copy-on-Write vs. Merge-on-Read & Warehouse vs. Lake
- Bounds & SLOs
- Bounds & SLOs
- Bounded outcome
- Deterministic invariant enforcement
| Choice | What it buys | What 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. |
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.
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: Make the trade-off yourself.
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?