liveBook · Manning

Chapter 10: Maintaining an Iceberg lakehouse

What you will learn in chapter 10 of Architecting an Apache Iceberg Lakehouse

This introduction explains why an Iceberg lakehouse needs proactive maintenance after deployment.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why an Iceberg lakehouse needs proactive maintenance after deployment.

Key terms: proactive maintenance, data and metadata layout, storage footprint

10.1 Problem: Suboptimal data files

This section introduces why an Iceberg lakehouse needs ongoing data-file maintenance as its tables change.

Key terms: data files, query performance, metadata overhead, system stability

10.1.1 Small files

This section explains why small Iceberg data files can accumulate, how they affect query planning and execution, and why they need maintenance.

Key terms: small files, streaming, micro-batch ingestion, frequent commits, freshness requirements, HDFS block size, cloud object storage, file count, object store API calls, read scheduling

10.1.2 Poorly colocated data

This section explains how poor data colocation slows queries and how Iceberg tables can be reorganized as access patterns change.

Key terms: colocation, partitioning, prune irrelevant files, query patterns, data locality, column-level compression, file or row-group statistics, Merge-on-Read (MOR), partition evolution, sort orders

10.1.3 Metadata sprawl

This section explains how Iceberg’s manifest and snapshot metadata can become a performance bottleneck and why maintenance must address both manifest fragmentation and snapshot history.

Key terms: snapshot, manifest list, manifest file, data file, metadata sprawl, manifest files, query planning latency, snapshot history, metadata.json, snapshot expiration

10.1.4 Merge-on-Read performance hits

This section explains why Merge-on-Read can slow Iceberg queries, how its costs compare with Copy-on-Write, and how compaction restores read performance.

Key terms: position deletes, equality deletes, Merge-on-Read, MOR, Copy-on-Write, COW, update density, Iceberg v2, Iceberg v3, delete files

10.2 Solution: Compaction

Compaction reorganizes Iceberg data and metadata to improve performance, but file rewrites require careful scheduling and resource choices.

Key terms: compaction, data files, delete files, manifest files, data colocation, SLAs, throughput constraints

10.2.1 What is compaction?

This section explains how Iceberg compaction rewrites data and metadata to keep tables efficient, and how to choose and scope compaction work.

Key terms: compaction, metadata overhead, predicate pushdown, delete files, bin-pack, sort compaction, Z-ordering, data locality, pruning, rewrite_data_files

10.2.2 Target file size

This section explains how to choose and validate compaction target file sizes while accounting for row-group behavior and workload constraints.

Key terms: compaction, row groups, parallelism, write.target-file-size-bytes, target file size, compression, table width, Iceberg metadata tables, query execution plans, I/O throughput

10.2.3 Files to be included

This section explains how Iceberg compaction selects and groups files, and how to tune that work to balance optimization against operational cost.

Key terms: eligible files, file groups, max-file-group-size-bytes, min-input-files, min-file-size-bytes, max-file-size-bytes, compaction, rewrite-job-order, incremental compaction, metadata table queries

10.2.4 Using filters to scope compaction

This section explains how filters limit compaction to selected data so maintenance can be incremental, responsive to table health, and suited to individual workloads.

Key terms: scoped compaction, SQL-like predicates, where parameter, FOR PARTITIONS clause, adaptive compaction, hot partitions, small files, delete files, compaction logic, sorting

10.3 Storage footprint management and data retention

Explains why Iceberg’s historical snapshots create a storage-retention tradeoff and make regular cleanup necessary.

Key terms: time travel, snapshot isolation, storage footprint, logically deleted, unreferenced files

10.3.1 Running snapshot expiration

Explains how snapshot expiration controls Iceberg storage and metadata growth, and how to set retention policies without losing needed history or disrupting queries.

Key terms: snapshot expiration, retained snapshot, metadata files, data files, expire_snapshots, VACUUM TABLE, time boundary, retain_last, time travel, snapshot isolation

10.3.2 COW vs. MOR: Implications for data retention

Explains how copy-on-write and merge-on-read affect file retention, and how to coordinate snapshot expiration, compaction, ingestion, and tags to manage an Iceberg table.

Key terms: COW, snapshot, data files, time travel, MOR, position deletes, equality deletes, deletion vectors, base data file, delete artifacts

10.3.3 Regulatory considerations for data deletion

This section explains how Iceberg’s snapshots and deferred file deletion affect regulatory erasure, and what maintenance and retention practices make deletion complete.

Key terms: logical deletion, physical removal, snapshots, compaction, MOR, delete files, expire_snapshots, rewrite_position_delete_files, orphan file cleanup, shared data files

10.4 Exploring Apache Iceberg’s metadata tables

This section explains how Iceberg metadata tables expose table state through SQL and help engineers identify maintenance needs.

Key terms: metadata tables, standard SQL queries, file-level insights, delete file tracking, snapshot growth, compaction, snapshot expiration

10.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 9: Understanding the consumption layer Chapter 11: Operationalizing Apache Iceberg →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.