Delta Lake's Transaction Log
The core design principle
A Delta table is a folder of data files plus a _delta_log/ subfolder. That subfolder holds one JSON file per commit, named with a zero-padded 20-digit version number.
The table's current state is defined as: replay every action in every commit file, starting from version 0 or the latest checkpoint. There's no manifest tree to walk — you read the log as a stream of events and build the answer as you go.
Actions — what's inside a commit JSON file
Each NNNN.json is newline-delimited JSON, one action per line:
| Action | Meaning |
|---|---|
metaData | Table schema, partition columns, table properties (written on creation / schema change) |
protocol | minReaderVersion / minWriterVersion, or table features — see below |
add | A new data file is now part of the table: path, partition values, size, per-column min/max stats, modification time |
remove | A data file is no longer part of the table — a logical delete; the file isn't necessarily gone from storage (see Compaction and maintenance, VACUUM) |
commitInfo | Metadata about the commit: timestamp, operation (WRITE, MERGE, DELETE…), parameters, engine info — this powers DESCRIBE HISTORY |
cdc | Change-data-feed rows for this commit, if CDF is enabled |
Here's a commit that rebuilds a single partition — df.write.mode("overwrite").option("replaceWhere", "dt = '2024-01-24'"). Two things to read carefully. operationParameters.mode: "Overwrite" is Spark's write mode, not a SQL UPDATE, and what gets replaced is just this partition's existing files (one old file here), not the whole table. And the two adds only mean Spark's writer produced two output files at its target size:
{"commitInfo":{"timestamp":1706000000000,"operation":"WRITE","operationParameters":{"mode":"Overwrite"}}}
{"remove":{"path":"part-00042-old.parquet","deletionTimestamp":1706000000000,"dataChange":true}}
{"add":{"path":"part-00099-new-a.parquet","partitionValues":{"dt":"2024-01-24"},"size":52428800,
"stats":"{\"numRecords\":91210,\"minValues\":{\"user_id\":4},\"maxValues\":{\"user_id\":998211}}"}}
{"add":{"path":"part-00100-new-b.parquet","partitionValues":{"dt":"2024-01-24"},"size":48210400,
"stats":"{\"numRecords\":88034,\"minValues\":{\"user_id\":17},\"maxValues\":{\"user_id\":997345}}"}}The stats field is a JSON string tucked inside the add. These are Delta's per-file column stats, doing the same job as Iceberg's manifest lower_bounds/upper_bounds — just stored differently, as JSON inside JSON rather than as typed Avro columns.
Reading the log: replay, not tree traversal
state = {}
for each commit file in order (0, 1, 2, ..., N):
for each action in commit:
if action is "add": state[path] = action # file is now live
if action is "remove": del state[path] # file is no longer live
current_file_list = state.values()On a table with 10,000 commits, replaying from version 0 means reading 10,000 JSON files before you can answer anything. That's the problem checkpoints solve.
Checkpoints
Every checkpointInterval commits (default 10), the writer that just committed also writes a checkpoint: one Parquet file holding the finished state as of that version — "here's the answer to replaying everything up to here." It also updates _last_checkpoint, a tiny JSON file naming the newest checkpoint.
That caps replay at "however many commits since the last checkpoint." Iceberg gets the same result from having one manifest list per snapshot; Delta gets it by saving the full state every so often instead of keeping a tree at all times.
Protocol versioning — from version numbers to table features
{"protocol":{"minReaderVersion":3,"minWriterVersion":7,
"readerFeatures":["deletionVectors"],
"writerFeatures":["deletionVectors","columnMapping"]}}Delta started with a single version number that gated a fixed set of features. Then it added optional features that don't depend on each other — deletion vectors, column mapping, change data feed, generated columns — and one number got too blunt. A client would have to support everything up to version N just to use one feature. So Delta switched to table features: named capabilities, each turned on separately, listed in readerFeatures and writerFeatures.
A reader that doesn't understand deletionVectors refuses to read the table at all instead of quietly returning wrong rows. Deletion vectors hide rows from outside the Parquet file (see Compaction and maintenance), so a reader that ignores them would hand deleted rows back to the user.
Iceberg solves the same problem with format-version (1, 2, or 3). Delta's version is finer-grained: adding a feature doesn't force a version bump on clients that never use it.
Reading a table: the full planning trace
For the same SELECT * FROM events WHERE dt = '2024-01-02' AND user_id = 42:
- Read
_last_checkpoint→ latest checkpoint = version 40 1 request - Read
checkpoint-40.parquet→ fulladd-file list as of v40 (say 800 files) 1 request - Read commits 41, 42, 43 → a few more add/remove actions 2–3 requests
- Merge → current file list, prune by
partitionValues.dt = '2024-01-02' - Prune remaining files by
stats.minValues/maxValuesonuser_id - Open surviving Parquet files, apply row-group stats, decode
Same shape as Iceberg's plan: read a few metadata files instead of doing a LIST, then use the stats inside them to skip files before touching any data. Delta just gets there with a checkpoint plus log replay instead of a manifest list plus manifests.
The Invariants
- Guarantees: Each numbered commit is written once and never changed. A reader either sees it or doesn't, never half of it.
DESCRIBE HISTORYis a complete, ordered audit trail, because every commit records acommitInfo. A reader that doesn't know a required table feature refuses to read instead of quietly returning wrong data. - Does not guarantee: It doesn't guarantee your write of
NNNN.jsonwins against another writer — that depends on the LogStore's atomic "create only if absent" plus conflict checks (see Concurrency control). And aremoveaction does not delete the file. Old files stay on disk, which is what time travel and in-flight readers need, untilVACUUM(see Compaction and maintenance).