Delta Lake

This page was inspired by my Apache Iceberg explorations: same problem (turning a bucket of Parquet into a real table), different design. For now I’ve done way less digging into the Delta Lake format than into Iceberg.

Delta Lake Explorer

Delta Lake Explorer is an interactive visualization I wrote to make Delta Lake’s internals tangible. You can simulate operations like append, delete, update, OPTIMIZE and VACUUM to see how the transaction log grows and what files are created “under the hood”, and you can also time-travel back through versions.

It has three levels of detail that show more and more concepts.

Notes from my Delta Lake learnings

Iceberg vs. Delta

The two formats converge on the same guarantees (ACID, time travel, schema evolution, Parquet data) but get there differently:

Apache IcebergDelta Lake
Metadata shapetree: metadata.json -> manifest list -> manifests -> dataflat, ordered log of JSON commits + Parquet checkpoints
“Current version”a pointer the catalog swaps (compare-and-swap)the highest-numbered file in _delta_log/
Atomicity fromatomic swap of the catalog pointeratomic creation of the next numbered log file
Partitioninghidden partitioning (transforms in metadata)Hive-style physical partitioning, or liquid clustering
Catalogcentral to the design (REST, Glue, Hive, …)optional; the log is self-describing on storage

Other cool features

Physical partitioning, then liquid clustering

Classic Delta partitioning is Hive-style and physical: partition by a column and Delta lays the data out in col=value/ directories. It works, but it inherits the old Hive problems - you can over-partition into millions of tiny files, and you can’t change the partitioning without rewriting data.

Liquid clustering is the newer answer. Instead of fixed directories you declare clustering keys, and Delta clusters the data on those keys as it writes and compacts - no directory explosion, and you can change the keys later without rewriting everything.

Deletion vectors (merge-on-read)

Data files are immutable, so deleting or updating a row has the same copy-on-write vs. merge-on-read tradeoff as Iceberg:

Deletion vectors are essentially the same idea Iceberg is moving to in its v3 spec.

Protocol versions and table features

Every Delta table declares a protocol with a minimum reader and writer version, so an old engine won’t silently mis-read a table that uses features it doesn’t understand.

The monotonic version numbers got coarse (each bump dragged in several features at once), so newer Delta uses table features: a table lists exactly which named reader/writer capabilities it needs (deletion vectors, column mapping, etc.), and an engine can open it as long as it supports that specific set. More granular capability negotiation than a single version number.

Other notes