# Keeping a streaming Iceberg table healthy: small files, compaction, write modes | Chalk talks

Page: https://hallwaywire.com/chalk/c2aa9601c0/

Source: Hallway Wire (hallwaywire.com), an independent re:Invent news site. If you quote or reuse this, please credit Hallway Wire and link the page.

[All chalk talks](https://hallwaywire.com/chalk.html)

- **ANT428** Overflow, people turned away  Keeping a streaming Iceberg table healthy: small files, compaction, write modes  Continuous change-data feeds leave an Iceberg table full of small files and delete records, so the board walks through compaction and the copy-on-write versus merge-on-read choice.  From the chalk talk “Best practices for operating an Apache Iceberg lakehouse at scale”  ![The board](https://hallwaywire.com/chalk/c2aa9601c0/photo-02-board.jpg) ![The board](https://hallwaywire.com/chalk/c2aa9601c0/photo-06-board.jpg) ![The board](https://hallwaywire.com/chalk/c2aa9601c0/photo-07-board.jpg)  On the board Operational source A transactional database is the system of record. Its inserts, updates and deletes are the workload the lakehouse table has to keep up with. Sizing figures for event rate and data volume are written beside it. Change capture A change-data-capture stage reads the database's change stream and passes it on as events. The lakehouse stays near-real-time without querying the source directly. Stream processing A Spark-based stream processing stage takes the change events and writes them into the table. Frequent small commits from this stage are what create the small-file and metadata growth the rest of the board deals with. Data layer A group of small boxes stands for the many small data files that accumulate in object storage under the table. Each commit adds more files and more metadata, so query planning slows and costs climb unless something cleans them up. Compaction Compaction is labelled beside the data layer. It rewrites many small files into fewer, larger ones, and it is paired with manifest optimization in the session summary. It spends compute to buy faster reads and lighter metadata. Copy-on-write vs merge-on-read Two write modes are drawn side by side. Copy-on-write rewrites data files when rows change, which makes writes heavier and reads simple. Merge-on-read writes separate delete files and merges them at query time, which makes writes cheap and reads and compaction heavier. The merge-on-read side appears to show data files alongside delete files.  The pattern The design starts from a steady stream of row-level changes landing in an open table format on object storage. That stream is why the table needs continuous maintenance. The left-hand list of concerns (partitioning, disaster recovery, small files, interoperability, governance, computed columns) frames the talk as operations rather than initial design. The central trade-off is where to pay for updates: at write time with copy-on-write, or at read and compaction time with merge-on-read. Compaction, snapshot expiration and orphan file cleanup are the recurring jobs that keep either choice affordable.  Not legible in the photos: The sizing figures beside the source database (event rate, data volume, and the ingest, update and delete split) are too small and blurred to read reliably. Some labels on the merge-on-read boxes and the handwriting to the right of the stream processing box are also illegible. Snapshot expiration, orphan file cleanup and partition evolution were covered in the session but are not legible on the board.  If a CDC stream feeds your Iceberg tables, pick copy-on-write or merge-on-read based on your read-versus-write balance, and schedule compaction and snapshot cleanup from the start.  Apache Iceberg Apache Spark AWS Glue Amazon S3 Amazon S3 Tables  [AWS Glue](https://hallwaywire.com/track.html?q=AWS%20Glue) [Amazon S3 Tables](https://hallwaywire.com/track.html?q=Amazon%20S3%20Tables)  Photos and notes: [Adi C., via LinkedIn](https://www.linkedin.com/posts/thinkadi_aws-awsreinvent-reinvent2026-ugcPost-7533669795800551425-aTSt/)

