Design backups for an RDS PostgreSQL database with RPO of 5 minutes and RTO of 1 hour, including a region failure.
AdvancedScenarioData and databases
Answer
Situation read → Within the region, automated backups and Multi-AZ cover it. The region-failure case needs data already sitting in a second region.
What I'd do →
- AZ failure: Multi-AZ (RPO about zero, failover in 1–2 minutes).
- Bad data or deletion: automated backups with PITR (RPO ~5 minutes from transaction log uploads), retention 14–35 days.
- Region failure: a cross-region read replica in the DR region (RPO seconds; promote it in minutes), or cross-region automated backup replication if a replica is too expensive (RPO minutes, RTO longer, because a restore takes time).
- Ransomware or account compromise: copy snapshots to a separate backup account with AWS Backup Vault Lock.
- Make RTO real: keep the DR region's infra in Terraform, ready to apply; DNS failover via Route 53; run a timed drill.
flowchart LR
P["Primary RDS ap-south-1"] -->|"sync"| S["Multi-AZ standby"]
P -->|"async replica"| R["Read replica ap-southeast-1"]
P -->|"PITR logs"| B["Automated backups"]
B -->|"copy"| V["Backup account vault, locked"]
Why → Each layer covers a different failure: hardware, human error, region, and attacker.
Interview tip → Separate "high availability" (Multi-AZ) from "backup" (PITR); Multi-AZ replicates a DROP TABLE instantly.
More on Data and databases
A release needs to rename a column that the running app reads and writes. How do you do it with zero downtime?IntermediateHow do you prove your database backups actually work?IntermediateYour migrations run in an init container and two pods ran them at the same time during a deploy, leaving the schema half-applied. How do you fix the approach?IntermediateUpgrade RDS PostgreSQL from 13 to 17 with minimal downtime. How?AdvancedYou need to add an index and a column to a 500-million-row table that's written to constantly. How do you avoid locking it?AdvancedUsers see stale data right after saving because reads go to a replica with lag. How do you handle it?Intermediate