Disaster Recovery Planning
RPO, RTO and runbooks.
What Is Disaster Recovery?
Disaster Recovery (DR) is the set of policies, tools, and procedures designed to enable the recovery of vital technology infrastructure and systems after a natural or human-induced disaster.
In the context of databases, DR planning ensures that your data remains safe and your systems can be brought back online within acceptable time limits after events such as hardware failure, accidental data deletion, ransomware attacks, or datacenter outages.
Recovery Point Objective (RPO)
RPO defines the maximum acceptable amount of data loss measured in time. If your RPO is 1 hour, you must be able to recover data up to at least 1 hour before the disaster occurred.
A shorter RPO demands more frequent backups or continuous replication. You can query your backup history to verify you are meeting your RPO target.
-- Check the last backup time and calculate data loss window
SELECT
backup_id,
backup_type,
started_at,
finished_at,
EXTRACT(EPOCH FROM (NOW() - finished_at)) / 3600 AS hours_since_backup
FROM backup_log
WHERE status = 'SUCCESS'
ORDER BY finished_at DESC
LIMIT 5;All lessons in this course
- Logical vs Physical Backups
- Point-in-Time Recovery
- Testing Your Restores
- Disaster Recovery Planning