Snapshot Restore versus pg_restore — RDS Disaster Recovery

Summary

I’ll just cut to the chase here and give detailed analysis immediately after.

Analysis

pg_restore

PGPASSWORD='${PGPASSWORD}' pg_dump -h "restore-test.xxxxxxxxxxxx.eu-central-1.rds.amazonaws.com" -p 54321 XXX XXX - format=c > xxx.sql
PGPASSWORD=’${PGPASSWORD}’ pg_restore -v -h “restore-test.xxxxxxxxxxxx.eu-central-1.rds.amazonaws.com” -p 5432 XXX -d POSTGRESQL -j 4 -O -C “xxx.sql”

Snapshot Restore

I took a snapshot of our PostgreSQL RDS Instance, which has our prey, XXX database;

Conclusion

Obviously, the first thing to do is, enabling Multi-AZ feature of your RDS Instances. Because in case of a failure in an availability zone, AWS will automatically change RDS Instance’s DNS to a different RDS Instance in a different availability zone. That way, your RDS Instances are fault tolerant.

From Vault 11, the Last Survivor 💫 I have a theoretical degree in Theoretical Physics 👨‍🎓