AWS Learning
Global Applications Architecture

Global Applications Architecture

Multi-Region patterns, DR strategies, CloudFront vs Global Accelerator

Tổng quan

Global Applications Architecture là kiến trúc thiết kế ứng dụng phục vụ users trên toàn cầu với:

  • Low Latency: Giảm độ trễ cho users ở mọi nơi
  • High Availability: Ứng dụng luôn sẵn sàng
  • Disaster Recovery: Khôi phục nhanh khi có sự cố
┌─────────────────────────────────────────────────────────────────┐
│                    GLOBAL ARCHITECTURE                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   🌐 Route 53 (Global DNS)                                      │
│        ↓                                                        │
│   ⚡ CloudFront / Global Accelerator (Edge Network)             │
│        ↓                                                        │
│   ┌─────────────┐    ┌─────────────┐    ┌─────────────┐         │
│   │  Region A   │←──→│  Region B   │←──→│  Region C   │         │
│   │  (Primary)  │    │ (Secondary) │    │  (Backup)   │         │
│   └─────────────┘    └─────────────┘    └─────────────┘         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

  1. AWS Services cho Global Architecture
  2. AWS Global Accelerator
  3. CloudFront vs Global Accelerator
  4. Disaster Recovery Patterns

1. AWS Services cho Global Architecture

1.1 Bảng tổng hợp Services

ServiceLayerChức năng chínhUse Case
Route 53DNSGlobal DNS routing, health checksDomain routing, failover
CloudFrontCDNCache content tại EdgeStatic/dynamic content delivery
Global AcceleratorNetworkTối ưu network pathLow-latency applications
S3 Cross-Region ReplicationStorageReplicate objectsData redundancy
DynamoDB Global TablesDatabaseMulti-Region NoSQLGlobal read/write
Aurora Global DatabaseDatabaseMulti-Region SQLCross-region failover
S3 Transfer AccelerationTransferTăng tốc upload/downloadLarge file transfers

1.2 Route 53 - Global DNS

┌─────────────────────────────────────────────────────────────┐
│                      ROUTE 53 ROUTING                       │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   User Request → Route 53                                   │
│                     ↓                                       │
│   ┌─────────────────────────────────────────────────────┐   │
│   │            Routing Policies                         │   │
│   ├─────────────────────────────────────────────────────┤   │
│   │ • Simple      → Single resource                     │   │
│   │ • Weighted    → % traffic distribution              │   │
│   │ • Latency     → Lowest latency region               │   │
│   │ • Failover    → Primary/Secondary                   │   │
│   │ • Geolocation → Based on user location              │   │
│   │ • Geoproximity → Based on geographic distance       │   │
│   │ • Multi-Value → Multiple healthy resources          │   │
│   └─────────────────────────────────────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Routing Policies cho Global Apps:

PolicyMô tảUse Case
LatencyRoute đến region có latency thấp nhấtPerformance optimization
GeolocationRoute theo vị trí địa lý userCompliance, localization
FailoverTự động chuyển khi primary downDisaster recovery
WeightedPhân chia traffic theo %Blue/green, canary

1.3 CloudFront - Global CDN

┌─────────────────────────────────────────────────────────────┐
│                     CLOUDFRONT CDN                          │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   Users Worldwide                                           │
│        ↓                                                    │
│   ┌─────────────────────────────────────────────────────┐   │
│   │     400+ Edge Locations (Points of Presence)        │   │
│   │                                                     │   │
│   │  🌐 Americas  │  🌐 Europe  │  🌐 Asia  │  🌐 Others │  │
│   └─────────────────────────────────────────────────────┘   │
│        ↓                                                    │
│   ┌─────────────────────────────────────────────────────┐   │
│   │              Regional Edge Caches                   │   │
│   └─────────────────────────────────────────────────────┘   │
│        ↓                                                    │
│   ┌─────────────────────────────────────────────────────┐   │
│   │     Origin (S3, ALB, EC2, Custom HTTP)              │   │
│   └─────────────────────────────────────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Các tính năng chính:

  • Edge Caching: Cache content gần users
  • Lambda@Edge: Run code tại Edge
  • Origin Shield: Reduce origin load
  • Real-time Logs: Monitor CDN performance

1.4 S3 Cross-Region Replication (CRR)

┌─────────────────────────────────────────────────────────────┐
│               S3 CROSS-REGION REPLICATION                   │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   ┌──────────────┐         ┌──────────────┐                 │
│   │  Source      │ ──────→ │ Destination  │                 │
│   │  Bucket      │   CRR   │   Bucket     │                 │
│   │  (us-east-1) │         │ (eu-west-1)  │                 │
│   └──────────────┘         └──────────────┘                 │
│                                                             │
│   Requirements:                                             │
│   • Versioning enabled on both buckets                      │
│   • IAM permissions for replication                         │
│   • Objects encrypted with same key type                    │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Use Cases:

  • Disaster Recovery
  • Compliance (data in multiple regions)
  • Reduce latency for global users
  • Cross-account replication

1.5 DynamoDB Global Tables

┌─────────────────────────────────────────────────────────────────┐
│             DYNAMODB GLOBAL TABLES                              │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│        ┌──────────────┐                                         │
│        │ Global Table     │                                     │
│        └──────┬───────┘                                         │
│                   │                                             │
│    ┌──────────┼──────────┬──────────┐                           │
│    ↓          ↓          ↓          ↓                           │
│ ┌──────┐  ┌──────┐  ┌──────┐  ┌──────┐                          │
│ │ US   │←→│ EU   │←→│ Asia │←→│ SA       │                      │
│ │Replica│  │Replica│  │Replica│  │Replica│                      │
│ └──────┘  └──────┘  └──────┘  └──────┘                          │
│                                                                 │
│   • Active-Active replication                                   │
│   • < 1 second replication latency                              │
│   • Read/Write to any replica                                   │
│   • Automatic conflict resolution (last writer wins)            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

1.6 Aurora Global Database

┌─────────────────────────────────────────────────────────────┐
│              AURORA GLOBAL DATABASE                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   ┌────────────────────────────────────────┐                │
│   │         PRIMARY REGION (us-east-1)     │                │
│   │  ┌──────────────────────────────────┐   │               │
│   │  │      Primary Cluster             │   │               │
│   │  │  (Read + Write)                  │   │               │
│   │  └──────────────────────────────────┘   │               │
│   └────────────────────────────────────────┘                │
│                    │                                        │
│                    │ Async Replication                      │
│                    │ (< 1 second lag)                       │
│                    ↓                                        │
│   ┌────────────────────────────────────────┐                │
│   │       SECONDARY REGION (eu-west-1)     │                │
│   │  ┌──────────────────────────────────┐   │               │
│   │  │     Secondary Cluster            │   │               │
│   │  │  (Read Only - can promote)       │   │               │
│   │  └──────────────────────────────────┘   │               │
│   └────────────────────────────────────────┘                │
│                                                             │
│   Failover: < 1 minute (RPO ~1 second)                      │
│                                                             │
└─────────────────────────────────────────────────────────────┘

2. AWS Global Accelerator

2.1 Tổng quan

AWS Global Accelerator là service tối ưu hóa network path từ users đến applications bằng cách sử dụng AWS Global Network.

┌─────────────────────────────────────────────────────────────┐
│                  GLOBAL ACCELERATOR                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   WITHOUT Global Accelerator:                               │
│   ┌─────────────────────────────────────────────────────┐   │
│   │  User → ISP1 → ISP2 → ISP3 → ... → AWS Region       │   │
│   │        (Multiple hops qua public internet)          │   │
│   └─────────────────────────────────────────────────────┘   │
│                                                             │
│   WITH Global Accelerator:                                  │
│   ┌─────────────────────────────────────────────────────┐   │
│   │  User → Edge Location → AWS Private Network → Region│   │
│   │       (Vào AWS network sớm nhất có thể)             │   │
│   └─────────────────────────────────────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

2.2 Kiến trúc chi tiết

┌─────────────────────────────────────────────────────────────────┐
│                GLOBAL ACCELERATOR ARCHITECTURE                  │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Users                                                         │
│     │                                                           │
│     ↓                                                           │
│   ┌───────────────────────────────────────────────────────┐     │
│   │         2 Static Anycast IP Addresses                 │     │
│   │         (Entry point to AWS network)                  │     │
│   └───────────────────────────────────────────────────────┘     │
│     │                                                           │
│     ↓                                                           │
│   ┌───────────────────────────────────────────────────────┐     │
│   │              Edge Locations (Global)                  │     │
│   │   User được route đến Edge Location gần nhất          │     │
│   └───────────────────────────────────────────────────────┘     │
│     │                                                           │
│     ↓  (AWS Private Global Network)                             │
│   ┌───────────────────────────────────────────────────────┐     │
│   │                     Listener                          │     │
│   │                  (Port + Protocol)                    │     │
│   └───────────────────────────────────────────────────────┘     │
│     │                                                           │
│     ↓                                                           │
│   ┌───────────────────────────────────────────────────────┐     │
│   │               Endpoint Groups                         │     │
│   │            (One per AWS Region)                       │     │
│   │                                                       │     │
│   │  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐   │    │
│   │  │  us-east-1  │   │  eu-west-1  │   │ ap-south-1  │   │    │
│   │  │  Weight: 50 │   │  Weight: 30 │   │  Weight: 20 │   │    │
│   │  └─────────────┘   └─────────────┘   └─────────────┘   │    │
│   └───────────────────────────────────────────────────────┘     │
│     │                                                           │
│     ↓                                                           │
│   ┌───────────────────────────────────────────────────────┐     │
│   │                  Endpoints                            │     │
│   │     ALB, NLB, EC2, Elastic IP                         │     │
│   └───────────────────────────────────────────────────────┘     │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

2.3 Thành phần chính

ComponentMô tả
AcceleratorEntry point với 2 static anycast IPs
ListenerProcess connections (TCP/UDP, port range)
Endpoint GroupNhóm endpoints trong 1 region
EndpointsALB, NLB, EC2, Elastic IP

2.4 Tính năng quan trọng

1. Static Anycast IP:

┌─────────────────────────────────────────────────────────────┐
│   2 Static IP addresses (không đổi khi scale/failover)      │
│                                                             │
│   • IP 1: 1.2.3.4  ─┐                                       │
│                     ├── Anycast → Nearest Edge Location     │
│   • IP 2: 5.6.7.8  ─┘                                       │
│                                                             │
│   → Có thể whitelist trong firewall                         │
│   → Không cần thay đổi DNS khi failover                     │
└─────────────────────────────────────────────────────────────┘

2. Health Checks & Failover:

┌─────────────────────────────────────────────────────────────┐
│                   AUTOMATIC FAILOVER                        │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   Normal Operation:                                         │
│   User → Edge → Region A (Primary, Healthy ✓)               │
│                                                             │
│   Failover (< 1 minute):                                    │
│   User → Edge → Region A (Unhealthy ✗)                      │
│              └→ Region B (Secondary, Healthy ✓)             │
│                                                             │
└─────────────────────────────────────────────────────────────┘

3. Traffic Dials:

  • Điều chỉnh % traffic đến mỗi endpoint group (0-100%)
  • Dùng cho Blue/Green deployment, gradual rollout

4. Client Affinity:

  • NONE: Requests distributed based on health, weight
  • SOURCE_IP: Sticky sessions based on client IP

2.5 Use Cases

Use CaseMô tả
GamingUDP traffic, low latency requirement
IoTMQTT over TCP, stable connections
Voice/VideoReal-time communication
Financial TradingUltra-low latency
Health AppsStatic IP for compliance

3. CloudFront vs Global Accelerator

3.1 So sánh tổng quan

┌─────────────────────────────────────────────────────────────────┐
│          CLOUDFRONT vs GLOBAL ACCELERATOR                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   CLOUDFRONT (Content Delivery):                                │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │  User → Edge (CACHE) → Origin                           │   │
│   │         ↑                                               │   │
│   │    Content cached                                       │   │
│   │    tại Edge Location                                    │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                 │
│   GLOBAL ACCELERATOR (Network Optimization):                    │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │  User → Edge (NO CACHE) → AWS Network → Origin          │   │
│   │         ↑                                               │   │
│   │    Chỉ là entry point                                   │   │
│   │    vào AWS private network                              │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

3.2 Bảng so sánh chi tiết

FeatureCloudFrontGlobal Accelerator
Mục đích chínhContent delivery & cachingNetwork path optimization
Caching✅ Yes (Edge caching)❌ No
ProtocolHTTP/HTTPS onlyTCP, UDP
Static IP❌ No (DNS-based)✅ Yes (2 Anycast IPs)
DDoS ProtectionAWS Shield StandardAWS Shield Standard
Origin TypesS3, ALB, EC2, Custom HTTPALB, NLB, EC2, EIP
Edge FunctionsLambda@Edge, CloudFront Functions❌ No
WebSocket✅ Yes✅ Yes
PricingData transfer + requestsFixed hourly + data transfer

3.3 Khi nào dùng cái nào?

┌─────────────────────────────────────────────────────────────────┐
│                    DECISION FLOWCHART                           │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Cần cache content?                                            │
│        │                                                        │
│   ┌────┴────┐                                                   │
│   ↓         ↓                                                   │
│  YES       NO                                                   │
│   │         │                                                   │
│   ↓         ↓                                                   │
│ CloudFront  Cần static IP?                                      │
│                  │                                              │
│             ┌────┴────┐                                         │
│             ↓         ↓                                         │
│            YES       NO                                         │
│             │         │                                         │
│             ↓         ↓                                         │
│     Global Accelerator   Dùng TCP/UDP (non-HTTP)?               │
│                               │                                 │
│                          ┌────┴────┐                            │
│                          ↓         ↓                            │
│                         YES       NO                            │
│                          │         │                            │
│                          ↓         ↓                            │
│               Global Accelerator  CloudFront                    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

3.4 Use Case Mapping

ScenarioRecommendWhy
Static websiteCloudFrontCache HTML, CSS, JS, images
API Gateway backendCloudFrontCache API responses
Gaming (UDP)Global AcceleratorUDP support, low latency
VoIP applicationGlobal AcceleratorUDP, stable connection
IoT with fixed IPGlobal AcceleratorStatic IP for whitelist
Streaming videoCloudFrontCache video segments
Dynamic web app (no cache)Global AcceleratorNetwork optimization
Global failoverGlobal AcceleratorHealth checks, instant failover

3.5 Kết hợp cả hai

┌─────────────────────────────────────────────────────────────────┐
│            SỬ DỤNG CẢ HAI CÙNG LÚC                              │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │                     Users                               │   │
│   └─────────────────────────────────────────────────────────┘   │
│                    │                   │                        │
│            Static Content      Dynamic/Real-time                │
│                    ↓                   ↓                        │
│   ┌───────────────────────┐   ┌───────────────────────┐         │
│   │      CloudFront       │   │  Global Accelerator   │         │
│   │   (Images, CSS, JS)   │   │   (WebSocket, API)    │         │
│   └───────────────────────┘   └───────────────────────┘         │
│                    │                   │                        │
│                    ↓                   ↓                        │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │              Application (ALB + EC2/ECS)                │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

4. Disaster Recovery Patterns

4.1 Các metrics quan trọng

MetricĐịnh nghĩaÝ nghĩa
RPO (Recovery Point Objective)Lượng data tối đa có thể mất"Bao nhiêu data backup bị mất?"
RTO (Recovery Time Objective)Thời gian downtime chấp nhận được"Bao lâu để recover?"
┌─────────────────────────────────────────────────────────────────┐
│                    RPO vs RTO                                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Timeline:                                                     │
│   ───────────────────────────────────────────────────────────── │
│   │ Last Backup │←── RPO ──→│ Disaster │←── RTO ──→│ Recovery  ││
│   │             │  (Data    │          │ (Downtime)|           ││
│   │             │   Loss)   │          │           |           ││
│   ───────────────────────────────────────────────────────────── │
│                                                                 │
│   Ví dụ: RPO = 1 hour, RTO = 4 hours                            │
│   → Mất tối đa 1 giờ data                                       │
│   → Downtime tối đa 4 giờ                                       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

4.2 Bốn DR Patterns

┌─────────────────────────────────────────────────────────────────┐
│              DR PATTERNS: COST vs RECOVERY TIME                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Cost ↑                                                        │
│        │                                                        │
│        │                              ┌─────────────────┐       │
│        │                              │  Active-Active  │       │
│        │                              │   (RTO: ~0)     │       │
│        │                              └─────────────────┘       │
│        │                    ┌─────────────────┐                 │
│        │                    │  Warm Standby   │                 │
│        │                    │   (RTO: Min)    │                 │
│        │                    └─────────────────┘                 │
│        │          ┌─────────────────┐                           │
│        │          │   Pilot Light   │                           │
│        │          │  (RTO: 10+ Min) │                           │
│        │          └─────────────────┘                           │
│        │ ┌─────────────────┐                                    │
│        │ │ Backup/Restore  │                                    │
│        │ │  (RTO: Hours)   │                                    │
│        │ └─────────────────┘                                    │
│        └────────────────────────────────────────→ Recovery Time │
│         Fast                                    Slow            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

4.3 Pattern 1: Backup & Restore

┌─────────────────────────────────────────────────────────────────┐
│               BACKUP & RESTORE                                  │
│         RPO: Hours | RTO: Hours | Cost: $                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   PRIMARY REGION                    DR REGION                   │
│   ┌──────────────────┐             ┌──────────────────┐         │
│   │                  │             │                  │         │
│   │  ┌────────────┐  │   Backup    │  (No running      │        │
│   │  │ Application │  │  ────────→ │   infrastructure) │        │
│   │  └────────────┘  │             │                   │        │
│   │                  │             │  ┌────────────┐   │        │
│   │  ┌────────────┐  │   S3 CRR    │  │ AMIs       │   │        │
│   │  │ Database   │  │  ────────→ │  │ Snapshots  │    │        │
│   │  └────────────┘  │             │  │ Backups    │   │        │
│   │                  │             │  └────────────┘   │        │
│   └──────────────────┘             └──────────────────┘         │
│                                                                 │
│   Disaster: Restore từ backups → Launch infrastructure          │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Characteristics:

  • ✅ Chi phí thấp nhất
  • ❌ Recovery time dài nhất
  • Use for: Non-critical workloads, dev/test environments

4.4 Pattern 2: Pilot Light

┌─────────────────────────────────────────────────────────────────┐
│                   PILOT LIGHT                                   │
│         RPO: Minutes | RTO: 10+ Minutes | Cost: $$              │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   PRIMARY REGION                    DR REGION                   │
│   ┌──────────────────┐             ┌──────────────────┐         │
│   │                  │             │                  │         │
│   │  ┌────────────┐  │             │  (App servers     │        │
│   │  │ App + Web  │  │             │   OFF/minimal)    │        │
│   │  │ Servers    │  │             │                   │        │
│   │  └────────────┘  │             │                   │        │
│   │                  │    Async    │  ┌────────────┐   │        │
│   │  ┌────────────┐  │   Replicate │  │ Database   │   │        │
│   │  │ Database   │  │  ────────→ │  │ (Running!) │    │        │
│   │  │ (Primary)  │  │             │  │ (Read only)│   │        │
│   │  └────────────┘  │             │  └────────────┘   │        │
│   │                  │             │                  │         │
│   └──────────────────┘             └──────────────────┘         │
│                                           ↓                     │
│   Disaster: Scale up app servers, promote DB                    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Characteristics:

  • Core infrastructure (DB) luôn chạy và sync
  • App servers chỉ start khi cần
  • Tên từ "pilot light" trong gas heater - ngọn lửa nhỏ luôn cháy

4.5 Pattern 3: Warm Standby

┌─────────────────────────────────────────────────────────────────┐
│                   WARM STANDBY                                  │
│         RPO: Seconds | RTO: Minutes | Cost: $$$                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   PRIMARY REGION                    DR REGION                   │
│   ┌──────────────────┐             ┌──────────────────┐         │
│   │                  │             │                  │         │
│   │  ┌────────────┐  │             │  ┌────────────┐   │        │
│   │  │ App + Web  │  │             │  │ App + Web  │   │        │
│   │  │ (100%)     │  │             │  │ (25%)      │   │        │
│   │  └────────────┘  │             │  │ (Running!) │   │        │
│   │                  │             │  └────────────┘   │        │
│   │                  │    Async    │                  │         │
│   │  ┌────────────┐  │   Replicate │  ┌────────────┐   │        │
│   │  │ Database   │  │  ────────→ │  │ Database   │    │        │
│   │  │ (Primary)  │  │             │  │ (Replica)  │   │        │
│   │  └────────────┘  │             │  └────────────┘   │        │
│   │                  │             │                  │         │
│   └──────────────────┘             └──────────────────┘         │
│                                           ↓                     │
│   Disaster: Scale up to 100%, promote DB, Route53 failover      │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Characteristics:

  • Scaled-down version chạy sẵn trong DR region
  • Có thể xử lý traffic ngay lập tức
  • Scale up khi failover

4.6 Pattern 4: Active-Active (Multi-Site)

┌─────────────────────────────────────────────────────────────────┐
│                   ACTIVE-ACTIVE                                 │
│         RPO: ~0 | RTO: ~0 | Cost: $$$$                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │                     Route 53                            │   │
│   │              (Latency/Weighted Routing)                 │   │
│   └─────────────────────────────────────────────────────────┘   │
│                    │                   │                        │
│                    ↓                   ↓                        │
│   ┌──────────────────┐             ┌──────────────────┐         │
│   │   REGION A       │             │   REGION B       │         │
│   │   (Active)       │             │   (Active)       │         │
│   │                  │             │                  │         │
│   │  ┌────────────┐  │             │  ┌────────────┐   │        │
│   │  │ App + Web  │  │             │  │ App + Web  │   │        │
│   │  │ (100%)     │  │             │  │ (100%)     │   │        │
│   │  └────────────┘  │             │  └────────────┘   │        │
│   │                  │             │                  │         │
│   │  ┌────────────┐  │  Bi-direct  │  ┌────────────┐   │        │
│   │  │ Database   │  │ ←────────→ │  │ Database   │    │        │
│   │  │ (Primary)  │  │  Replicate │  │ (Primary)  │    │        │
│   │  └────────────┘  │             │  └────────────┘   │        │
│   │                  │             │                  │         │
│   └──────────────────┘             └──────────────────┘         │
│                                                                 │
│   Cả 2 region đều serve traffic đồng thời                       │
│   Database: DynamoDB Global Tables / Aurora Global              │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Characteristics:

  • Cả 2 regions đều nhận traffic
  • Zero downtime
  • Chi phí cao nhất (gấp đôi)
  • Phức tạp về data consistency

4.7 So sánh các DR Patterns

PatternRPORTOCostComplexityUse Case
Backup & RestoreHours24+ hours$LowDev, non-critical
Pilot LightMinutes10-30 min$$MediumCore business apps
Warm StandbySeconds-MinsMinutes$$$Medium-HighBusiness critical
Active-Active~0~0$$$$HighMission critical

4.8 DR Implementation Checklist

┌─────────────────────────────────────────────────────────────────┐
│                 DR IMPLEMENTATION CHECKLIST                     │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Planning:                                                     │
│   □ Define RPO và RTO requirements                              │
│   □ Identify critical workloads                                 │
│   □ Choose DR pattern based on budget                           │
│   □ Select DR region                                            │
│                                                                 │
│   Infrastructure:                                               │
│   □ Setup data replication (RDS, S3, DynamoDB)                  │
│   □ Prepare AMIs in DR region                                   │
│   □ Configure Route 53 health checks                            │
│   □ Setup monitoring and alerting                               │
│                                                                 │
│   Testing:                                                      │
│   □ Document runbooks                                           │
│   □ Regular DR drills (quarterly)                               │
│   □ Test failover and failback                                  │
│   □ Validate RTO/RPO targets                                    │
│                                                                 │
│   Automation:                                                   │
│   □ Automate failover with Lambda                               │
│   □ Use CloudFormation/CDK for DR stack                         │
│   □ Implement chaos engineering                                 │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

5. Tổng kết

Service Selection Matrix

RequirementPrimary ServiceAlternative
Low latency content deliveryCloudFront-
Low latency non-HTTP trafficGlobal Accelerator-
Static IP requiredGlobal Accelerator-
Global DNS with health checksRoute 53-
Global NoSQL databaseDynamoDB Global Tables-
Global SQL databaseAurora Global Database-
Cross-region data replicationS3 CRRDynamoDB Streams
Fast file uploads globallyS3 Transfer Acceleration-
Edge computingLocal Zones, WavelengthOutposts

Architecture Patterns

┌─────────────────────────────────────────────────────────────────┐
│              COMPLETE GLOBAL ARCHITECTURE                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│                         Users                                   │
│                           │                                     │
│   ┌───────────────────────┴───────────────────────┐             │
│   ↓                                               ↓             │
│ Route 53                                    Route 53            │
│ (Latency/Geo Routing)                   (Health Check)          │
│   │                                               │             │
│   ↓                                               ↓             │
│ ┌─────────────┐     ┌─────────────┐     ┌─────────────────┐     │
│ │ CloudFront  │     │   Global    │     │ S3 Transfer      │    │
│ │   (CDN)     │     │ Accelerator │     │ Acceleration     │    │
│ └─────────────┘     └─────────────┘     └─────────────────┘     │
│   │                       │                        │            │
│   └───────────────────────┼───────────────────────┘             │
│                           ↓                                     │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │                Multi-Region Infrastructure              │   │
│   │                                                         │   │
│   │  Region A (Primary)        Region B (Secondary)         │   │
│   │  ┌─────────────────┐      ┌─────────────────┐            │  │
│   │  │ ALB + ECS/EC2   │      │ ALB + ECS/EC2   │            │  │
│   │  └─────────────────┘      └─────────────────┘            │  │
│   │           │                        │                     │  │
│   │  ┌─────────────────┐      ┌─────────────────┐            │  │
│   │  │ Aurora Primary  │←────→│ Aurora Secondary│            │  │
│   │  └─────────────────┘      └─────────────────┘            │  │
│   │                                                         │   │
│   │  ┌─────────────────────────────────────────────────┐     │  │
│   │  │         DynamoDB Global Tables                  │     │  │
│   │  │    (Active-Active across all regions)           │     │  │
│   │  └─────────────────────────────────────────────────┘     │  │
│   │                                                         │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Tài liệu tham khảo