Skip to content
EgyKode
03 · AWS by handLab 19 / 59
Guided labawsDestructive

RDS PostgreSQL: Backups, Restore and Failover

Take a snapshot, destroy data on purpose, and restore it — then measure how long that actually took.

Time
55 min
Level
Intermediate
Objectives
4 objectives
Cost
Low cost

Where this fits in the platform

This lab adds

  • A database you have actually restored, not just backed up

Before you start

You will need

  • AWS CLI v2, configured
  • psql

You will be able to

  • Restore a database to a point in time, not just to a snapshot
  • Measure a real RTO instead of assuming one
  • Explain why a restore creates a new instance

CostLow cost

A `db.t3.micro` is free for 12 months on a new account and ~$13/month after. Snapshots are billed beyond the free allowance. Delete the instance the same day.

How to clean up

The scenario#

There is a backup. Nobody has ever restored it.

A backup that has not been restored is a hope, not a backup — and the only way to know your recovery time is to measure it with a stopwatch.

This lab destroys data on purpose. Use a database you created for it and nothing else.

Hands-on environment

Run it on AWS

This lab builds real cloud infrastructure, so it needs your own AWS account. Follow the cost and cleanup notes above — the resources are yours, and so is the bill.

Anything you tick here is your own record. EgyKode cannot see inside that terminal, so the success criteria stay self-assessed even when the environment checks your work for you.

A database with backups on

Step 1 of 6

Clean up#

Run this even if you did not finish.

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
aws rds delete-db-instance --db-instance-identifier <id> --skip-final-snapshot
aws rds delete-db-instance --db-instance-identifier <restored-id> --skip-final-snapshot
aws rds delete-db-snapshot --db-snapshot-identifier <snapshot-id>
aws rds describe-db-instances --query 'DBInstances[].DBInstanceIdentifier'   # must be empty
aws rds describe-db-snapshots --snapshot-type manual --query 'DBSnapshots[].DBSnapshotIdentifier'

Cost of this lab: Partly billable. A db.t3.micro is free for 12 months on a new account and ~$13/month after. Snapshots are billed beyond the free allowance. Delete the instance the same day.

Success criteria

0 of 4

The concept behind it

Ready to try it without help?Do the challenge

Phase complete · 03 AWS by hand

You can now: You can build a network, grant least privilege, serve a site through a CDN, and restore a database — without any automation.

Next phase

Lab 19 of 59 on the project path

04 · Infrastructure as CodeTerraform FundamentalsProvider, resource, variable, output, state — the five pieces, on infrastructure small enough to read in one screen.45 minBeginner

Previous: EC2 Operations: SSM, CloudWatch Logs & Metrics