Sub topic 1
From data lakes and warehouses to the lakehouse
Prerequisites
This chapter assumes you know basic SQL (SELECT, JOIN, GROUP BY) and have a general idea of cloud object storage and virtual machines. You should also know the difference between a data lake and a data warehouse. No Databricks account is needed yet.
Two systems, two sets of trade-offs
Before the lakehouse, most organizations ran two separate systems.
A data warehouse stores structured data in a managed, proprietary format. It offers fast SQL, ACID transactions (changes either fully succeed or fully fail), and fine-grained access control. It is costly to scale, and it handles unstructured data such as images, logs, and free text poorly.
A data lake stores files in cheap cloud object storage, such as Amazon S3 or Azure Data Lake Storage. It accepts any file type and scales cheaply. But it is only a pile of files. It has no transactions, no enforced schema, and no built-in way to update or delete a single row.
Teams often copied data from the lake into the warehouse. That created two copies of the data, extra pipelines to maintain, delays between the copies, and separate security rules for each.
| Capability | Data lake | Data warehouse | Lakehouse |
|---|---|---|---|
| Storage | Open files in object storage | Proprietary managed storage | Open files in object storage |
| Data types | Any | Mostly structured | Any |
| ACID transactions | No | Yes | Yes |
| SQL performance | Limited | Strong | Strong |
| Cost to scale | Low | Higher | Low |
The lakehouse idea
A lakehouse keeps data in open file formats in object storage, then adds a metadata and transaction layer on top. That layer gives the files warehouse features: ACID transactions, schema enforcement, versioned history, and SQL access. One copy of the data then serves BI reports, data engineering, and machine learning.
Databricks implements this with two main parts. Delta Lake is the table format that adds the transaction log to files. Unity Catalog is the governance layer that names, secures, and audits the tables. Later chapters cover both in detail.
What this looks like in practice
In a lakehouse, you create a table and query it with plain SQL, even though the data sits as files in object storage.
CREATE TABLE IF NOT EXISTS main.tutorial.orders (
order_id BIGINT,
customer_id BIGINT,
amount DECIMAL(10, 2)
);
INSERT INTO main.tutorial.orders VALUES (1, 101, 25.00);
SELECT customer_id, SUM(amount) AS total_amount
FROM main.tutorial.orders
GROUP BY customer_id;This assumes the main.tutorial schema already exists and that you can create tables in it. The next chapters show how to set that up.
Common misunderstandings
- A lakehouse does not remove the need for data modeling. You still design tables and clean data.
- "Open" means the files use documented formats you can read with other tools. It does not mean there is no access control.
- A lakehouse is not automatically faster than a warehouse for every query. It removes copies and pipelines, which is the main gain.
Exercise
Name two problems of running a separate data lake and data warehouse, and say which lakehouse feature addresses each.
Show answer
First, data is copied between the two systems, which adds pipelines, delay, and duplicate copies. A lakehouse serves BI, engineering, and ML from one copy of the data. Second, the lake has no transactions or schema enforcement. A lakehouse adds a transaction layer (Delta Lake) over open files, giving ACID guarantees and schema enforcement. Separate security rules for each system are also a valid answer. Unity Catalog addresses that one with a single governance layer.