BigData / Apache Iceberg Interview questions
What is the difference between copy-on-write and merge-on-read in Iceberg?
These are two different strategies for handling updates and deletes in Iceberg, trading off write cost against read cost, and the right choice depends on a table's specific ratio of writes to reads.
| Copy-on-Write (CoW) | Merge-on-Read (MoR) |
| Affected data files are entirely rewritten on update/delete. | Changes recorded as separate delete files; merged at read time. |
| Higher write cost (write amplification). | Lower write cost; overhead shifted to read time. |
| Fast reads; no merge logic needed at query time. | Reads must merge data files with delete files on the fly. |
| Better for read-heavy, infrequently-updated tables. | Better for write-heavy, high-frequency update/streaming workloads. |
Copy-on-write is Iceberg's traditional default strategy: even a single-row update rewrites the entire data file that row belongs to, which is simple and keeps reads fast, but becomes expensive under frequent, small updates since each one can trigger rewriting a comparatively large file for a small change.
Merge-on-read avoids that write amplification by instead writing a small delete file recording which rows have changed, deferring the actual reconciliation to query time, when the engine merges data files with their corresponding delete files — a better fit for streaming or high-update-frequency workloads where copy-on-write's rewrite cost would otherwise dominate.
More Related questions...