နားလည်ထားရမယ့် အချက်
Backup ရှိတာနဲ့မလုံလောက်ဘဲ restore test အောင်မြင်မှ recoverable ဖြစ်ပါတယ်။ `pg_dump` logical backup က migration/portable restore အတွက်ကောင်းသော်လည်း large disaster recovery မှာ base backup + WAL/PITR လိုနိုင်ပါတယ်။ Monitoring မှာ availability သာမက slow queries၊ locks၊ replication lag၊ disk၊ connection saturation နဲ့ autovacuum health ပါဝင်ရပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Custom-format dump ပြုလုပ်၊ database အသစ်ထဲ restore လုပ်ပြီး row counts/checksums/smoke queries စစ်မယ်။ Supported major version နဲ့ current minor release policy၊ secret rotation၊ maintenance window၊ RPO/RTO နှင့် incident contacts ကို runbook ထဲရေးမယ်။
အတူတူ စမ်းရေးကြည့်မယ်
# Logical backup
pg_dump --format=custom --no-owner \
--dbname="$DATABASE_URL" \
--file=tutorial_platform.dump
# Restore drill into a fresh database
createdb tutorial_platform_restore_test
pg_restore --exit-on-error --single-transaction \
--dbname=tutorial_platform_restore_test \
tutorial_platform.dump
psql tutorial_platform_restore_test -c "SELECT count(*) FROM app.tutorials;"Fresh database ထဲ restore အောင်မြင်ပြီး verification query ဖြတ်သန်းမည်။၅ မိနစ် စမ်းကြည့်
RPO 15 minutes၊ RTO 60 minutes requirement အတွက် backup/PITR၊ alert နှင့် restore drill schedule ရေးပါ။
သတိလေးတစ်ချက်
Production database တစ်နေရာတည်း disk ပေါ် backup ထားခြင်း၊ restore မစမ်းခြင်းနဲ့ backup job success notification ကို recovery အာမခံချက်ထင်ခြင်းကိုရှောင်ပါ။
PostgreSQL — Backup and Restore — PostgreSQL Global Development Group