Apache Iceberg: The Complete Guide
In the previous lesson, What is Apache Iceberg, you saw that Iceberg operates as a modern table format for large analytic datasets. In this lesson, you will learn how Apache Iceberg’s architecture works. Building on that foundation, Iceberg uses a layered architecture to efficiently manage massive data, support schema evolution, and enable advanced capabilities such as time travel and concurrent writes.
Layers Overview
- Catalog Layer: Manages table locations and metadata pointers.
- Metadata Layer: Tracks table metadata, schema, partitioning, and file statistics.
- Data Layer: Stores the actual table data and delete information.
1. Catalog Layer
- S3: Uses a file named version-hint.text in the table’s metadata folder, containing the current metadata file version.
- AWS Glue:Â Stores the pointer as a table property called metadata_location, holding the full path to the current metadata file.
- Apache Hive: Uses the location table property to point to the current metadata file.
2. Metadata Layer
The metadata layer contains all metadata files for an Iceberg table. It forms a tree structure that tracks data files, delete files, and the operations that created them. This layer is essential for efficient data management and enables features like time travel and schema evolution.
Three key file types:
Manifest File
Manifest files track data files and delete files, along with statistics such as minimum and maximum column values. Iceberg generates these files incrementally during writes, which makes statistics collection efficient compared to legacy formats like Hive.
Info
1. Separate manifest files track data files and delete files, but both use the same schema. 2. Manifest files store statistics at write time, avoiding expensive full-table scans required by older formats. 3. Query engines use manifest file statistics (e.g., upper/lower bounds, null counts, partition data) for file pruning, improving query performance.
Manifest List
- Data file locations
- Partition information
- Upper and lower bounds of partition columns
Metadata File
- Concurrent writes: Multiple engines can write data simultaneously without conflict.
- Consistent reads: Readers always access the latest committed version of the table.
3. Data Layer
- Data Files: Store the actual table data. Supported formats include Apache Parquet, Apache Avro, and Apache ORC.
- Delete Files: Track rows deleted from the dataset without rewriting underlying data files, enabling efficient deletes.
Info
Data in a data lake should be immutable. Updates are handled by writing new files rather than modifying existing ones.
Data Modification Approaches
- Copy-On-Write (COW): Changes are applied by creating a new version of the data file with updates. The old file is replaced.
- Merge-On-Read (MOR): Changes (inserts, updates, deletes) are written to separate delta or delete files. Query engines merge these changes with base data at read time.
Supported Delete Operations
- MOR delete methods
- Positional delete files
- Equality delete files
Finish Course Early?
You have not completed all required lessons and assessments.