To backup or not to backup the PostgreSQL Replica? Am lost/confused.

0

Hi,

We have PostgreSQL Aurora and PostgreSQL RDS non-Aurora.

Whenever we want to do a DR Test of some for PostgreSQL Aurora, we take a snapshot of the cluster and this backs up everything, Reader and Writer, and we test the restore also using the manual snapshot that we took and under a different cluster name. We do the DR testing using the Failover option.

Now, we have a PostgreSQL RDS non-Aurora that has a Primary and a Replica and we want to do a DR test as well using the Reboot option of the Primary and expecting that it will restart and be on a different zone. Question is do we need to do a backup of both the Primary and the Replica or just the Primary and then maybe recreate the Replica if need be? At the moment, the Primary is Multi-AZ and the Replica is Single-AZ.

I can't find a note or something that discusses this scenario. Just wanting to know if I am getting paranoid with the backups for no reason. Any advice much appreciated. Thanks in advance.

asked a month ago40 views
1 Answer
0

For your PostgreSQL RDS non-Aurora setup with a Primary (Multi-AZ) and a Replica (Single-AZ), you don't need to back up both the Primary and the Replica for DR testing purposes. Here's why:

  1. In a Multi-AZ deployment, Amazon RDS automatically maintains a synchronous standby replica in a different Availability Zone. This standby replica is not the same as your read replica.

  2. When you perform a reboot with failover on the Primary instance, RDS will automatically switch to the standby replica in the other Availability Zone. This process doesn't require a separate backup of the Primary.

  3. The read replica you have is primarily for read scaling and is not directly involved in the Multi-AZ failover process.

  4. Automated backups and manual snapshots of your RDS instance capture the data from the Primary instance, which includes all the information needed to restore or create new instances.

For your DR test:

  1. You only need to take a snapshot of the Primary instance. This snapshot will contain all the necessary data.

  2. Perform the reboot with failover on the Primary instance to test the Multi-AZ functionality.

  3. If needed, you can recreate the read replica from the Primary after the failover.

You don't need to back up the read replica separately, as it's not part of the core High Availability setup. If you lose the read replica during the DR test, you can always recreate it from the Primary.

Remember, the Multi-AZ feature is designed to handle failover automatically, so your focus should be on testing this functionality rather than backing up individual components. Your approach of taking a snapshot before the test is a good practice to ensure you have a recent backup in case anything goes wrong during the test.
Sources
Backup and restore design - SQL Server to Aurora PostgreSQL Migration Playbook
Backing up and restoring an Amazon Aurora DB cluster - Amazon Aurora
Overview of backing up and restoring an Aurora DB cluster - Amazon Aurora

profile picture
answered a month ago

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.

Guidelines for Answering Questions