Theory · Page 20 of 34 · Platforms and data in motion

20. Table formats and the lakehouse: Delta Lake, Iceberg and the medallion layers

A table format turns a folder of Parquet files into a table with transactions: a log or a tree of metadata says which files make up each version. That gives the lake what a warehouse had (atomic changes, consistent reads, schema evolution, time travel), and with it the lakehouse; the medallion layers organise the tables from raw to ready.

Files gaining a transaction log, then flowing through bronze, silver and gold
Playback speed

The clip starts with a folder of Parquet files that two jobs write at once: a reader in the middle of a write sees half of it. A transaction log is added, and each commit becomes a numbered entry that adds and removes files: the table is version 0, then 1, then 2, and a reader always sees a whole version. An update rewrites a file and records the swap; a new column is a commit to the schema; time travel reads an earlier version. Then the tables are arranged in three layers: bronze as received, silver cleaned and conformed, gold shaped for the board.

The intuition: a list of which files count

Harbour Mutual's lake holds the claims as Parquet files in a folder. A nightly job rewrites them while the actuaries query. On a bad night the job fails halfway, and the folder holds some old files and some new ones: the query adds up a table that never existed. Nobody can say what the claims looked like last Tuesday, because last Tuesday's files were overwritten.

A warehouse never had this problem, because its database kept a log of what each transaction changed. The fix for the lake is the same idea: next to the files, keep a list, in order, of which files make up the table after each change. A reader reads the list first and uses only the files it names. A writer adds its files and then, in one atomic step, appends a new entry to the list. Until that step, nobody sees its files; after it, everybody does.

Remember A table format keeps an ordered log of which files make up each version of a table: readers see whole versions, writers commit atomically, and old versions stay readable.

The theory: logs, snapshots, evolution and layers

Delta Lake keeps a transaction log in a _delta_log folder beside the data: one JSON file per commit, numbered from zero. Each commit holds actions: add a file, remove a file, change the metadata (schema, partitioning, properties), record the protocol version. The table's state at version n is the result of replaying commits 0 to n; every ten commits a checkpoint in Parquet summarises the state so readers need not replay everything. A commit succeeds only if no other writer committed the same version first: optimistic concurrency, made atomic by the storage's put-if-absent.

Apache Iceberg reaches the same goal with a tree. A metadata file holds the schema, the partition spec and a list of snapshots; each snapshot points to a manifest list, which points to manifests, which list the data files with their column statistics. A catalogue holds the pointer to the current metadata file, and a commit swaps that pointer atomically. Iceberg's hidden partitioning derives partitions from a column (days of loss_date) so queries filter on the column, not on a partition field, and the scheme can change later.

Both give a lake ACID transactions: a commit is all or nothing (atomic), leaves the table valid (consistent), is invisible until done (isolated, as snapshot isolation) and survives failures (durable). Both support time travel (reading the table as of a version or a time, until old files are cleaned up by VACUUM or snapshot expiry) and schema evolution: adding a column is a metadata change, with old files read as nulls for it. Renaming or dropping a column needs column mapping by id rather than by name, which Iceberg has always used and Delta enables as a feature.

A Delta table's versions: create, insert, update, add a column, travel back, read the log (run on Spark 4.0.1 with Delta Lake 4.0.1 in CI)
CREATE SCHEMA silver;

CREATE TABLE silver.claim_reserves (claim_number STRING, reserve DECIMAL(12,2)) USING DELTA;

INSERT INTO silver.claim_reserves VALUES
  ('CL-2026-00005', 6750.00),
  ('CL-2026-00009', 5500.00),
  ('CL-2025-00023', 1750.00);

UPDATE silver.claim_reserves SET reserve = reserve + 500.00 WHERE claim_number = 'CL-2026-00005';

ALTER TABLE silver.claim_reserves ADD COLUMNS (currency STRING);

SELECT CAST(SUM(reserve) AS STRING) AS total FROM silver.claim_reserves VERSION AS OF 1;
SELECT CAST(SUM(reserve) AS STRING) AS total FROM silver.claim_reserves;
SELECT COUNT(*) AS rows_without_currency FROM silver.claim_reserves WHERE currency IS NULL;
DESCRIBE HISTORY silver.claim_reserves;

The log holds 4 commits: CREATE TABLE, WRITE, UPDATE, ADD COLUMNS. Version 1 still totals €14,000; after the update the table totals €14,500. Adding the currency column rewrote no file: the 3 existing rows read it as empty.

A lakehouse, in Armbrust and colleagues' term, is the combination: open files on cheap object storage, a table format for transactions and metadata, and engines that bring warehouse features (SQL, indexes and statistics, access control) to those tables, so one copy of the data serves BI and machine learning.

The medallion layers The medallion architecture organises a lakehouse's tables by how refined they are. Bronze holds data as received, append-only, with its load time and source, so any later step can be replayed. Silver holds it cleaned, typed, deduplicated and conformed to managed codes and keys (the golden customer of page 14, the loss causes of page 10), often with history (page 6). Gold holds it shaped for a use: dimensional models, aggregates, a semantic model's tables (page 9). Quality gates (chapter 17) sit between the layers. The names are a convention, not a standard: what matters is that each layer has a contract and an owner.

Why it matters

For the merger, Kestrel's files and Harbour Mutual's tables can land in one lake, under one format, with each load an atomic commit. When an auditor asks what the board saw on a given day, time travel answers from the table itself.

The format is also an exit door: Delta and Iceberg are open specifications that several engines read, so the data outlives the choice of compute.

Where it goes wrong

  • Writing files around the log. A job that drops Parquet files into the folder directly makes data the table cannot see.
  • Time travel as backup. Old versions disappear when files are vacuumed or snapshots expire; keep backups apart.
  • Renames without column mapping. Matching columns by name turns a rename into a lost column.
  • Gold built from bronze. Skipping silver repeats the cleaning in every gold table, each slightly differently.
  • Many tiny commits. Streaming one row per commit floods the log; compact and checkpoint.

Check yourself

Choose an answer to each question, then press Check.

1. In Delta Lake, what makes a write visible to readers?
2. In Apache Iceberg, what does a snapshot point to?
3. Which medallion layer keeps data as received, so later steps can be replayed?
Answer every question first.

Sources

The works this page draws on, summarised in its own words rather than quoted. Read them for the full argument.

  • Delta Lake transaction log protocol (the Delta Lake project's PROTOCOL specification)Commits as ordered JSON files of add, remove and metadata actions; checkpoints; optimistic concurrency; column mapping.
  • M. Armbrust et al., "Delta Lake: High-Performance ACID Table Storage over Cloud Object Stores", Proceedings of VLDB, 2020Why object stores need a transaction log, and how the log gives ACID tables and time travel.
  • Apache Iceberg table specification, format versions 1 and 2Metadata files, snapshots, manifest lists, manifests, hidden partitioning and schema evolution by field id.
  • M. Armbrust, A. Ghodsi, R. Xin and M. Zaharia, "Lakehouse: A New Generation of Open Platforms that Unify Data Warehousing and Advanced Analytics", CIDR, 2021The lakehouse as open files plus a metadata layer plus warehouse features.

Practise it

The chapters that put this theory to work on Harbour Mutual and Kestrel:

The tools to try it in:

  • Platform designer · Build an Azure reference architecture from parts, check it against the requirements, and export its Bicep.

Terms taught here: LakehouseQuality gateMedallion architectureDelta LakeTime travel

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to the Cloud Data Architecture Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.