Failure and Disaster Prevention in Aurora PostgreSQL

1

Failure and Disaster Prevention in Aurora PostgreSQL We had assumed cross-region replication as a countermeasure method, but learned that it is not supported by Aurora PostgreSQL.

  1. How to implement cross-region replication even though it is not supported
  2. An alternative implementation that would satisfy almost the same requirements as cross-region replication.

Please tell us either or both of the above.

User
已提问 2 年前310 查看次数
2 回答
1
已接受的回答

Dear Customer, Adding to the response already provided - there are some ways you can achieve this

Firstly please allow me to inform you that when it comes to replication with Aurora PostgreSQL we have the following options:

  • PostgreSQL logical replication using the pglogical extension
  • Physical replication with Aurora global database
  • PostgreSQL native logical replication

Same has been mentioned in details in below AWS blog. [+] https://aws.amazon.com/blogs/database/understand-replication-capabilities-in-amazon-aurora-postgresql/

Also please note that Aurora PostgreSQL DB clusters don't support Aurora Replicas in different AWS Regions, so we can't use Aurora Replicas for cross-Region replication.

PostgreSQL native logical replication:

Now you asked if for PostgreSQL native logical replication if we have any AWS managed service to set up the same then please allow me to inform you that unfortunately we don't have anything like that. If we want to enable native PostgreSQL logical replication then there are certain steps that we need to follow.

Below are the two links which talks about native PostgreSQL logical replication in detail.

[+] Using PostgreSQL logical replication with Aurora - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Replication.Logical.html

[+] https://aws.amazon.com/blogs/database/using-logical-replication-to-replicate-managed-amazon-rds-for-postgresql-and-amazon-aurora-to-self-managed-postgresql/

PostgreSQL logical replication using the pglogical extension:

If we talk about PostgreSQL logical replication using the pglogical extension then you can go through below AWS blog which talks about the same with step by step instructions.

[+] https://aws.amazon.com/blogs/database/part-2-upgrade-your-amazon-rds-for-postgresql-database-using-the-pglogical-extension/

Physical replication with Aurora global database:

We can't use Aurora Replicas for cross-Region replication but we have a concept of Aurora global database.

AWS Aurora global databases span multiple AWS Regions, enabling low latency global reads and providing fast recovery from the rare outage that might affect an entire AWS Region. An Aurora global database has a primary DB cluster in one Region, and up to five secondary DB clusters in different Regions.An Aurora global database consists of one primary AWS Region where your data is written, and up to five read-only secondary AWS Regions. You issue write operations directly to the primary DB cluster in the primary AWS Region. Aurora replicates data to the secondary AWS Regions using dedicated infrastructure, with latency typically under a second.

Please go through below AWS documentation which talks about "Using Amazon Aurora global databases" in detail.

[+] https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html

AWS Database Migration Service (AWS DMS):

In the end you can also leverage AWS DMS service to set up replication between two Aurora PostgreSQL cluster both in different region.AWS Database Migration Service (AWS DMS) is a cloud service that makes it easy to migrate relational databases, data warehouses, NoSQL databases, and other types of data stores. You can use AWS DMS to migrate your data into the AWS Cloud or between combinations of cloud and on-premises setups.With AWS DMS, you can perform one-time migrations, and you can replicate ongoing changes to keep sources and targets in sync.

Below are the some documentation links for AWS DMS.

[+] What is AWS Database Migration Service? - https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html [+] Using a PostgreSQL database as an AWS DMS source - https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html [+] Using a PostgreSQL database as a target for AWS Database Migration Service - https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.PostgreSQL.html

Limitations:

[+] Limitations on using PostgreSQL as a target for AWS Database Migration Service - https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.PostgreSQL.html#CHAP_Target.PostgreSQL.LimitaTIONS

AWS
专家
已回答 2 年前
profile picture
专家
已审核 1 个月前
1

Hello User,

if I understood correctly, you want to achieve a cross-region resiliency for Aurora pg. While a "normal" Aurora pg cluster doesn't allow this (as you've already mentioned), Aurora Global Database should provide the level of disaster resiliency you're looking for.

Does this satisfy your requirements? Then I'd appreciate if you mark my answer as "accepted". Any questions left? Feel free to reach out via the comment section.

Kind regards, Uwe

profile pictureAWS
Uwe K
已回答 2 年前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则