Merge-on-Read (MoR) is a data update strategy introduced in Apache Iceberg Spec v2. It is designed to solve a fundamental problem in data lakes: how to handle frequent updates and deletes without incurring the massive performance penalty of rewriting multi-megabyte Parquet files for every small change.

How Merge-on-Read Works

Under a MoR strategy, when a row is updated or deleted, the original data file containing that row is left untouched. Instead, Iceberg writes a new, small "delete file" that records the deletion. If the operation is an update, Iceberg writes the delete file to invalidate the old row, and writes a new data file containing the new row.

The "Merge" happens at read time. When a query engine reads the table, it must read the base data files and the associated delete files, merging them on the fly to produce the correct, current state of the table. It effectively subtracts the deleted rows from the base data before returning the result to the user.

When to Use Merge-on-Read

MoR optimizes for write performance at the expense of read performance. It is the architectural choice for workloads where write latency must be kept low, such as:

The Need for Compaction

The trade-off of MoR is read amplification. As updates accumulate, the number of delete files grows. At read time, the query engine must apply all these delete files, which slows down query execution. To maintain analytical performance, MoR tables require regular compaction. A scheduled maintenance job periodically reads the base files and delete files, physically merges them, and writes out fresh, clean data files (deleting the old ones), effectively resetting the read performance penalty.

Master the Agentic Lakehouse

Start building today with free trials and authoritative resources.

Architecting an Apache Iceberg Lakehouse

Architecting an Apache Iceberg Lakehouse

Buy on Manning
The AI Lakehouse

The AI Lakehouse

Buy on Amazon
Apache Iceberg and Agentic AI

Apache Iceberg and Agentic AI

Buy on Amazon
Lakehouse Built for Everyone

Lakehouse Built for Everyone

Buy on Amazon