How would you design a data lakehouse to handle petabytes of data with frequent GDPR right-to-be-forgotten requests and rapid schema evolution without sacrificing query latency?
An authoritative discussion on Apache Iceberg's table format, focusing on hidden partitioning, the trade-offs of copy-on-write versus merge-on-read, and managing schema drift at scale. Use this data engineering answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects data lakes to the point an interviewer is testing.
What the interviewer is scoring
- Does the candidate understand the difference between copy-on-write and merge-on-read in Iceberg?
- Whether they can explain how hidden partitioning prevents the need for query rewrites during partition evolution.
- That they evaluate the performance implications of small files and the necessity of compaction strategies.
- Whether the candidate appreciates how Iceberg uses field IDs rather than column names for robust schema evolution.
Answer
Short answer
An authoritative discussion on Apache Iceberg's table format, focusing on hidden partitioning, the trade-offs of copy-on-write versus merge-on-read, and managing schema drift at scale.
The illusion of immutable data
Modern data lakehouse architectures boast petabytes of analytical data capacity, promising high-throughput ingestion and rapid querying. However, the reality of regulatory compliance—such as GDPR's "right to be forgotten"—destroys the illusion of immutable, append-only datasets. When business logic demands rapid schema evolution alongside continuous, targeted deletions, traditional partitioned tables immediately collapse under the weight of full data rewrites and broken downstream pipelines.
Apache Iceberg provides the necessary transactional guarantees and snapshot isolation on top of raw object storage, effectively decoupling the physical data layout from the logical schema. When a pipeline initially appending daily partitions must transition to hourly partitions to satisfy latency requirements, rewriting historical data and modifying every downstream SQL predicate is an unacceptable operational tax. Iceberg's hidden partitioning solves this transparently. The table specification simply updates; new data partitions hourly, historical data remains daily, and the query engine automatically prunes without any changes to user-facing queries.
Why copy-on-write collapses under continuous deletions
The naive approach to managing data mutations relies entirely on copy-on-write semantics. Under copy-on-write, a single targeted deletion or update forces the rewrite of the entire underlying data file. At a massive scale, with continuous GDPR deletion requests, this write amplification fundamentally breaks the ingestion pipeline, introducing catastrophic latency and destroying cluster resources.
The cost of read-time merging
The inevitable pivot is configuring the Iceberg table for merge-on-read. Deletions are efficiently written to separate, smaller positional or equality delete files, bypassing the expensive rewrite of base data files. Write throughput recovers immediately. However, this introduces a predictable read-time penalty. The query engine must reconcile base files with an ever-expanding volume of delete files on the fly, leading to insidious performance degradation over time.
The only sustainable solution is rigorous, asynchronous maintenance. Spark-based compaction jobs must be scheduled to aggressively merge delete files into new base data files and consolidate small files into optimally sized chunks. Pairing compaction with data sorting or Z-ordering is mandatory to cluster related data, maximizing the effectiveness of Iceberg's file-level min-max filtering during query execution.
Schema evolution without the metadata tax
As product requirements drift, engineering teams will inevitably add, rename, and drop columns. Iceberg tracks columns by unique field IDs, not brittle column names. This ensures that a dropped and recreated column with the identical name does not silently corrupt historical data. The underlying Parquet files are never rewritten; the Iceberg metadata seamlessly maps the query to the correct physical structure.
Yet, the metadata layer itself becomes a liability if left unmanaged. Manifest lists and manifest files accumulate with every transaction, eventually bottlenecking the query planner. A draconian snapshot expiration policy is required to purge old snapshots and orphaned data files. Balancing time travel capabilities with storage costs and metadata query performance is not an option—it is a strict requirement for maintaining a highly available catalog under concurrent write loads.
flowchart TD
A["Data Ingestion (Spark)"] --> B["Iceberg Catalog"]
B --> C["Manifest List"]
C --> D["Manifest File"]
D --> E["Data Files (Parquet)"]
D --> F["Delete Files (MoR)"]
G["Compaction Job"] -.-> E
G -.-> FThe power of a modern data lakehouse lies not just in storing massive volumes of data, but in abstracting the physical layout from the logical schema, allowing you to independently evolve partitions, mutate records, and manage schemas without disrupting the downstream analytical ecosystem.
© 2026 Preptima. Originally published at preptima.com.
Likely follow-ups
- How would you tune your compaction schedule if delete files accumulate faster than nightly maintenance jobs can consolidate them?
- What happens to your partition evolution strategy if you need to roll back a table specification change after ingesting a day's data under the new spec?
- How do you bound metadata growth in the manifest list if snapshot expiration conflicts with a regulatory requirement to retain audit history for seven years?
Related questions
- How do you implement dynamic PII masking across a highly decentralised data mesh without destroying the analytical utility of the data for downstream machine learning workloads?hardAlso on data-engineering2 min
- How do you achieve true exactly-once semantics in Flink across source, state, and sink without cratering throughput?hardAlso on data-engineering2 min
- How do you diagnose and eliminate extreme data skew in a massive Apache Spark ETL pipeline when standard Adaptive Query Execution (AQE) fails to prevent out-of-memory crashes?hardAlso on data-engineering3 min
- How do you architect a strictly low-latency, real-time pipeline to ingest, embed, and index tens of thousands of unstructured documents per second into a vector database?hardAlso on data-engineering3 min