Handling Cross-Region Routing
1. Configuring Geographic Routing
| Method | Detail |
|---|---|
| GeoIP DB | MaxMind, IP2Location |
| Cloud GeoDNS | Route 53 geo records |
| CDN edge headers | CF-IPCountry, X-Country-Code |
| Anycast | BGP-routed nearest POP |
2. Using Latency-Based Routing
| Provider | Mechanism |
|---|---|
| Route 53 latency | Per-AWS-region RTT table |
| Cloudflare Argo | Smart routing across backbone |
| Azure Traffic Manager | Performance profile |
| NS1 Pulsar | RUM-driven decisions |
3. Implementing Active-Active Architecture
| Concern | Strategy |
|---|---|
| Data replication | Multi-master DB or CRDT |
| Conflict resolution | LWW, vector clocks, app logic |
| Session affinity | Sticky or replicated session store |
| Cache coherence | Multi-region invalidation |
4. Setting Up Active-Passive Failover
| Setting | Value |
|---|---|
| RPO target | < 1 min |
| RTO target | < 5 min |
| Health check freq | 10-30s |
| Failover trigger | 3 consecutive failures |
| DNS TTL | 60s (fast failover) |
5. Configuring Multi-Region Load Balancing
Example: Route 53 weighted geo
{
"RecordSets": [
{"Name":"api.example.com","Type":"A","SetIdentifier":"us-east",
"Region":"us-east-1","Weight":50,"AliasTarget":{...}},
{"Name":"api.example.com","Type":"A","SetIdentifier":"eu-west",
"Region":"eu-west-1","Weight":50,"AliasTarget":{...}},
{"Name":"api.example.com","Type":"A","SetIdentifier":"ap-southeast",
"Region":"ap-southeast-1","Weight":0,"AliasTarget":{...}}
]
}
6. Using DNS-Based Routing
| Record Type | Use |
|---|---|
| A/AAAA weighted | Traffic split % |
| CNAME | Region alias |
| ALIAS (ANAME) | Apex domain → load balancer |
| SRV | Port + priority routing |
7. Implementing Data Residency Rules
| Region | Requirement |
|---|---|
| EU (GDPR) | Data stays in EEA unless SCCs |
| China | Local infra + CAC approval |
| Russia | Personal data on local servers |
| India (DPDP) | Critical data within India |
| Canada (PIPEDA) | Disclose cross-border transfers |
8. Setting Up Region Affinity
| Mechanism | Detail |
|---|---|
| Sticky cookie | region=us-east |
| JWT claim | region in token |
| User profile lookup | DB-stored home region |
| Tenant routing | Tenant ID → region map |
9. Configuring Cross-Region Health Checks
| Setting | Value |
|---|---|
| Check from | 3+ external regions |
| Endpoint | /health/region |
| Interval | 30s |
| Quorum | 2/3 must agree |
| Auto-failover | Update GeoDNS records |
10. Using Global Traffic Management
| Tool | Strength |
|---|---|
| AWS Global Accelerator | Static anycast IPs |
| Azure Front Door | L7 global LB + WAF |
| Google Cloud Load Balancing | Single anycast IP, premium tier |
| Cloudflare Load Balancing | Anycast, steering rules |