1 line
19 KiB
Markdown
Raw Normal View History

2026-01-14 04:53:21 +00:00
# Multi-Region High Availability Workspace\n\nThis workspace demonstrates a production-ready global high availability deployment spanning three cloud providers across three geographic regions:\n\n- **US East (DigitalOcean NYC)**: Primary region - active serving, primary database\n- **EU Central (Hetzner Germany)**: Secondary region - active serving, read replicas\n- **Asia Pacific (AWS Singapore)**: Tertiary region - active serving, read replicas\n\n## Why Multi-Region High Availability?\n\n### Business Benefits\n\n- **99.99% Uptime**: Automatic failover across regions\n- **Low Latency**: Users served from geographically closest region\n- **Compliance**: Data residency in specific regions (GDPR for EU)\n- **Disaster Recovery**: Complete regional failure tolerance\n\n### Technical Benefits\n\n- **Load Distribution**: Traffic spread across 3 regions\n- **Cost Optimization**: Pay only for actual usage (~$311/month)\n- **Provider Diversity**: Reduces vendor lock-in risk\n- **Capacity Planning**: Scale independently per region\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│ Global Route53 DNS │\n│ Geographic Routing + Health Checks │\n└────────────────────┬────────────────────────────────────────────┘\n │\n ┌───────────┼───────────┐\n │ │ │\n ┌────▼─────┐ ┌──▼────────┐ ┌▼──────────┐\n │ US │ │ EU │ │ APAC │\n │ Primary │ │ Secondary │ │ Tertiary │\n └────┬─────┘ └──┬────────┘ └▼──────────┘\n │ │ │\n ┌────▼──────────▼───────────▼────┐\n │ Multi-Master Database │\n │ Replication (300s lag) │\n └────────────────────────────────┘\n │ │ │\n ┌────▼────┐ ┌──▼─────┐ ┌──▼────┐\n │DO Droplets Hetzner AWS\n │ 3 x nyc3 3 x nbg1 3 x sgp1\n │ │ │ │\n │ Load Balancer (per region)\n │ │ │ │\n └─────────┼─────────┼─────────┘\n │VPN Tunnels (IPSec)│\n └───────────────────┘\n```\n\n### Regional Components\n\n#### US East (DigitalOcean) - Primary\n\n```\nRegion: nyc3 (New York)\nCompute: 3x Droplets (s-2vcpu-4gb)\nLoad Balancer: Round-robin with health checks\nDatabase: PostgreSQL (3-node cluster, Multi-AZ)\nNetwork: VPC 10.0.0.0/16\nCost: ~$102/month\n```\n\n#### EU Central (Hetzner) - Secondary\n\n```\nRegion: nbg1 (Nuremberg, Germany)\nCompute: 3x CPX21 servers (4 vCPU, 8GB RAM)\nLoad Balancer: Hetzner Load Balancer\nDatabase: Read-only replica (lag: 300s)\nNetwork: vSwitch 10.1.0.0/16\nCost: ~$79/month (€72.70)\n```\n\n#### Asia Pacific (AWS) - Tertiary\n\n```\nRegion: ap-southeast-1 (Singapore)\nCompute: 3x EC2 t3.medium instances\nLoad Balancer: Application Load Balancer (ALB)\nDatabase: RDS read-only replica (lag: 300s)\nNetwork: VPC 10.2.0.0/16\nCost: ~$130/month\n```\n\n## Prerequisites\n\n### 1. Cloud Accounts & Credentials\n\n#### DigitalOcean\n```\n# Create API token\n# Dashboard → API → Tokens/Keys → Generate New Token\n# Scopes: read, write\n\nexport DIGITALOCEAN_TOKEN