07. Data Lakehouse Architecture & Open Table Formats
The Data Lakehouse combines the cheap, open, multi-petabyte storage capacity of a Data Lake (S3, ADLS, GCS) with the ACID transactional reliability, schema enforcement, and lightning-fast BI query performance of a Data Warehouse.
• Data Lakehouse (Smart Valet with Digital Ledger): Cars still park in the same open lot (cheap cloud storage), but a computerized master ledger (the transaction log) tracks every space in real time. If a parking attempt fails, the valet rolls it back instantly so the lot remains immaculate.
The 2-Tier Architecture vs. The Unified Lakehouse
Before Lakehouses, organizations had to maintain two completely separate copies of their data: a Data Lake for raw ingestion and machine learning, and a Data Warehouse for business intelligence.
| Capability | Traditional Data Lake | Traditional Data Warehouse | Modern Data Lakehouse |
|---|---|---|---|
| Storage Format | Raw open files (CSV, JSON, Parquet) on S3/Blob. | Proprietary closed storage format. | Open Parquet files + Open metadata log. |
| ACID Transactions | No (Risk of dirty reads & partial writes). | Yes (Full ACID compliance). | Yes (Full ACID via metadata manifests). |
| Cost per Terabyte | Very Low ($23/TB/month on S3). | High to Extreme ($$$ proprietary compute/storage). | Very Low (Commodity cloud object storage). |
| Workload Support | Big Data, AI, ML, Spark, Unstructured data. | BI dashboards, SQL reporting only. | Unified: BI, SQL, AI, Machine Learning, Streaming. |
| Data Redundancy | Requires manual ETL pipelines into DWH. | Duplicate copy of lake data (stale, expensive). | Zero Duplication: Single source of truth. |
The Secret Sauce: How Open Table Formats Work
An Open Table Format is not a new file type. It is an intelligent abstraction layer that turns a folder of independent Parquet files into a single, cohesive, transactional database table.
└── _delta_log/ ← Transaction Log Directory (The Brain)
│ └── 00000000000000000000.json (Commit 0: Created table, added files A, B)
│ └── 00000000000000000001.json (Commit 1: Appended file C)
│ └── 00000000000000000002.json (Commit 2: GDPR Delete: marked file A invalid, added file D)
│ └── 00000000000000000010.checkpoint.parquet (Checkpoint: consolidated state)
└── part-0000-fileA.parquet ← Historical / Tombstone file
└── part-0001-fileB.parquet ← Active Valid Parquet Data File
└── part-0002-fileC.parquet ← Active Valid Parquet Data File
└── part-0003-fileD.parquet ← Active Valid Parquet Data File
SELECT * FROM sales_orders, the engine does NOT scan the folder blindly. It reads the latest JSON commit log, discovers that fileA.parquet was marked as deleted in Commit 2, and reads ONLY files B, C, and D!
The Big Three: Delta Lake vs. Apache Iceberg vs. Apache Hudi
Three open-source formats dominate the modern data engineering world. While they share core principles, each was designed for specific operational strengths.
Delta Lake
Created by Databricks, donated to the Linux Foundation. Backed by an ordered JSON transaction log directory (_delta_log/).
- Native In: Databricks, Spark, Microsoft Fabric.
- Key Feature: Liquid Clustering & Z-Order clustering.
- Best For: Spark-heavy ecosystems and Databricks platform users.
Apache Iceberg
Created by Netflix and Apple. Uses a hierarchical tree of Snapshot → Manifest Lists → Manifest Files.
- Native In: Snowflake, Trino, Dremio, AWS Athena/Glue.
- Key Feature: Hidden Partitioning (no user query rewrite required).
- Best For: Multi-engine flexibility and cross-cloud analytics.
Apache Hudi
Created by Uber for high-frequency rideshare updates. Built for low-latency streaming ingest and record-level CDC upserts.
- Native In: AWS EMR, Spark, Flink streaming.
- Key Feature: Merge-on-Read (MoR) and Copy-on-Write (CoW).
- Best For: High-frequency real-time record updates & CDC.
The Four Superpowers of Lakehouse Tables
Open table formats provide enterprise data guarantees that were impossible in legacy Hadoop or raw S3 data lakes.
1. Time Travel & Auditing
Because every commit generates an immutable snapshot, you can query data exactly as it existed at any previous timestamp or version.
RESTORE TABLE orders TO VERSION AS OF 11;
2. Schema Enforcement & Evolution
Prevents bad data from poisoning your tables. Writes with missing or invalid columns fail safely unless explicit evolution is granted.
.option("mergeSchema", "true")
.mode("append").save(path)
3. In-Place SQL MERGE & Deletes
Full support for standard SQL MERGE INTO for Change Data Capture (CDC) and DELETE WHERE for GDPR compliance.
ON t.id = s.id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;
4. Auto-Compaction & Z-Ordering
Solves the "Small File Problem" by compacting thousands of 2MB streaming files into optimized 128MB Parquet files without stopping reads.
ZORDER BY (customer_id, order_date);
Lakehouse Time Travel & ACID Transaction Simulator
Execute transactional commits below. Watch how the underlying transaction log creates immutable commits, creates and invalidates Parquet data files, and allows zero-downtime historical Time Travel queries!
_delta_log/*.json
VERSION 0
| order_id | customer_id | amount_usd | status |
|---|