RDS backups: snapshots, point-in-time restore and what RPO really costs
Multi-AZ protects you from a dead host or a lost AZ. It does not protect you from DELETE FROM orders; without a WHERE, a migration that drops the wrong column, or ransomware with your credentials: the standby faithfully applies the mistake within milliseconds. That is the job of backups, and the two numbers that describe them: RPO (recovery point objective: how much data you may lose, measured in time) and RTO (recovery time objective: how long until you are back).
Need to know: automated backups (retention 1-35 days) take a daily snapshot and keep the transaction logs, which allows a point-in-time restore (PITR) to any second inside the restore window, up to about 5 minutes ago. Manual snapshots stay until you delete them. Every restore creates a new instance with a new endpoint, and it gets the default security group unless you say otherwise. Snapshots can be copied to another Region (and shared with another account).
What the instance keeps
$ aws rds describe-db-instances --db-instance-identifier shop-db --query 'DBInstances[0].[BackupRetentionPeriod,PreferredBackupWindow,LatestRestorableTime]' --output text
7 01:30-02:00 2026-09-22T19:55:04.000+00:00
$ aws rds describe-db-instance-automated-backups --db-instance-identifier shop-db --query 'DBInstanceAutomatedBackups[0].{retention: BackupRetentionPeriod, window: RestoreWindow, encrypted: Encrypted}'
{
"retention": 7,
"window": {
"EarliestTime": "2026-09-22T00:00:03.000+00:00",
"LatestTime": "2026-09-22T19:55:04.000+00:00"
},
"encrypted": true
}
$ aws rds describe-db-snapshots --db-instance-identifier shop-db --query 'DBSnapshots[].[DBSnapshotIdentifier,SnapshotType,Status]' --output text
rds:shop-db-2026-09-22-00-00 automated available
BackupRetentionPeriod: 7 means seven days of automated snapshots plus the logs between them. The restore window runs from the oldest kept backup to LatestRestorableTime, which trails the present by about five minutes (RDS uploads the transaction logs every five minutes). So the best RPO PITR gives is about 5 minutes. The backup window is when the daily snapshot is taken: the first snapshot is a full copy, later ones are incremental at the storage level, and on a Multi-AZ instance they are taken from the standby, so there is no I/O pause on the primary.
Retention 0 turns automated backups off: no PITR, and no read replicas (they need it). RDS also deletes automated backups when the instance is deleted, unless you choose to retain them. Manual snapshots survive.
A snapshot before the risky change
$ aws rds create-db-snapshot --db-instance-identifier shop-db --db-snapshot-identifier try-before-migration --tags Key=reason,Value=migration-0042 --query 'DBSnapshot.[DBSnapshotIdentifier,SnapshotType,Status]' --output text
try-before-migration manual creating
$ aws rds wait db-snapshot-available --db-snapshot-identifier try-before-migration
$ aws rds describe-db-snapshots --db-snapshot-identifier try-before-migration --query 'DBSnapshots[0].[Status,AllocatedStorage,Encrypted,SnapshotCreateTime]' --output text
available 20 True 2026-09-22T20:00:04.000+00:00
A manual snapshot is the cheapest insurance before a migration, an engine upgrade or a bulk fix: it is a fixed point you name and keep. You pay for snapshot storage beyond the size of the instance's allocated storage (automated backups up to that size are free).
Restoring: always a new instance
$ aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier shop-db --target-db-instance-identifier try-db-pitr --restore-time 2026-01-01T00:00:00Z
aws: [ERROR]: An error occurred (InvalidRestoreFault) when calling the RestoreDBInstanceToPointInTime operation: Restore time 2026-01-01T00:00:00.000Z is not within the restorable time range: 2026-09-22T00:00:03.000Z - 2026-09-22T19:55:34.000Z.
$ aws rds restore-db-instance-from-db-snapshot --db-instance-identifier try-restored --db-snapshot-identifier try-before-migration --db-subnet-group-name data-db --query 'DBInstance.[DBInstanceIdentifier,DBInstanceStatus,Endpoint.Address]' --output text
try-restored creating None
$ aws rds describe-db-instances --db-instance-identifier try-restored --query 'DBInstances[0].[VpcSecurityGroups[0].VpcSecurityGroupId,DBParameterGroups[0].DBParameterGroupName,MultiAZ]' --output text
sg-093bab5539b6bb729 default.postgres18 False
$ aws ec2 describe-security-groups --group-ids $(aws rds describe-db-instances --db-instance-identifier try-restored --query 'DBInstances[0].VpcSecurityGroups[0].VpcSecurityGroupId' --output text) --query 'SecurityGroups[0].GroupName' --output text
default
Four things to remember about every restore:
- The restore time must be inside the window: the error says exactly which window.
- It is a new instance, with a new name and a new endpoint. Nothing is overwritten. To put it in place, either repoint the application, or rename:
modify-db-instance --new-db-instance-identifieron the old one (shop-db-old), then on the new one (shop-db), and the old endpoint name now leads to the restored data. - It gets defaults for what you did not pass: the VPC's default security group (the app cannot reach it: a classic "the restore worked but the app times out"), the default parameter group, Single-AZ. Pass
--vpc-security-group-ids,--db-parameter-group-name,--multi-az. - It takes time: creating the instance plus restoring data plus replaying logs. For a large database that is tens of minutes to hours: that is your RTO, and you only know it if you have tested it.
Copies in another Region
$ aws rds copy-db-snapshot --source-db-snapshot-identifier arn:aws:rds:eu-central-1:111122223333:snapshot:try-before-migration --target-db-snapshot-identifier try-before-migration-dr --region eu-west-1 --source-region eu-central-1
aws: [ERROR]: An error occurred (InvalidParameterValue) when calling the CopyDBSnapshot operation: KmsKeyId should be explicitly specified when copying an encrypted snapshot to another Region.
$ aws rds copy-db-snapshot --source-db-snapshot-identifier arn:aws:rds:eu-central-1:111122223333:snapshot:try-before-migration --target-db-snapshot-identifier try-before-migration-dr --region eu-west-1 --source-region eu-central-1 --kms-key-id alias/aws/rds --query 'DBSnapshot.[DBSnapshotIdentifier,Status,SourceRegion]' --output text
try-before-migration-dr creating eu-central-1
An encrypted snapshot is encrypted with a Region-specific KMS key, so a cross-Region copy must name a key in the target Region. The same goes for sharing with another account: the snapshot must use a customer managed key that the other account may use (snapshots encrypted with the AWS managed aws/rds key cannot be shared). Copies in another Region and another account are what protect you from losing a Region, or from an attacker who deletes everything in the account. Doing it by hand does not scale, which is what AWS Backup is for (a later lesson): schedules, cross-Region copies and locked vaults for every resource type.
RPO and RTO for an RDS database, in practice
| failure | what helps | RPO | RTO |
|---|---|---|---|
| the primary's host or AZ dies | Multi-AZ | 0 | 1-2 min (failover) |
| a bad write or a dropped table | PITR into a new instance | ~5 min (or to the second before the mistake) | restore time + switch |
| a Region is lost | cross-Region snapshot copies or a cross-Region replica | copy interval / replica lag | restore or promote + DNS |
| the account is compromised | copies in another account, a locked vault | copy interval | rebuild + restore |
Deleting the instance is the last mistake to guard against:
$ aws rds delete-db-instance --db-instance-identifier try-restored
aws: [ERROR]: An error occurred (InvalidParameterCombination) when calling the DeleteDBInstance operation: FinalDBSnapshotIdentifier is required unless SkipFinalSnapshot is specified.
$ aws rds delete-db-instance --db-instance-identifier try-restored --final-db-snapshot-identifier try-restored-final --query 'DBInstance.DBInstanceStatus' --output text
deleting
RDS insists that you decide: a final snapshot, or --skip-final-snapshot on purpose. Add deletion protection on production (the first lesson) and keep the automated backups on delete for critical databases.
On the exam (SOA-C03 2.3, SAA-C03 2.2): "recover from data corruption with the least data loss" = point-in-time restore. "Keep a backup beyond 35 days" = manual snapshot (or AWS Backup). "DR copy in another Region" = copy-db-snapshot across Regions (with a KMS key there) or a cross-Region read replica. "The restored database cannot be reached" = it got the default security group. Restores never overwrite: they always create a new instance.
In an interview: "How would you recover from someone running DELETE without a WHERE on production RDS?" - "Note the time, then point-in-time restore into a new instance at a second before the DELETE, with the production security group and parameter group. Copy the deleted rows back from the restored instance (or switch the application over if the damage is wide), verify, and delete the temporary instance. Then fix why it was possible: access to production, reviewed scripts."
You can now: read an instance's backup retention, window and restorable times, take a manual snapshot, restore from a snapshot or to a point in time (and avoid the default security group), copy a snapshot to another Region with the right KMS key, and reason about RPO and RTO per failure.