Design a comprehensive database backup and disaster recovery plan with RPO/RTO targets, automated backups, and tested recovery procedures.
## ROLE You are a database reliability engineer who designs backup and disaster recovery systems that protect against data loss in any scenario — from accidental deletions to complete datacenter failures. ## OBJECTIVE Design a backup and disaster recovery plan for [APPLICATION]'s [DATABASE] with RPO (Recovery Point Objective) of [RPO] and RTO (Recovery Time Objective) of [RTO] protecting [DATA VALUE: e.g., $10M/day in transactions]. ## TASK ### Risk Assessment - Human error: accidental DELETE, DROP TABLE, misconfigured migration - Hardware failure: disk failure, server crash, memory corruption - Software bugs: application bugs that corrupt data, ORM errors - Security incidents: ransomware, SQL injection, unauthorized access - Natural disasters: power outage, network failure, datacenter destruction - Vendor failures: cloud provider outage, managed service disruption ### Backup Strategy - Full backups: complete database dump on schedule (weekly or daily) - Incremental backups: changes since last full backup (daily or hourly) - Continuous archiving: WAL (Write-Ahead Log) archiving for point-in-time recovery - Logical backups: pg_dump/mysqldump for portable, human-readable backups - Physical backups: file-system-level copies for fastest restore times - Snapshot backups: storage-level snapshots for near-instant backup creation ### Backup Infrastructure - Storage locations: local disk, remote object storage (S3/GCS), cross-region replication - 3-2-1 rule: 3 copies, 2 different media types, 1 offsite location - Encryption: backup encryption at rest and in transit (AES-256, envelope encryption) - Retention policy: daily backups kept 30 days, weekly 90 days, monthly 1 year, yearly 7 years - Storage cost optimization: lifecycle policies moving old backups to cold storage - Backup monitoring: automated verification that backups completed successfully ### Recovery Procedures - Point-in-time recovery (PITR): restore to any second within the WAL retention window - Table-level recovery: restore specific tables without full database recovery - Row-level recovery: recover individual deleted or corrupted rows - Cross-region failover: promote read replica in another region to primary - Full disaster recovery: restore from cold backups to new infrastructure ### Testing & Validation - Automated restore testing: weekly automated restore to staging environment - Backup integrity checks: checksum verification on every backup - Recovery time measurement: actual RTO under real-world conditions - Chaos engineering: simulated failures to test recovery procedures - Runbook drills: team practices recovery procedures quarterly ### Automation & Monitoring - Backup scheduling: cron jobs, managed service features, or dedicated backup tools - Failure alerting: immediate notification if any backup job fails - Dashboard: backup status, size trends, recovery test results, compliance status - Self-healing: automatic retry of failed backups with exponential backoff - Compliance reporting: audit trail of backup and restore operations ## OUTPUT FORMAT Disaster recovery plan with backup architecture, recovery procedures, testing schedule, and compliance documentation. ## CONSTRAINTS - RPO and RTO must be validated through actual testing, not just theoretical calculation - Backup procedures must not impact production database performance - Recovery procedures must be executable by on-call engineers without DBA expertise - Include cost analysis: backup storage, cross-region replication, testing infrastructure - Plan must comply with relevant regulations (GDPR right to erasure, HIPAA, SOC 2)
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[APPLICATION][DATABASE][RPO][RTO]