Skip to main content

DR & HA Strategy

Failover Components

ComponentFailover MethodRTO Target
Aurora GlobalGlobal Cluster Failover (managed)< 1 min
DocumentDB GlobalLambda 자동 Failover (dr-automation 모듈)< 5 min
ElastiCache GlobalGlobal Datastore Failover< 1 min
MSKIndependent clustersN/A (RPO: unbounded)
Route53Latency-based 자동 라우팅 전환< 60s (TTL)
CloudFrontOrigin failover 미설정 (수동 전환)Manual

DR Automation Module

terraform/modules/dr-automation/

DocumentDB Failover Lambda

  • Function: production-docdb-failover
  • Runtime: Python 3.12
  • Timeout: 300s
  • 권한: rds:FailoverGlobalCluster, rds:DescribeGlobalClusters, sns:Publish
# Lambda가 수행하는 작업:
# 1. Global Cluster 상태 확인
# 2. us-west-2 클러스터를 새 Primary로 승격
# 3. SNS 알림 발송

SNS Alerts

  • Topic: production-dr-alerts
  • 구독: email → ops@example.com

Configuration

module "dr_automation" {
enable_auto_failover = false # 수동 승인 필요 (초기)

docdb_global_cluster_id = "production-docdb-global"
docdb_target_cluster_id = "production-docdb-global-us-west-2"
elasticache_global_group_id = module.elasticache.global_replication_group_id
elasticache_target_region = "us-west-2"
notification_email = "ops@example.com"
}

Known Gaps

Deep Research Audit 결과 (2026-03-24)

Critical Issues

  1. us-west-2는 사실상 read-only — 완전한 active-active가 아님
  2. MSK cross-region replication 미설정 — unbounded RPO
  3. CloudFront origin failover group 미설정
  4. API 인증 없음 — Cognito 미들웨어 작업 중

Performance

  • 현재 RTO: ~15-20분 (목표 < 10분)
  • Circuit breaker 미구현
  • service_client.py의 Sequential HTTP 호출 (병렬화 필요)
  • OTel 샘플링 미설정 (전량 수집)

Security

  • 3 Critical, 7 High, 8 Medium 취약점 발견
  • Hardcoded DB password (<YOUR_PASSWORD>)
  • IDOR 취약점 가능성
  • Regex injection 위험

Improvement Roadmap

PriorityItemStatus
P0Cognito API 인증In Progress
P0DB 비밀번호 Secrets Manager 전환Planned
P1CloudFront origin failoverPlanned
P1MSK Replicator 설정Planned
P1Circuit breaker 구현Planned
P2OTel 샘플링 설정Planned
P2Origin Shield 활성화Planned