Skip to content

Duplicating Iceberg tables across multiple regions

0

I have a set of iceberg tables in my Glue catalog in eu-west-1, pointing to a datalake also in eu-west-1. I'm wanting to create duplicate copies of the tables in my Glue catalog in eu-west-2. I've the DDL for the tables in eu-west-2, pointing them at the relevant preexisting prefixes in the eu-west-1 datalake, but whenever I query these tables, I get no results returned back. I've tried this with standard Hive tables, creating a copy in either region pointing at the same bucket and they work fine. What am I missing with regards to the Iceberg tables?

asked a year ago1.5K views

1 Answer
2

When working with Iceberg tables across multiple AWS regions, there are specific considerations that differ from standard Hive tables. The issue you're experiencing is likely related to how Iceberg manages metadata.

For Iceberg tables, simply creating DDL in the second region (eu-west-2) pointing to the same S3 location in the first region (eu-west-1) isn't sufficient. This is because Iceberg tables rely on metadata files that track the state and location of data files, and these metadata references need to be properly set up for cross-region access.

To properly duplicate Iceberg tables across regions, you should consider implementing a cross-Region replication architecture using Amazon S3 Multi-Region Access Points (MRAP). Here's how to approach this:

  1. Create your tables using MRAP location instead of the physical bucket location. This ensures that Iceberg metadata files point to the MRAP location rather than the physical bucket.

  2. Set up Amazon S3 MRAP to replicate Iceberg files across regions. MRAP supports data replication with a 15-minute SLA, and Iceberg's design prevents read inconsistencies during replication.

  3. Make the tables available in the AWS Glue Data Catalog in eu-west-2 by either:

  • Setting up a pipeline for replicating Iceberg table metadata using AWS Glue Data Catalog replication
  • Registering the tables in eu-west-2 using the Iceberg register_table procedure, pointing to the latest metadata.json file

Alternatively, if you're looking to migrate existing tables, you could use Iceberg's in-place migration capabilities. This approach generates Iceberg metadata files that link to your existing data files without requiring data rewriting, which is particularly efficient for large datasets with compatible file formats like Parquet, Avro, and ORC.

The key difference between Iceberg and standard Hive tables is that Iceberg maintains its own metadata layer that needs to be properly configured for cross-region access, whereas Hive tables can more easily reference data in another region directly.
Sources
Using Iceberg workloads in Amazon S3 - AWS Prescriptive Guidance
In-place migration - AWS Prescriptive Guidance

answered a year ago

EXPERT

reviewed a year ago

  • Does this solution support Glue APIs? According to the source URL referenced in the post, it is applicable only to the Spark SQL environment.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.