Part 1 · Foundations and history · Chapter 1
Warehouses, lakes and the lakehouse
Why the two-tier architecture of a data lake feeding a warehouse broke down, and what exactly a lakehouse adds on top of files in object storage. The argument of the CIDR 2021 paper, and a map of the book.
After this chapter you should be able to:
- Define a lakehouse in terms of concrete capabilities: a transactional metadata layer over open formats, plus the techniques that recover warehouse performance.
- Explain the failure modes of the two-tier lake plus warehouse design.
- Place Delta, Iceberg and Hudi in that history, and find the chapter for each layer.
A lakehouse is a specific technical claim: that you can keep all of an organization’s data as files in an open format on cheap object storage, and still get transactions, governance and warehouse-class SQL performance from it, by adding a metadata layer and a few performance techniques on top. This chapter sets out where that claim came from, following the paper that named it, and ends with a map of where the rest of the book takes each layer apart.
The warehouse lineage
The Lakehouse paper by Michael Armbrust, Ali Ghodsi, Reynold Xin and Matei Zaharia (CIDR 2021) tells the history in generations.[Lakehouse, CIDR 2021, section 1] First-generation data warehouses loaded operational data with schema-on-write: the data was cleaned and typed on the way in, into a store optimized for BI queries. Compute and storage were coupled in on-premises appliances, so a customer provisioned and paid for peak load, and the systems were not built for unstructured data such as video, audio and text.
A warehouse owns its storage. Its files are in a proprietary layout that only its own engine reads, which is what lets it guarantee transactions and tune the layout for its optimizer, and is also why every other tool has to go through its SQL interface.
Q1. According to the Lakehouse paper, what limited first-generation warehouses?
The Hadoop data lake
The second generation moved raw data into data lakes: low-cost storage with a file API, holding data in open formats such as Parquet and ORC, starting with Apache Hadoop and HDFS. Reads were schema-on-read, which made ingestion cheap and flexible and, in the paper’s account, pushed the problems of data quality and governance downstream. A small subset of the data was then copied into a warehouse for the most important BI workloads.[Lakehouse, section 1] From about 2015, cloud object stores (S3, ADLS, GCS) replaced HDFS as the lake.
Hive (VLDB 2009, Facebook) set the convention that every format in this book still has to answer: a table is a directory, a partition is a subdirectory, and a metastore records each table’s schema and location.[Hive, VLDB 2009] The data of a table is whatever files a listing of its directory returns at that moment.
Q1. What did "schema-on-read" in the second-generation data lake defer, according to the paper?
Q2. In Hive, what is a table physically?
What went wrong
The result was a two-tier architecture: raw data in the lake, ETL into a warehouse for BI, and often a further export for machine learning. The paper names four problems with it:[Lakehouse, sections 1 and 2]
- Reliability. Keeping the lake and the warehouse consistent is hard and costly. Every ETL step can fail or introduce bugs, for example from differences in types, SQL dialects or schemas between the two engines.
- Staleness. Data in the warehouse is older than in the lake, often by days. The paper cites a survey in which 86% of analysts said they use out-of-date data.
- Limited support for advanced analytics. ML libraries such as TensorFlow, PyTorch and XGBoost read large volumes with non-SQL code, and ODBC or JDBC is an inefficient way to do that. Exporting files adds a third ETL step, and reading the lake directly gives up the warehouse’s transactions, versioning and indexes.
- Total cost of ownership. Users pay for continuous ETL and for storing the data twice, and proprietary formats make it costly to move.
Under those sits a mechanical problem that the second half of the paper addresses: the lake itself has no transactions. A job that rewrites a table’s files is a sequence of independent object writes and deletes, so a reader that lists the directory mid-job sees some old files and some new ones, and a job that fails halfway leaves the table in that state. Object stores offer no atomic change to a set of files (chapter 3), so the directory cannot be the table.
Q1. Which problems does the paper attribute to the two-tier lake plus warehouse design? (select all that apply)
Q2. Why do ML systems fit poorly on a warehouse, per the paper?
The lakehouse argument
The paper defines a lakehouse as a data management system based on low-cost, directly accessible storage that also provides traditional analytical DBMS management and performance features: ACID transactions, data versioning, auditing, indexing, caching and query optimization.[Lakehouse, section 3] It makes three technical moves.
1. A transactional metadata layer over open files. Instead of the directory, a table is defined by a log or metadata tree that lists exactly which files make up each version. A commit is one atomic step, so readers see either the old version or the new one, never a mix. The paper names Delta Lake (developed at Databricks from 2016, with its log stored in the lake itself), Apache Iceberg (from Netflix) and Apache Hudi (from Uber), and lists what the layer enables: transactions, time travel, zero-copy cloning, schema enforcement, constraints, and governance such as access control and audit logging.[Lakehouse, section 3.2][Delta Lake, PVLDB 2020] That layer is the subject of parts 4 to 6 of this book, and the catalog that sits above it of part 7.
2. SQL performance without a proprietary format. Because the base data must stay in an open format, the engine recovers performance with techniques that work regardless of format: caching hot files on SSD or in memory, possibly transcoded; auxiliary data such as per-file min/max statistics kept in the metadata layer for data skipping; and data layout, ordering records by one or more dimensions with space-filling curves such as Z-order and Hilbert curves so that skipping works on several columns.[Lakehouse, section 3.3] The paper reports TPC-DS at scale factor 30,000 on 960-vCPU clusters, with Databricks’ engine over Delta Lake performing comparably to or better than four cloud warehouses at a lower price. Those are the authors’ own measurements of their own system; the techniques themselves are the subject of parts 3, 8, 9 and 10.
3. Declarative DataFrame APIs for ML. DataFrame operations in Spark are lazily evaluated and planned, so ML libraries that read through them get the same skipping, caching and layout benefits as SQL.[Lakehouse, section 3.4]
The paper also lists open questions, among them whether there are other ways to reach these goals, what the right storage formats and access APIs are, and how the lakehouse affects other research areas.[Lakehouse, section 4] Much of what has happened since, such as catalog-managed commits (chapter 14), the Iceberg REST catalog (chapter 21) and format interoperability (chapter 22), reads as answers to them.
Q1. What is a lakehouse, in the paper's definition?
Q2. What does the paper's metadata layer add that plain object storage lacks?
Q3. Which format-independent techniques does the paper propose for SQL performance on open formats? (select all that apply)
- Land raw data in the lake Files serve engineering and ML workloads.
- Copy into the warehouse A separate load makes warehouse tables available for SQL.
- Write open data files Files live in storage that engines can access directly.
- Publish a table version Transactional metadata identifies the files readers share.
Map of the book
The home page’s architecture diagram follows a query from the top down. The parts follow the same layers from the bottom up:
| layer | question it answers | part, chapters |
|---|---|---|
| Object storage | What does S3 guarantee, and how do you build a commit on it? | Part 2: chapters 3, 4 |
| File format | How are columns laid out, encoded and skipped inside one file? | Part 3: chapters 5 to 8 |
| Table protocol, Delta | Which files are in version N, and how does a writer create N+1? | Part 4: chapters 9 to 15 |
| Table protocol, Iceberg | The same questions, answered with a metadata tree and a catalog | Part 5: chapters 16 to 21 |
| Both | How do they compare, and can one copy serve both? | Part 6: chapter 22 |
| Catalog and governance | Who owns names, commits and access? | Part 7: chapters 23, 24 |
| Layout | How do partitioning, clustering and compaction make skipping work? | Part 8: chapters 25 to 28 |
| Engine | How does Spark plan, scan, join and write these tables? | Part 9: chapters 29 to 35 |
| Databricks runtime | What does Photon and the managed platform add? | Part 10: chapters 36, 37 |
| Reference | How to read the specs, and the glossary | Part 11: chapters 38, 39 |
Chapter 2 puts the people, papers and releases on one timeline.
Try it
- Copies and staleness: move the hour slider and watch the warehouse and ML copies fall behind between ETL runs. Click an ETL run to fail it and see the lag double. The lakehouse row stays current.
- Overwrite atomicity: step through a three-file overwrite. The directory lister sees old and new files mixed for two steps; the log reader switches at the commit.
Three copies of the data, two ETL steps that can fail, and BI and ML see different versions.
One copy, in an open format, with a transaction log on top. Both workloads read the latest commit.
Summary
- Warehouses own their storage and give transactions and fast SQL; data lakes give cheap, open, directly readable files but no transactions, and schema-on-read pushes quality and governance downstream.
- Running both as two tiers costs reliability, freshness, ML access and money, per the Lakehouse paper (CIDR 2021).
- A lakehouse keeps one copy in an open format and adds a transactional metadata layer (Delta, Iceberg, Hudi) so a commit is atomic, plus caching, auxiliary statistics and data layout to recover performance, and DataFrame APIs so ML gets the same benefits.
- The rest of the book takes the stack apart layer by layer, from S3 up to the engine.
Primary sources
Review this chapter
This chapter has 8 quiz questions.