Managing Lake Tables with Apache Iceberg and Amazon S3 Tables
This lesson explains how open table formats such as Apache Iceberg make data lakes behave like databases, with transactions, updates and history, while keeping data in open files on S3 that many engines can read.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how Iceberg tracks snapshots in metadata.
- Use Iceberg features such as MERGE, time travel and schema evolution.
- Describe what Amazon S3 Tables manage automatically.
- Maintain self-managed Iceberg tables with compaction and snapshot expiry.
How Iceberg works
An Iceberg table is a set of data files (Parquet, ORC or Avro) plus metadata files recording the schema, partitioning and a list of snapshots. Each write creates a new snapshot atomically, so readers always see a consistent table and concurrent writers cannot corrupt it: ACID transactions.
The following diagram shows the layers of an Iceberg table.

Iceberg features
Apache Iceberg is an open table format that tracks a table's files in metadata, adding database-like behaviour to data stored in S3. It supports row-level changes in SQL with INSERT, UPDATE, DELETE and MERGE INTO, so applying change data capture or correcting records no longer means rewriting whole partitions. Schema evolution adds, renames or drops columns safely without rewriting data.
Hidden partitioning partitions by a transform of a column, such as the day of a timestamp, so queries filter on the column itself, and partition evolution changes the partitioning for new data without rewriting old data. Every commit creates a snapshot, which enables time travel, querying the table as it was at a snapshot or time, and rollback to undo a bad load. The following table summarises the features.
| Feature | What it gives you |
|---|---|
INSERT, UPDATE, DELETE, MERGE INTO | Row-level changes and upserts in SQL |
| Schema evolution | Add, rename or drop columns without rewriting data |
| Hidden partitioning | Partition by a transform such as day(timestamp) without partition columns in queries |
| Partition evolution | Change partitioning without rewriting old data |
| Time travel and rollback | Query or restore the table as of a snapshot or timestamp |
Athena, Glue, EMR, Redshift, Data Firehose (streaming writes), SageMaker Unified Studio and Lake Formation all work with Iceberg tables in the Glue Data Catalog. Apache Hudi and Delta Lake are alternatives supported by Glue and EMR.
The following diagram shows the snapshots that successive MERGE batches create in an Iceberg table.

Iceberg features
Amazon S3 Tables
Running Iceberg tables in ordinary S3 buckets requires regular maintenance: compacting small files, expiring old snapshots and removing files that no table version refers to any longer. Without it, query performance degrades and storage costs grow. Amazon S3 Tables provide table buckets, a type of S3 bucket built specifically for Iceberg tables.
Table buckets offer higher transaction performance than general-purpose buckets and perform automatic maintenance, namely compaction, snapshot management and removal of unreferenced files, so teams do not need to schedule maintenance jobs. They integrate with the AWS Glue Data Catalog, so the tables can be queried by Athena, Redshift, EMR and other engines like any other catalogued table.
The following diagram compares table maintenance in each kind of bucket.

S3 Tables or self-managed?
Maintaining self-managed tables
Iceberg tables need regular maintenance. Frequent writes, especially from streams, create many small files, and compaction merges them into fewer large files so queries open fewer objects; it is run with Athena OPTIMIZE or Spark rewrite procedures. Every commit also keeps old snapshots and their files, so snapshot expiration removes snapshots older than the retention period, and orphan file clean-up deletes files no snapshot references, both done with Athena VACUUM. Glue Data Catalog optimisers can perform these tasks automatically, and S3 Tables performs them for you. The following table summarises the tasks.
| Task | How |
|---|---|
| Compaction (merge small files) | Athena OPTIMIZE or Spark rewrite procedures |
| Snapshot expiration and orphan file clean-up | Athena VACUUM |
| Automatic optimisation | Glue Data Catalog optimisers |
Iceberg maintenance
Applying CDC changes to a lake table
DMS writes inserts, updates and deletes from an orders database to S3 every few minutes. Analysts need a table that always shows each order's current state. With an Iceberg table, a scheduled job merges the latest changes:
MERGE INTO lake.orders t
USING (SELECT * FROM staging.order_changes WHERE batch_id = '2026-10-09T10:15') s
ON t.order_id = s.order_id
WHEN MATCHED AND s.op = 'D' THEN DELETE
WHEN MATCHED THEN UPDATE SET status = s.status, total = s.total, updated_at = s.updated_at
WHEN NOT MATCHED AND s.op <> 'D' THEN INSERT (order_id, status, total, updated_at)
VALUES (s.order_id, s.status, s.total, s.updated_at);Iceberg's ACID transactions mean readers never see a half-applied batch. Time travel (FOR TIMESTAMP AS OF) lets analysts see yesterday's state, and compaction keeps file counts healthy. With Amazon S3 Tables, compaction and snapshot expiry run automatically.
How can an Iceberg table's partitioning be changed without rewriting old data?
Show answer
With partition evolution: new data uses the new layout while old data keeps the old one.
Exam Tips
Remember for the exam
- For upserts and deletes in the data lake, use Iceberg MERGE INTO and DELETE.
- To query data as it was yesterday, use Iceberg time travel.
- To change partitioning without rewriting old data, use partition evolution.
- Managed Iceberg storage with automatic compaction is S3 Tables.
- When an Iceberg table has too many small files, compact it with OPTIMIZE.