ရိုးရိုးလေး ရှင်းပြမယ်
အပိုတာယာ နဲ့ အိမ်အာမခံ
High availability (HA) က ကားထဲက အပိုတာယာ လိုပါပဲ — တာယာ တစ်လုံး ပေါက်ရင် ခရီးစဉ် တစ်ခုတည်းအတွင်းမှာပဲ မြန်မြန် ဆက်သွားနိုင်ပါတယ်။ Disaster recovery (DR) ကတော့ အိမ်အာမခံနဲ့ မီးလောင်သွားရင် ပြောင်းနေလို့ရတဲ့ ဆွေမျိုးအိမ်လိုပါ — အခြေအနေ တစ်ခုလုံး ပျက်စီးသွားတဲ့အခါ ပြန်စဖို့ပါ။
RTO (recovery time objective) က ပုံမှန်ပြန်နေနိုင်ဖို့ ဘယ်လောက်ကြာခွင့်ရှိလဲ ဆိုတာဖြစ်ပြီး RPO (recovery point objective) က data ဘယ်လောက် ဆုံးရှုံးခွင့်ရှိလဲ ဆိုတာပါ — နောက်ဆုံး backup က မနေ့က ဆိုရင် တစ်ရက်စာ ဆုံးရှုံးမှာပါ။ DR plan တိုင်းက ဒီ ကိန်းဂဏန်း နှစ်ခုကနေ စပါတယ်။
Problem → Why → Solution
Multi-AZ ရှိတော့ လုံခြုံပြီလို့ ထင်ခဲ့တယ်
Team တစ်ခုက RDS Multi-AZ၊ AZ သုံးခုကို ဖြန့်ထားတဲ့ ALB နဲ့ Auto Scaling group တွေ သုံးထားပြီး DR ပြီးပြီလို့ ယုံကြည်ပါတယ်။ တစ်ညမှာ မှားနေတဲ့ migration script တစ်ခုက orders table ထဲက row တွေ ထက်ဝက်ကို ဖျက်လိုက်ပါတယ်။ Multi-AZ က အဲဒီ delete ကို standby ဆီ ချက်ချင်း synchronous အနေနဲ့ ကူးပေးပါတယ် — သူ့အလုပ်ကို မှန်မှန်ကန်ကန် လုပ်ပေးတာပါ။
Automated snapshot တွေ ရှိပေမယ့် Region တူ၊ account တူ ထဲမှာပါ။ 2 TB database ကို ပထမဆုံး restore လုပ်တာ ၆ နာရီ ကြာပါတယ်၊ ဘာလို့လဲဆိုတော့ ဘယ်သူမှ မလေ့ကျင့်ဖူးလို့ runbook ထဲက IAM role က ဖျက်ပြီးသား ဖြစ်နေလို့ပါ။ Business ကတော့ အမြင့်ဆုံး ၁ နာရီပဲ ပိတ်ခွင့်ရှိတယ်လို့ ယူဆထားခဲ့ပါတယ် — ဒါပေမယ့် ဘယ်သူမှ အဲဒါကို ရေးမှတ်ထားတာ မရှိပါဘူး။
aws rds describe-db-instances --db-instance-identifier orders-db \
--query 'DBInstances[0].MultiAZ'
# true <- protects against an AZ failure, not against DELETE FROM orders
aws rds describe-db-snapshots --db-instance-identifier orders-db \
--query 'DBSnapshots[].AvailabilityZone'
# all in us-east-1, same account <- one compromised admin can delete them allHA က DR မဟုတ်ပါဘူး
HA က component တစ်ခု (instance၊ AZ) ပျက်တာကို အလိုအလျောက် ကာကွယ်ပေးပါတယ်။ Data corruption၊ မတော်တဆ ဖျက်မိတာ၊ account compromise ဖြစ်တာ ဒါမှမဟုတ် Region တစ်ခုလုံး ထိခိုက်တာကိုတော့ မကာကွယ်ပေးပါဘူး — replication က မှားနေတဲ့ ပြောင်းလဲမှုကိုပါ ကူးသွားလို့ပါ။ ပြီးတော့ စမ်းမကြည့်ရသေးတဲ့ backup ဆိုတာ မျှော်လင့်ချက် တစ်ခုပဲ ဖြစ်ပါတယ်။
RTO/RPO ကနေ strategy ဆီ
- RPO (recovery point objective)
- Disaster ဖြစ်တဲ့အခါ ဆုံးရှုံးခွင့်ရှိတဲ့ data ရဲ့ အများဆုံး ပမာဏကို အချိန်နဲ့ တိုင်းတာထားတာ — ဥပမာ RPO 15 မိနစ် ဆိုရင် နောက်ဆုံး ၁၅ မိနစ်စာထက် ပိုမဆုံးရှုံးရပါဘူး။
- RTO (recovery time objective)
- Disaster ဖြစ်ပြီးနောက် service ကို ပြန်အသုံးပြုနိုင်အောင် လုပ်ဖို့ ခွင့်ပြုထားတဲ့ အများဆုံး အချိန်။
RTO နဲ့ RPO ကို engineer တွေက မရွေးပါဘူး၊ business က ရွေးပါတယ် — 'တစ်နာရီ ပိတ်ရင် ဘယ်လောက် ဆုံးရှုံးမလဲ' ဆိုတဲ့ မေးခွန်းကနေ စပါတယ်။ Engineering ရဲ့ အလုပ်က ကိန်းဂဏန်းတစ်ခုစီရဲ့ ဈေးနှုန်းကို ပြဖို့ပါ၊ ဘာလို့လဲဆိုတော့ နှစ်ခုလုံး သုညနား ရောက်လေ ကုန်ကျစရိတ်က ပိုမြန်မြန် တက်လေ ဖြစ်လို့ပါ။ Workload အားလုံး ကိန်းဂဏန်း တူစရာ မလိုပါဘူး: payment service နဲ့ internal reporting tool က tier မတူပါဘူး။
AWS က DR strategy လေးမျိုးကို ဖော်ပြပါတယ်၊ ညာဘက်ကို ရွှေ့လေ ပိုမြန်ပြီး ပိုဈေးကြီးလေပါ။ Backup & restore မှာ DR Region ထဲမှာ backup တွေပဲ ရှိပြီး infrastructure ကို IaC နဲ့ disaster ဖြစ်မှ တည်ဆောက်ပါတယ်။ Pilot light မှာ data ကို live replicate လုပ်ထားပြီး database replica လို core အစိတ်အပိုင်းတွေ run နေပေမယ့် app server တွေကို ပိတ်ထား (သို့) သုည size နဲ့ ထားပါတယ်။
Warm standby မှာ scale down လုပ်ထားပေမယ့် အပြည့်အဝ အလုပ်လုပ်နိုင်တဲ့ copy တစ်ခု run နေပြီး failover ဖြစ်ရင် scale up ပဲ လုပ်ရပါတယ် — pilot light နဲ့ အဓိက ကွာခြားချက်က 'ပိတ်ထားတာ' နဲ့ 'သေးအောင် ထားတာ' ပါ။ Multi-site active/active မှာ Region နှစ်ခုလုံးက production traffic ကို တစ်ပြိုင်နက် ယူပါတယ်၊ RTO အနည်းဆုံးဖြစ်ပေမယ့် Region နှစ်ခုမှာ write လုပ်တဲ့အခါ data consistency နဲ့ conflict ကို ကိုင်တွယ်ရလို့ အရှုပ်ထွေးဆုံးပါ။
| Strategy | ပုံမှန် RTO / RPO | DR Region ထဲမှာ ဘာ run နေလဲ |
|---|---|---|
| Backup & restore | နာရီပိုင်း / နောက်ဆုံး backup | Backup တွေပဲ — cost အနည်းဆုံး |
| Pilot light | မိနစ် ဆယ်ချီ / မိနစ်ပိုင်း | Replicate ထားတဲ့ data + core service၊ app tier ပိတ်ထား |
| Warm standby | မိနစ်ပိုင်း / စက္ကန့်ပိုင်း | Scale down ထားတဲ့ stack အပြည့် |
| Multi-site active/active | သုညနီးပါး / သုညနီးပါး | Capacity အပြည့် — cost နဲ့ complexity အမြင့်ဆုံး |
RPO ကို data replication က ဆုံးဖြတ်ပါတယ်၊ service တစ်ခုစီမှာ ကိုယ်ပိုင် နည်းလမ်း ရှိပါတယ်: S3 Cross-Region Replication (S3 Replication Time Control နဲ့ဆိုရင် replication အချိန်ကို SLA နဲ့ အာမခံပေးပါတယ်)၊ DynamoDB global tables၊ Aurora Global Database (ပုံမှန်အားဖြင့် replication lag တစ်စက္ကန့်အောက်)၊ RDS cross-Region read replica၊ EFS replication နဲ့ EBS snapshot copy တို့ပါ။ ဒါပေမယ့် replication က backup ကို အစားမထိုးနိုင်ပါဘူး — မှားနေတဲ့ delete ကိုလည်း ကူးသွားလို့ point-in-time backup တွေ အမြဲ လိုပါတယ်။
WARM STANDBY WITH ROUTE 53 FAILOVER
-----------------------------------
[Route 53: api.example.com]
failover routing + health check
| :
PRIMARY | : SECONDARY (when
v v primary unhealthy)
us-east-1 (active) us-west-2 (warm standby)
+---------------------------+ +---------------------------+
| ALB -> ECS (6 tasks) | | ALB -> ECS (1 task) |
| Aurora primary cluster |--async->| Aurora secondary cluster |
| S3 bucket |--CRR--->| S3 bucket (replica) |
| AWS Backup: prod-vault |--copy-->| dr-vault (Vault Lock) |
+---------------------------+ +---------------------------+
failover = promote Aurora secondary + scale ECS from 1 to 6- Agree RTO/RPO per workload tier
- Pick the cheapest strategy that fits
- Replicate data AND keep backups
- Automate failover (DNS, scale-up)
- Test it on a schedule
နောက်ဆုံး အဆင့်ကို ကျော်လိုက်ရင် ကျန်တဲ့ အဆင့်လေးဆင့်က စာရွက်ပေါ်က plan တစ်ခုပဲ ဖြစ်ပါတယ်။ တကယ့် RTO ကို စမ်းကြည့်မှ သိရပါတယ်။
Cross-Region copy ပါတဲ့ AWS Backup plan
{
"BackupPlanName": "prod-daily",
"Rules": [
{
"RuleName": "daily-with-dr-copy",
"TargetBackupVaultName": "prod-vault",
"ScheduleExpression": "cron(0 5 ? * * *)",
"StartWindowMinutes": 60,
"CompletionWindowMinutes": 360,
"Lifecycle": { "DeleteAfterDays": 35 },
"CopyActions": [
{
"DestinationBackupVaultArn":
"arn:aws:backup:us-west-2:111122223333:backup-vault:dr-vault",
"Lifecycle": { "DeleteAfterDays": 35 }
}
]
}
]
}Rule တစ်ခုက ဘယ်အချိန် backup လုပ်မလဲ (UTC 05:00 နေ့စဉ်)၊ ဘယ် vault ထဲ သိမ်းမလဲ၊ ဘယ်လောက်ကြာ ထားမလဲ (ရက် ၃၅) ကို သတ်မှတ်ပါတယ်။ CopyActions က recovery point တစ်ခုစီကို အခြား Region (သို့) account ထဲက vault ဆီ ကူးပေးလို့ Region တစ်ခုလုံး ထိခိုက်ရင်တောင် backup ရှိနေပါတယ်။ Schedule က RPO ကို ဆုံးဖြတ်တယ်ဆိုတာ သတိရပါ — နေ့စဉ် backup ဆိုရင် RPO က ၂၄ နာရီအထိ ဖြစ်နိုင်ပါတယ်။
AWS Backup နဲ့ cross-Region DR backup တည်ဆောက်ခြင်း
ဒီ script က Region တစ်ခုစီမှာ vault တစ်ခုစီ ဖန်တီးမယ်၊ အပေါ်က plan ကို ထည့်မယ်၊ backup=daily tag ပါတဲ့ resource အားလုံးကို ရွေးမယ်၊ DR vault ကို Vault Lock နဲ့ ပိတ်မယ်၊ ပြီးရင် copy job တွေ တကယ် ရောက်နေလား စစ်ပါမယ်။ Tag နဲ့ ရွေးတာက အရေးကြီးပါတယ် — database အသစ် တစ်ခုကို tag ထည့်လိုက်ရုံနဲ့ DR plan ထဲ အလိုအလျောက် ပါသွားပါတယ်။
{
"SelectionName": "tagged-daily",
"IamRoleArn": "arn:aws:iam::111122223333:role/AWSBackupDefaultServiceRole",
"ListOfTags": [
{
"ConditionType": "STRINGEQUALS",
"ConditionKey": "backup",
"ConditionValue": "daily"
}
]
}# 1. One vault in the primary Region, one in the DR Region
aws backup create-backup-vault --backup-vault-name prod-vault --region us-east-1
aws backup create-backup-vault --backup-vault-name dr-vault --region us-west-2
# 2. The plan: daily backups, each copied to us-west-2
PLAN_ID=$(aws backup create-backup-plan \
--backup-plan file://backup-plan.json \
--region us-east-1 --query BackupPlanId --output text)
# 3. Assign resources by tag: anything tagged backup=daily
SELECTION_ID=$(aws backup create-backup-selection \
--backup-plan-id "$PLAN_ID" \
--backup-selection file://selection.json \
--region us-east-1 --query SelectionId --output text)
# 4. Lock the DR vault (compliance mode once the 3-day grace period ends)
aws backup put-backup-vault-lock-configuration \
--backup-vault-name dr-vault \
--min-retention-days 7 --max-retention-days 365 \
--changeable-for-days 3 \
--region us-west-2
# 5. Next day: are copies really landing in the DR Region?
aws backup list-copy-jobs --by-state COMPLETED --region us-east-1 \
--query 'CopyJobs[].[ResourceArn,DestinationBackupVaultArn]' --output tableCode ကို တစ်ပိုင်းချင်း ရှင်းပြမယ်
- A vault per Region
aws backup create-backup-vault --backup-vault-name dr-vault --region us-west-2Backup vault က recovery point တွေကို KMS key နဲ့ encrypt လုပ်ပြီး သိမ်းတဲ့ container ပါ။ Copy action ရဲ့ destination ဖြစ်ဖို့ DR Region ထဲမှာ vault ကြိုရှိနေရပါတယ်။
- Plan + selection
--backup-plan file://backup-plan.json ... --backup-selection file://selection.jsonPlan က 'ဘယ်အချိန်၊ ဘယ်လောက်ကြာ၊ ဘယ်ကို ကူးမလဲ' ဖြစ်ပြီး selection က 'ဘယ် resource တွေလဲ' ပါ။ IamRoleArn က AWS Backup က resource တွေကို backup လုပ်ဖို့ assume လုပ်တဲ့ role ပါ။
- Vault Lock in compliance mode
--min-retention-days 7 --max-retention-days 365 --changeable-for-days 3--changeable-for-days ပါရင် compliance mode ဖြစ်ပါတယ်: ရက် ၃ ရက် grace period ပြီးသွားရင် lock ကို ဘယ်သူမှ (root user ပါ) ဖယ်လို့ မရတော့ပြီး retention မပြည့်ခင် recovery point တွေကို ဖျက်လို့ မရတော့ပါဘူး။ မပါရင် governance mode ဖြစ်ပြီး ခွင့်ပြုချက်ရှိတဲ့ user က ဖယ်လို့ ရပါတယ်။ ဒါက ransomware နဲ့ compromised admin ကို ကာကွယ်ပေးပါတယ်။
- Verify the copies
aws backup list-copy-jobs --by-state COMPLETEDPlan ရှိတာနဲ့ copy တွေ ရောက်တာ မတူပါဘူး — KMS key permission မှားတာ၊ vault access policy မှားတာတွေကြောင့် copy job တွေ fail ဖြစ်နိုင်ပါတယ်။ COMPLETED job တွေကို စစ်ပြီး FAILED job တွေအတွက် alarm ထားပါ။
နမူနာ output (ARN တွေ ကိုယ့် account နဲ့ ကွာပါမယ်):
--------------------------------------------------------------------------
| ListCopyJobs |
+------------------------------------------------------------------------+
| arn:aws:rds:us-east-1:111122223333:db:orders-db |
| arn:aws:backup:us-west-2:111122223333:backup-vault:dr-vault |
+------------------------------------------------------------------------+- Route 53 checks /health every 30 s
- 3 consecutive failures = unhealthy
- DNS answers with the SECONDARY record
- Promote DR database, scale up DR app
Primary ကျန်းမာနေတယ်
Traffic stays in us-east-1
Primary မကျန်းမာဘူး
Clients move to us-west-2 as DNS TTLs expire
Route 53 health check နဲ့ failover routing
Route 53 health checker တွေက နေရာ အများအပြားကနေ endpoint ကို စစ်ပါတယ်။ Failover routing မှာ PRIMARY record ကို health check နဲ့ ချိတ်ပြီး မကျန်းမာရင် Route 53 က SECONDARY record နဲ့ ဖြေပါတယ်။ 30 စက္ကန့် interval၊ failure threshold 3 နဲ့ TTL 60 စက္ကန့်ဆိုရင် client အများစုက မိနစ်အနည်းငယ်အတွင်း ပြောင်းသွားပါတယ်။
အရေးကြီးတဲ့ design အချက်: health check နဲ့ DNS answer ပြောင်းတာက Route 53 ရဲ့ data plane မှာ ဖြစ်တာပါ။ Disaster အတွင်းမှာ record တွေကို API နဲ့ ပြင်ရမယ့် (control plane ကို မှီခိုတဲ့) plan မျိုး မရေးပါနဲ့ — ကြိုတင် configure လုပ်ထားတဲ့ failover က ပိုယုံကြည်ရပါတယ်။ ပိုထိန်းချုပ်ချင်ရင် Amazon Application Recovery Controller (ARC) ကို ကြည့်ပါ။
{
"Type": "HTTPS",
"FullyQualifiedDomainName": "api-use1.example.com",
"ResourcePath": "/health",
"Port": 443,
"RequestInterval": 30,
"FailureThreshold": 3
}{
"Comment": "Active-passive failover for api.example.com",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "CNAME",
"SetIdentifier": "primary-us-east-1",
"Failover": "PRIMARY",
"TTL": 60,
"HealthCheckId": "abcdef11-2222-3333-4444-555566667777",
"ResourceRecords": [{ "Value": "api-use1.example.com" }]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "CNAME",
"SetIdentifier": "secondary-us-west-2",
"Failover": "SECONDARY",
"TTL": 60,
"ResourceRecords": [{ "Value": "api-usw2.example.com" }]
}
}
]
}HC_ID=$(aws route53 create-health-check \
--caller-reference "api-primary-$(date +%s)" \
--health-check-config file://health-check.json \
--query HealthCheck.Id --output text)
echo "Put $HC_ID into failover-records.json, then:"
aws route53 change-resource-record-sets \
--hosted-zone-id Z0123456789ABCDEFGHIJ \
--change-batch file://failover-records.jsonCross-account copy နဲ့ vault access policy
Cross-Region copy က Region ထိခိုက်တာကို ကာကွယ်ပေးပေမယ့် account compromise ကို မကာကွယ်ပေးပါဘူး။ ဒါကြောင့် အရေးကြီးတဲ့ backup တွေကို သီးသန့် backup account ထဲကိုပါ ကူးပါ။ AWS Organizations ရဲ့ management account မှာ AWS Backup cross-account backup ကို ဖွင့်ပြီး destination vault မှာ organization ထဲက account တွေကို ကူးခွင့်ပေးတဲ့ access policy ထည့်ရပါတယ်။ Encrypted copy တွေအတွက် KMS key policy ကလည်း ခွင့်ပြုရပါမယ်။
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCopyFromMyOrganization",
"Effect": "Allow",
"Principal": { "AWS": "*" },
"Action": "backup:CopyIntoBackupVault",
"Resource": "*",
"Condition": {
"StringEquals": { "aws:PrincipalOrgID": "o-a1b2c3d4e5" }
}
}
]
}DR ကို ပုံမှန် စမ်းသပ်ခြင်း
DR test မှာ အမျိုးအစား နှစ်မျိုး ရှိပါတယ်: restore test (backup တစ်ခုကို ယူပြီး တကယ် restore လုပ်ကာ data မှန်လား စစ်တာ) နဲ့ failover test (traffic ကို DR Region ဆီ တကယ် ပြောင်းတာ) ပါ။ AWS Backup restore testing က restore test ကို schedule နဲ့ အလိုအလျောက် လုပ်ပေးနိုင်ပါတယ်။ AWS Fault Injection Service (FIS) က instance ရပ်တာ၊ network ပြတ်တာ၊ AZ power interruption လို scenario တွေကို ထိန်းချုပ်ထားတဲ့ experiment အဖြစ် run ပေးပြီး stop condition alarm ထားရင် အန္တရာယ်များလာတာနဲ့ အလိုအလျောက် ရပ်ပါတယ်။
aws fis list-experiment-templates \
--query 'experimentTemplates[].[id,description]' --output table
aws fis start-experiment --experiment-template-id EXT1a2b3c4d5e6f7a8
# Measure: when did the alarm fire, when did DNS switch, when were we healthy?
aws cloudwatch describe-alarm-history \
--alarm-name checkout-customer-impact --history-item-type StateUpdate \
--max-records 10Production မှာ
Production မှာ DR ကို ဘယ်လို စီမံကြလဲ
Team တွေက workload တွေကို tier အလိုက် ခွဲပါတယ်: payment လို tier 1 workload တွေက warm standby (သို့) active/active၊ internal tool တွေက backup & restore ပါ။ DR Region ကို ကြိုပြင်ထားရပါတယ် — service quota တွေကို primary Region နဲ့ ညီအောင် တိုးထားတာ၊ ECR replication နဲ့ container image တွေ ကူးထားတာ၊ Secrets Manager secret တွေကို replicate လုပ်ထားတာ၊ encrypted copy တွေအတွက် KMS multi-Region key သုံးတာ စသည်ပါ။ ဒါတွေ မရှိရင် backup ရှိပေမယ့် restore မလုပ်နိုင်ပါဘူး။
Infrastructure အားလုံးကို IaC နဲ့ ထားလို့ DR Region မှာ stack ကို command တစ်ခုနဲ့ deploy လုပ်နိုင်ပါတယ်။ Quarterly game day တွေမှာ failover ကို တကယ် လုပ်ပြီး တိုင်းတာရတဲ့ RTO/RPO ကို target နဲ့ နှိုင်းယှဉ်ပါတယ်၊ ကွာဟချက်တိုင်းက backlog item တစ်ခု ဖြစ်လာပါတယ်။ Failback (primary ဆီ ပြန်ပြောင်းတာ) ကိုလည်း စမ်းပါ — failover ထက် ပိုခက်လေ့ ရှိပြီး မေ့လေ့ ရှိပါတယ်။
Failover ကို ဘယ်သူ ဆုံးဖြတ်မလဲဆိုတာကိုလည်း ကြိုသတ်မှတ်ထားပါတယ်။ Database promote လို ပြန်ပြင်ရခက်တဲ့ အဆင့်တွေအတွက် များသောအားဖြင့် incident commander က ခလုတ်နှိပ်ပြီး ကျန်တဲ့ အဆင့်တွေကို automation က လုပ်ပါတယ် — DNS တစ်ခုတည်း ပြောင်းသွားပြီး database မပြောင်းရင် split-brain ဖြစ်နိုင်လို့ပါ။
အမှားများ
အဖြစ်များတဲ့ အမှားတွေ
Replication ကို backup လို့ ထင်ခြင်း
Multi-AZ၊ read replica၊ global table နဲ့ CRR က ပြောင်းလဲမှု တိုင်းကို ကူးပါတယ် — DROP TABLE နဲ့ ransomware encryption ကိုပါ။ အဲဒါတွေက availability အတွက်ပါ။ Point-in-time recovery နဲ့ retention ရှိတဲ့ backup တွေကို သီးခြား ထားရပါမယ်။
Backup တွေကို account တူ၊ Region တူ ထဲမှာပဲ ထားခြင်း
Admin credential ရသွားတဲ့ attacker က production နဲ့ backup နှစ်ခုလုံးကို ဖျက်နိုင်ပါတယ်။ Cross-account နဲ့ cross-Region copy လုပ်ပြီး Vault Lock နဲ့ ဖျက်လို့မရအောင် ပိတ်ထားပါ။
Restore ကို ဘယ်တော့မှ မစမ်းခြင်း
ပထမဆုံး restore ကို incident အတွင်းမှာ လုပ်ရင် DR Region မှာ share မလုပ်ထားတဲ့ KMS key၊ နိမ့်နေတဲ့ quota၊ ဖျက်ပြီးသား IAM role လို အံ့အားသင့်စရာတွေ ကြုံရပြီး RTO က target ထက် အဆများစွာ ကြာသွားပါတယ်။
ပျက်နေတဲ့ Region ကို failover က မှီခိုနေခြင်း
Failover script က primary Region ထဲက API၊ bastion host ဒါမှမဟုတ် CI/CD pipeline ကို လိုအပ်နေရင် disaster အတွင်း အလုပ်မလုပ်ပါဘူး။ Failover လုပ်တဲ့ tooling ကို DR Region ကနေ run လို့ရအောင် ထားပါ။
💰 Cost & Cleanup
AWS Backup က storage GB-month (warm နဲ့ cold storage ဈေး မတူ) နဲ့ resource အမျိုးအစား အချို့အတွက် restore ကို ကျသင့်ပါတယ်။ Cross-Region copy တိုင်းမှာ inter-Region data transfer ကျသင့်ပြီး DR Region မှာ storage ထပ်ကျပါတယ်။ Route 53 health check တွေက လစဉ် ကျသင့်ပြီး HTTPS နဲ့ string matching လို option တွေက ပိုဈေးကြီးပါတယ်။ FIS က experiment action-minute အလိုက် ကျသင့်ပါတယ်။ Warm standby နဲ့ active/active ရဲ့ အကြီးဆုံး cost ကတော့ DR Region မှာ အမြဲ run နေတဲ့ compute နဲ့ database ပါ။
သတိ: Vault Lock ကို compliance mode နဲ့ ထားပြီး grace period (ဒီ lab မှာ ၃ ရက်) ကျော်သွားရင် retention မပြည့်မချင်း recovery point တွေနဲ့ vault ကို ဖျက်လို့ မရတော့ပါဘူး။ Lab ပြီးတာနဲ့ lock ကို ချက်ချင်း ဖယ်ပါ။
စမ်းပြီးရင် ဖျက်ဖို့ command
# Within the grace period: remove the lock first
aws backup delete-backup-vault-lock-configuration \
--backup-vault-name dr-vault --region us-west-2
aws backup delete-backup-selection \
--backup-plan-id "$PLAN_ID" --selection-id "$SELECTION_ID" --region us-east-1
aws backup delete-backup-plan --backup-plan-id "$PLAN_ID" --region us-east-1
# A vault must be empty before it can be deleted
for V in prod-vault:us-east-1 dr-vault:us-west-2; do
NAME=${V%%:*}; REGION=${V##*:}
for ARN in $(aws backup list-recovery-points-by-backup-vault \
--backup-vault-name "$NAME" --region "$REGION" \
--query 'RecoveryPoints[].RecoveryPointArn' --output text); do
aws backup delete-recovery-point --backup-vault-name "$NAME" \
--recovery-point-arn "$ARN" --region "$REGION"
done
aws backup delete-backup-vault --backup-vault-name "$NAME" --region "$REGION"
done
# Remove the failover records first (same JSON with "Action": "DELETE")
aws route53 change-resource-record-sets \
--hosted-zone-id Z0123456789ABCDEFGHIJ \
--change-batch file://delete-failover-records.json
aws route53 delete-health-check --health-check-id "$HC_ID"Mini challenge
RPO တစ်နာရီ ရဖို့ backup plan
Orders database အတွက် business က Region အတွင်း RPO တစ်နာရီနဲ့ Region ပျက်ရင် RPO ၂၄ နာရီကို လက်ခံပါတယ်။ ဒါကို ဖြည့်ဆည်းတဲ့ backup-plan.json တစ်ခု ရေးပါ။
- Rule တစ်ခုက နာရီတိုင်း backup လုပ်ပြီး ရက် ၂ ရက် ထားရမယ်
- နောက် rule တစ်ခုက နေ့စဉ် UTC 03:00 မှာ backup လုပ်ပြီး ရက် ၃၀ ထားရမယ်
- နေ့စဉ် backup ကိုပဲ us-west-2 ရဲ့ dr-vault ဆီ ကူးပြီး ရက် ၃၀ ထားရမယ်
- Rule နှစ်ခုလုံး prod-vault ကို သုံးရမယ်
ရလဒ်: aws backup create-backup-plan --backup-plan file://backup-plan.json က BackupPlanId တစ်ခု ပြန်ပေးပြီး get-backup-plan မှာ rule နှစ်ခု မြင်ရပါမယ် — CopyActions က daily rule မှာပဲ ပါရပါမယ်။
အရိပ်အမြွက် ကြည့်ရန်
AWS Backup ရဲ့ cron က minute၊ hour၊ day-of-month၊ month၊ day-of-week၊ year ဆိုတဲ့ field ၆ ခု ပါပြီး day-of-month နဲ့ day-of-week ထဲက တစ်ခုက '?' ဖြစ်ရပါမယ်။ နာရီတိုင်းဆိုရင် cron(0 * ? * * *) ပါ။
အဖြေ ကြည့်ရန်
{
"BackupPlanName": "orders-rpo-1h",
"Rules": [
{
"RuleName": "hourly-local",
"TargetBackupVaultName": "prod-vault",
"ScheduleExpression": "cron(0 * ? * * *)",
"Lifecycle": { "DeleteAfterDays": 2 }
},
{
"RuleName": "daily-with-dr-copy",
"TargetBackupVaultName": "prod-vault",
"ScheduleExpression": "cron(0 3 ? * * *)",
"Lifecycle": { "DeleteAfterDays": 30 },
"CopyActions": [
{
"DestinationBackupVaultArn":
"arn:aws:backup:us-west-2:111122223333:backup-vault:dr-vault",
"Lifecycle": { "DeleteAfterDays": 30 }
}
]
}
]
}Quick Quiz 1 / 3
Quick Quiz 2 / 3
Quick Quiz 3 / 3
မှတ်ထားရမယ့် အချက်များ
- RTO = ပြန်ကောင်းဖို့ ကြာခွင့်ရှိတဲ့ အချိန်၊ RPO = ဆုံးရှုံးခွင့်ရှိတဲ့ data — business က သတ်မှတ်ပါတယ်
- Backup & restore → pilot light → warm standby → active/active: မြန်လေ ဈေးကြီးလေ
- HA နဲ့ replication က DR ကို အစားမထိုးပါ — cross-account၊ cross-Region backup နဲ့ Vault Lock လိုပါတယ်
- Route 53 health check + failover routing က data plane မှာ အလုပ်လုပ်လို့ disaster အတွင်း ယုံကြည်ရပါတယ်
- Restore နဲ့ failover ကို FIS နဲ့ game day တွေမှာ ပုံမှန် စမ်းပြီး တကယ့် RTO/RPO ကို တိုင်းပါ
Disaster Recovery of Workloads on AWS (whitepaper) — AWS Documentation
AWS Backup Developer Guide — AWS Documentation
Route 53 DNS failover — AWS Documentation