OnCallReadyStart learning

AWS Lesson 38.8 · AWS V: Data, Resilience & the Edge · 15 min read

RDS backups: snapshots, point-in-time restore and what RPO really costs

In plain words

Multi-AZ is a twin who copies everything you do instantly, including your mistakes: delete the wrong rows and the twin deletes them too. Backups are different. RDS takes a photograph of the database every night and writes down every change in between, so it can rebuild the room exactly as it was at any second of the last week, up to about five minutes ago.

Rebuilding never touches the original room. It builds a new one next door, with a new address, and you decide what to carry back.

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:

  1. The restore time must be inside the window: the error says exactly which window.
  2. 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-identifier on the old one (shop-db-old), then on the new one (shop-db), and the old endpoint name now leads to the restored data.
  3. 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.
  4. 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

failurewhat helpsRPORTO
the primary's host or AZ diesMulti-AZ01-2 min (failover)
a bad write or a dropped tablePITR into a new instance~5 min (or to the second before the mistake)restore time + switch
a Region is lostcross-Region snapshot copies or a cross-Region replicacopy interval / replica lagrestore or promote + DNS
the account is compromisedcopies in another account, a locked vaultcopy intervalrebuild + 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.

Why it helps

A dropped table, a migration that removes the wrong column or a DELETE without a WHERE is far more common than a dead AZ, and only backups help. The numbers that describe them, RPO and RTO, are what the business will ask about after the incident.

The details decide whether a restore works under pressure: the restore window, the new endpoint, the default security group the restored instance gets, the KMS key a cross-Region copy needs. Practising them once in a lab is much cheaper than learning them during the outage.

Commands in this lesson

aws

FAQ

How far back and how recently can I restore?

Automated backups keep 1 to 35 days (7 in the lab) of daily snapshots plus the transaction logs between them. The restore window runs from the oldest backup to LatestRestorableTime, about five minutes behind the present because RDS uploads the logs every five minutes. So the best RPO point-in-time restore gives is about five minutes.

Does a restore overwrite my database?

Never. Every restore creates a new instance with a new name and a new endpoint. To put it in place, repoint the application, or rename: modify-db-instance --new-db-instance-identifier turns the old one into shop-db-old, then the restored one takes the old name and its endpoint. Often it is simpler to copy the damaged rows back.

Why can't the application reach the restored instance?

A restore takes defaults for everything you did not pass: the VPC's default security group, the default parameter group, and Single-AZ. The default security group does not let the app in, which is the classic "the restore worked but the app times out". Pass --vpc-security-group-ids, --db-parameter-group-name and --multi-az on the restore.

What is the difference between automated backups and manual snapshots?

Automated backups expire with the retention period and are deleted with the instance unless you choose to keep them; they make point-in-time restore possible. Manual snapshots stay until you delete them, which suits a copy before a migration or retention beyond 35 days. Retention 0 turns automated backups off, and with them PITR and read replicas.

How do I get a snapshot into another Region or account?

copy-db-snapshot with --region set to the target and --source-region to the origin. An encrypted snapshot needs a KMS key in the target Region, passed with --kms-key-id. Sharing with another account needs a customer managed key that account may use; snapshots encrypted with the AWS managed aws/rds key cannot be shared. AWS Backup automates both.

In an interview Mid

Someone ran DELETE without a WHERE on a production RDS table. How do you recover?

Note the time first. Then restore-db-instance-to-point-in-time into a new instance at a second before the DELETE, with the production security group and parameter group so it is reachable and behaves the same. 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. Multi-AZ does not help, because the standby applied the DELETE too. Afterwards, fix why it was possible: who has write access to production, and reviewed scripts. The RPO here is close to zero; the RTO is the restore time.

Also asked: Why does Multi-AZ not protect you from a bad UPDATE? · How would you keep an RDS backup for longer than 35 days? · How do you find out how long a database restore really takes?

Practise this lesson in the terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.