postgresqlamazon-auroraaws-aurora-serverless

How does Aurora Postgresql Global database work for writes requests from multiple regions?


I have a single Aurora Postgresql serverless v2 cluster in AWS in one region. I am planning to deploy it to multiple regions by using global database. After some reading, I found in multiple regions cluster, it can only have one primary region which can take write requests. Multiple regions seems only benefits on read.

Let's say, I have two regions, one in US, the other is in EU, and if I pick the EU region as primary one, all the requests from US will have to call the endpoint in EU region for updating data. It will make the performance in US very bad.

How should I support multiple regions in Aurora postgresql? Do I miss anything?


Solution

  • You cannot do that, unless you shard your data: split the database in two parts, one that is predominantly used by the US and one that is mostly used by the EU. Each database gets some foreign tables to transparently access the other's data. Ideally, you partition your tables based on US/EU, then you can use the foreign table as a partition.

    Tables that are small and common to both reside only on one of the databases. You could use a foreign table or logical replication to make these data available on both sides.