SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
  • Batch vs Stream Processing
  • Change Data Capture (CDC)
  • MapReduce
  • ETL Pipelines
  • Data Lakes
  • Data Warehousing
  • Data Lakehouse
  • Lambda Architecture
  • Kappa Architecture
  • Streaming Engines
  • Spark and Hadoop
  • Workflow Orchestration (Airflow)
  • Parquet and Columnar File Formats
  • Data Governance and Feature Stores
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Advanced Data Topics/Big Data Processing

Data Lakehouse

A data lake with warehouse features on top: tables, transactions and fast queries.

⏱ 12 min readIntermediateHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

A data lakehouse keeps data in cheap lake storage, but adds a table layer on top that gives it the safety and speed of a warehouse.

  • Data stays as open files (Parquet) on object storage, so it is cheap and any tool can read it.
  • An open table format (Delta Lake, Apache Iceberg or Apache Hudi) adds a transaction log, so writes are all-or-nothing and readers always see a consistent table.
  • One copy of the data then serves SQL reports, streaming and machine learning, instead of keeping a lake and a warehouse in sync.

02Concept: What is it?

Many companies ended up with two systems: a lake for raw data and machine learning, and a warehouse for reports. Data was copied from one to the other. This doubled the cost, left two copies that could disagree, and added delay.

The problem with a plain lake is that it is just a folder of files. A job that crashes leaves half-written data. Two jobs can write at once and clash. You cannot safely update or delete a single row, and there is no undo. The lakehouse fixes this with a table format: a set of metadata files that sit next to the data files and track exactly which files make up each version of a table.

The key is the transaction log. To change a table, a job writes its new data files, and then makes one small commit to the log saying "version 2 is these files". Readers only trust the log. Until the commit happens, the new files do not exist as far as readers are concerned. That one trick gives ACID transactions on top of cheap object storage.

Lake, plus a table layer, gives a lakehouse
EnginesSQL, Spark, Flink, Trino, ML libraries
NEWTable format (Delta, Iceberg, Hudi)transaction log, schema, snapshots, statistics
Data filesParquet
Object storageS3, ADLS, GCS
Same cheap files. A metadata layer adds transactions, schema rules and time travel on top.
🧠The log is the truth
In a lakehouse the files in the folder are not the table. The log is. A file that is not in the log is invisible to readers, which is why a crashed job cannot leak half-written data.

03Real-Life Example

🍵The Library with a Catalogue Book
Imagine a library where books are just thrown onto shelves, and visitors pick whatever they find. If a delivery person is halfway through putting out a box, visitors see half a set. Now add a catalogue book at the desk: every new set is only counted as "in the library" once the librarian writes a line in the catalogue. Visitors read only the catalogue, so they see either the old set or the complete new set, never half. Old catalogue pages are kept, so if a wrong set was added, the librarian can simply point back to an earlier page. The shelves are the cheap data files, and the catalogue is the transaction log.
Library
Lakehouse
Books on shelves
Parquet data files on object storage
The catalogue book
The transaction log (metadata)
A set only counts once it is written in the catalogue
Atomic commit: files not in the log are invisible
Visitors read only the catalogue
Readers get a consistent snapshot
Old catalogue pages are kept
Table versions and time travel
Pointing back to an earlier page
Restore or roll back to an older version
Removing books nobody lists any more
Vacuum: delete files no version needs
One write, step by step
1️⃣Write filesnew Parquet files
→↓not visible yet
2️⃣Commitadd one entry to the log
→↓now visible
3️⃣Readerssee version 2
Only the last step makes the new data visible. A crash before it changes nothing for readers.

04Why Do We Need It?

🔒ACID on cheap storage
Atomic writes and consistent snapshots, without a costly proprietary database.
🧩One copy, many uses
SQL reports, streaming jobs and ML read the same table. No second copy to keep in sync.
↩️Time travel and rollback
Query an old version, or undo a bad write by restoring an earlier one.
✏️Updates and deletes
Change or remove single rows (for example to honour a privacy request) without rewriting everything by hand.
📐Schema rules
The table checks new data against its schema, and can evolve it safely when columns are added.
⚡Faster queries
Stored statistics and file layout let engines skip files they do not need.
A lakehouse is a lake that behaves like a database table. You keep the low cost and openness, and gain correctness.

05Where Do We Use It?

🏗️Replacing lake plus warehouse
Teams that were copying data between two systems move to one governed set of tables.
🌊Streaming into tables
Streams write continuously into a table that batch jobs and dashboards read at the same time.
🔄Change data capture
Apply inserts, updates and deletes from a source database to a table (upserts and merges).
🤖ML with governance
Training reads a specific table version, so results can be repeated and audited.
🧾Compliance
Row-level deletes and an audit trail of versions support privacy and audit rules.
💸Cost control
Open files on object storage let you use different engines for different jobs and avoid lock-in.

06Types / Parts / How It Works

The main open table formats

FormatHow it tracks a tableOften known for
Delta LakeAn ordered JSON log of commits, with periodic checkpointsClose fit with Spark and Databricks, simple log model
Apache IcebergA tree of metadata, manifest lists and manifest files that point to data filesBroad engine support, hidden partitioning, safe schema evolution
Apache HudiA timeline of actions on the table, with indexes for recordsFast upserts and incremental pulls (what changed since last time)
📝Note
All three give readers consistent snapshots, but their file layouts and strengths differ, and they keep changing. Check which engines you use and what each format supports.

How the three kinds of system compare

Data lake (plain files)Data warehouseLakehouse
StorageObject storage, open filesWarehouse storage, often proprietaryObject storage, open files
TransactionsNoYesYes, through the table format
Data typesAnythingMostly tablesTables, plus raw files beside them
SchemaOn readOn writeEnforced, and can evolve
Time travelNoSome systemsYes, by keeping old versions
Best forRaw storage, MLBI and reportsBoth, from one copy

Common layering: bronze, silver, gold

Three table layers
🥉Bronzeraw, append only
→↓clean, dedupe
🥈Silvervalidated, joined
→↓aggregate
🥇Goldready for reports and ML
Many lakehouses store each layer as tables in the same format.
VisualizerPlain lake files vs a lakehouse table: four accidentsPick 'Job crashes halfway' for each storage type and compare what a reader sees. Then try bad data and two writers at once, and look at the transaction log.
How is the table stored?
What goes wrong?
Data files in storage (each file holds 100 rows)
f1committed
f2committed
f3committed
n1half-written
n2half-written
No log: readers list the folder
(nothing)
Rows a reader sees
500
right now
Consistent snapshot?
No
old or new, never a mix
Undo
Delete leftovers by hand
how to fix it
The job crashed after writing 2 of 5 files. A plain lake has no commit step: readers just list the folder, so they see 500 rows. That is neither the old answer (300) nor the finished one (800), so a half-written day leaks into reports.

A simplified story with no random numbers. Real table formats differ in file layout and details (Delta keeps a JSON log, Iceberg keeps snapshots and manifests, Hudi keeps a timeline), but all of them give readers a consistent snapshot by committing through a log.

07How to Use It / Steps / Implementation

Moving to a lakehouse

  1. 1
    Pick a table format and engines
    Choose Delta, Iceberg or Hudi based on the engines you use, your cloud, and how much you need streaming upserts.
  2. 2
    Convert hot tables first
    Start with tables that suffer from half-written data or need updates and deletes. Many engines can convert existing Parquet in place.
  3. 3
    Use a catalog
    Register the tables in a catalog so every engine finds the same table name, schema and current version.
  4. 4
    Write with merge or append
    Use the format's MERGE (upsert) for changes from a source, and append for event data. Avoid writing raw files into the table folder yourself.
  5. 5
    Plan the layout
    Partition or cluster on columns used in filters (often a date). Do not over-partition, or you will create many tiny files.
  6. 6
    Run maintenance
    Compact small files regularly, and vacuum or expire old snapshots after your retention period. Keep enough history for time travel and for slow readers.
  7. 7
    Set access and quality rules
    Apply access control at table or column level, add data quality checks between layers, and monitor freshness.
💡Time travel is not a backup
Old versions live in the same storage and are removed by vacuum. Keep real backups or cross-region copies for disasters, and treat time travel as a quick undo.
⚠️Do not edit the files directly
Deleting or adding files in a table folder by hand bypasses the log. Always change the table through the table format, so the log stays correct.

08Key Terms to Know

TermMeaning in easy words
LakehouseA lake with a table layer that adds warehouse features such as transactions and fast SQL
Table formatMetadata that defines which data files make up each version of a table (Delta, Iceberg, Hudi)
Transaction logAn ordered record of commits that readers trust to know the current table
ACIDAtomic, Consistent, Isolated and Durable: the guarantees of a safe transaction
SnapshotThe exact set of files that make up the table at one version
Time travelReading or restoring an older version of a table
Optimistic concurrencyWriters work freely, and a commit fails if someone else changed the table first
CompactionRewriting many small files into fewer large ones
Vacuum / expire snapshotsDeleting data files that no kept version needs any more
Schema evolutionChanging a table's columns, such as adding one, without rewriting the table
Merge (upsert)Insert new rows and update existing ones in a single operation

09Pros, Cons and Trade-offs

✅ Pros
  • One copy of data for reports, streaming and ML
  • Transactions and consistent reads on cheap object storage
  • Open formats reduce lock-in
  • Updates, deletes and time travel
  • Schema checks and safe schema changes
  • Statistics let engines skip unneeded files
⚠️ Cons
  • More moving parts than plain files (log, catalog, maintenance)
  • Needs regular compaction and vacuum
  • Engine and format support is uneven, and details change
  • Concurrent writers to the same data can hit conflicts and retries
  • Not a drop-in for a tuned warehouse in every case
  • Young compared with long-established warehouses

Trade-offs

ChoiceWe gainWe lose
Table format on a lakeCorrect, consistent tablesExtra metadata and maintenance work
One system instead of lake plus warehouseNo double copy, less delayPeak speed may trail a fully tuned warehouse
Keep many versionsTime travel and easy undoMore storage until vacuum runs
Small, frequent commitsFresh dataMany small files and a long log, so compaction is needed
Open formatsChoice of engines, no lock-inYou choose and manage the pieces
Managed lakehouse serviceLess operations workTied to a vendor's way of working

10Common Problems and Mistakes

Common mistakes

  1. Never compacting. Streaming writes create thousands of tiny files and queries slow down.
  2. Vacuuming too soon. Deleting old files while a slow reader or a time-travel query still needs them breaks that query.
  3. Over-partitioning. Partitioning on a column with huge variety creates a mess of tiny files.
  4. Editing files by hand. Changes made outside the table format bypass the log and corrupt the table.
  5. Two engines, one table, different versions. An engine that does not support a table feature may read it wrongly or refuse. Check compatibility.
  6. Treating time travel as backup. It disappears when old versions are removed.
  7. Ignoring write conflicts. Many jobs updating the same rows will clash and need retry logic.

Things to watch

🧱Small files
Watch file counts and average file size. Compact on a schedule.
📜Log growth
A long log slows table loading. Formats use checkpoints or snapshots to keep this small.
⚔️Commit conflicts
When two writers touch the same data, one retries. Design jobs to touch separate partitions.
🔌Feature support
Not every engine supports every table feature. Test your tools together before relying on them.

11Real-World Examples

🔺Delta Lake
Widely used with Spark and the Databricks platform for batch and streaming tables.
🧊Apache Iceberg
Supported by many engines such as Spark, Flink, Trino and several cloud warehouses.
🪢Apache Hudi
Built for fast upserts and incremental processing of changing data.
☁️Cloud services
Major clouds offer managed query engines and catalogs that read these table formats.
🔄CDC to tables
Companies stream database changes into lakehouse tables so analytics stays close to real time.
🏢Consolidation
Many teams retire a separate warehouse copy and serve reports from lakehouse tables.
📝Note
This area changes quickly. Features, names and engine support differ between versions, so check current documentation.
Mini case: one platform instead of two
Before
🏞️Lakeraw files
→↓copy
🏛️Warehousereports
Two copies, two bills, drift
After
🏠Lakehouse tablesone copy, open formats
📊BI
🌊Streaming
🤖ML
Duplicate copies Single source
One governed set of tables serves reports, streaming and machine learning.

12Related Topics to Read Next

Data Lakes→

The cheap, raw storage a lakehouse is built on.

Data Warehousing→

The model of clean, fast SQL tables that the lakehouse borrows from.

ACID Transactions→

The guarantees the table log brings to object storage.

Object Storage→

Where the data files and the log live.

Change Data Capture (CDC)→

A common way to feed changes into lakehouse tables.

Batch vs Stream Processing→

Lakehouse tables can be written and read by both.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔What: lake storage plus a table layer that adds transactions and warehouse features.
  • ✔Formats: Delta Lake, Apache Iceberg, Apache Hudi.
  • ✔Key trick: write files, then commit once to a log. Readers trust only the log.
  • ✔Gains: ACID, schema rules, updates and deletes, time travel, one copy for BI, streaming and ML.
  • ✔Concurrency: optimistic. One commit wins and the other retries.
  • ✔Maintenance: compact small files, vacuum old versions after the retention period.
  • ✔Do not: edit table files by hand, or treat time travel as a backup.
  • ✔One line: “A lake that behaves like a database table, on cheap open storage.”
← Previous
Data Warehousing
Next →
Lambda Architecture