Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 2 of 6 · Concept · 25 min · revision 2

Lakes, Warehouses and Lakehouses Side by Side

Compare the three architectures by what they store, who can query it and what they guarantee, watch a plain data lake give wrong answers during a delete, and choose an architecture from stated requirements.

Contentsand lesson path

What you will learn

  • Compare warehouse, data lake and lakehouse architectures (catalog plus open table formats on object storage) and choose one for stated requirements.

01. Why it matters

Choosing where analytical data lives is one of the most expensive decisions a data team makes, because moving later means rewriting pipelines, permissions and habits. Vendors describe their products in overlapping words, so it helps to compare the three architectures by three plain questions: where are the bytes and in what format, which engines can read and write them, and what does the platform guarantee when several jobs touch the same table at once. This lesson answers those questions, shows the weak point of a plain data lake with a small experiment, and ends with a way to choose.

02. Three architectures, three questions

A data warehouse stores tables in its own managed storage, in a format only its engine reads. You get SQL, transactions, access control, statistics and tuning in one product, run by the vendor. The cost is lock-in: a Spark job or a Python model that needs the data must go through the warehouse's SQL interface or work from an exported copy, and every copy goes stale and must be secured separately.

A data lake is files on object storage, such as Amazon S3, Google Cloud Storage or Azure Blob Storage, in open formats like Parquet, JSON or CSV. Storage is cheap, any engine can read the files, and you can keep raw data that has no schema yet. But a folder of files has no transactions: nothing makes a change of many files appear all at once, nothing stops a job from writing a file with the wrong columns, and "the table" is simply whatever files a reader happens to list. Lakes without discipline become data swamps, where nobody knows which files are current or correct.

A lakehouse keeps the lake's open files on object storage and adds two pieces: an open table format (Apache Iceberg, Delta Lake or Apache Hudi), whose metadata lists exactly which files make up each version of a table, and a catalog, which maps table names to their current metadata and swaps that pointer atomically on each commit. That gives ACID transactions, schema enforcement, time travel and row-level updates on open files, readable by many engines. The cost is that you now operate more parts: the catalog, compatible engine versions, and regular maintenance such as compaction and expiring old snapshots.

Catalogs come in several kinds. Hive Metastore, from the Hadoop era, maps table names to folders and is still common. AWS Glue Data Catalog is a managed metastore. The Iceberg REST catalog is an open HTTP API that any engine can implement; services such as Apache Polaris and the catalogs of managed platforms provide it, and on Databricks, Delta tables are usually governed by Unity Catalog. The catalog is also where access control lives: if every engine goes through it, one permission rule covers SQL users and Spark jobs alike. Check that every engine you plan to use supports your catalog, because that matters as much as the table format.

03. Experiment: a delete in a plain lake

Suppose customer 7 asks for their data to be erased. In a plain lake, Parquet files cannot be edited in place, so a job must write a new copy of each file without that customer and then delete the old files. The script below does exactly that with DuckDB (pip install "duckdb==1.5.6"), and runs a reader query between the steps, as an analyst or dashboard might at any moment.

Python · plain_lake.py
"""Delete one customer's rows from a plain Parquet folder, as a data lake must."""
from pathlib import Path

import duckdb

lake = Path("lake/orders")
lake.mkdir(parents=True, exist_ok=True)
con = duckdb.connect()
for part in range(3):                      # three files written by earlier jobs
    con.execute(f"""
        COPY (SELECT {part} * 1000 + i AS order_id, i % 50 AS customer_id,
                     CAST(i % 90 + 10 AS DECIMAL(8, 2)) AS amount
              FROM range(1000) AS t(i))
        TO 'lake/orders/part-{part}.parquet'""")


def count(label):
    rows, c7 = con.sql("SELECT count(*), count(*) FILTER (customer_id = 7)"
                       " FROM 'lake/orders/*.parquet'").fetchone()
    print(f"{label:<34} rows={rows}  customer 7 rows={c7}")


count("before the delete")
# Parquet files cannot be edited in place: write new copies without customer 7,
# then remove the old files. Readers can run between any two of these steps.
for part in range(3):
    con.execute(f"""COPY (SELECT * FROM 'lake/orders/part-{part}.parquet'
                          WHERE customer_id <> 7)
                    TO 'lake/orders/part-{part}-v2.parquet'""")
    if part == 0:
        count("a reader after the first rewrite")
count("a reader before the old files go")
for part in range(3):
    (lake / f"part-{part}.parquet").unlink()
count("after the old files are removed")
Expected output (python plain_lake.py)
before the delete                  rows=3000  customer 7 rows=60
a reader after the first rewrite   rows=3980  customer 7 rows=60
a reader before the old files go   rows=5940  customer 7 rows=60
after the old files are removed    rows=2940  customer 7 rows=0

Readers during the job saw 3,980 and then 5,940 rows, although the true count is always 3,000 before and 2,940 after; old and new copies were both visible. If the job had crashed between the two loops, the duplicates would have stayed until someone noticed. A table format removes this window: the job writes the new files, then a single commit replaces the old file list with the new one, so a reader sees either the version before or the version after. Iceberg and Delta can also record deletes in small delete files instead of rewriting every data file at once. The lab One Lakehouse Table, Two Query Engines shows this from the reader's side.

04. Choosing for stated requirements

Start from requirements, not from products. These questions separate the options quickly:

  1. Engines: will one SQL engine serve everyone, or must Spark, Python and SQL tools all work on the same tables? Several engines point to a lakehouse.
  2. Team: is there someone to run a catalog, upgrade engines and schedule maintenance? Without a platform team, a managed warehouse removes most of that work.
  3. Changes to data: do you need updates, deletes for privacy law, or late corrections? Those need transactions, which a warehouse or a lakehouse provides and a plain lake does not.
  4. Data shape and volume: raw logs, images and semi-structured files that no one has modelled yet fit object storage; terabytes of tabular data fit all three.
  5. Lock-in and cost: open formats keep the option to change engines; a managed warehouse trades that option for less operational work.

Two short examples. A team of four analysts with 300 GB of sales data, only SQL users and no platform engineers, is best served by a managed warehouse; a lakehouse would add parts nobody has time to run. A company where data scientists train models in Python on the same clickstream that analysts query in SQL, with petabytes of history and a platform team, fits a lakehouse; forcing the scientists through exports from a warehouse would duplicate the largest dataset it has. Many organisations end up with both: raw files in a lake, curated tables in a lakehouse, and a warehouse engine that reads those open tables directly, which several warehouses now support.

05. Check your understanding

Practice check · 3 questions

Lakes, warehouses and lakehouses

Pick the best answer for each situation.

Q1. In `plain_lake.py`, the job writes `part-0-v2.parquet`, deletes `part-0.parquet`, then crashes before touching the other two files. What does a reader count?
Q2. A lakehouse table and a plain lake folder can hold identical Parquet files. What lets the lakehouse reader ignore a half-finished rewrite?
Q3. A security team keeps 400 TB of raw firewall logs a year. Files are only appended, never updated, deleted only when they expire, and one batch engine reads them a few times a year. What is a reasonable choice?
Practice only: not graded, not saved, not evidence.

06. Apply it

The skill practice loads one fact table into a warehouse and into an Iceberg table. Before you start, write five lines: the engines that must read the table, who will operate it, which updates or deletes it needs, its size, and how much lock-in you accept. Then state which architecture you would choose for that table in production, and check after the labs whether the measurements support your choice.

07. Review prompt

Without looking back, describe a warehouse, a data lake and a lakehouse by where their bytes live, which engines can use them and what they guarantee. Explain why the readers in the experiment saw too many rows and how a table format with a catalog prevents it. Then list the questions you would ask before choosing one of the three.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check