Handling Cross-Region Routing

1. Configuring Geographic Routing

MethodDetail
GeoIP DBMaxMind, IP2Location
Cloud GeoDNSRoute 53 geo records
CDN edge headersCF-IPCountry, X-Country-Code
AnycastBGP-routed nearest POP

2. Using Latency-Based Routing

ProviderMechanism
Route 53 latencyPer-AWS-region RTT table
Cloudflare ArgoSmart routing across backbone
Azure Traffic ManagerPerformance profile
NS1 PulsarRUM-driven decisions

3. Implementing Active-Active Architecture

ConcernStrategy
Data replicationMulti-master DB or CRDT
Conflict resolutionLWW, vector clocks, app logic
Session affinitySticky or replicated session store
Cache coherenceMulti-region invalidation

4. Setting Up Active-Passive Failover

SettingValue
RPO target< 1 min
RTO target< 5 min
Health check freq10-30s
Failover trigger3 consecutive failures
DNS TTL60s (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 TypeUse
A/AAAA weightedTraffic split %
CNAMERegion alias
ALIAS (ANAME)Apex domain → load balancer
SRVPort + priority routing

7. Implementing Data Residency Rules

RegionRequirement
EU (GDPR)Data stays in EEA unless SCCs
ChinaLocal infra + CAC approval
RussiaPersonal data on local servers
India (DPDP)Critical data within India
Canada (PIPEDA)Disclose cross-border transfers

8. Setting Up Region Affinity

MechanismDetail
Sticky cookieregion=us-east
JWT claimregion in token
User profile lookupDB-stored home region
Tenant routingTenant ID → region map

9. Configuring Cross-Region Health Checks

SettingValue
Check from3+ external regions
Endpoint/health/region
Interval30s
Quorum2/3 must agree
Auto-failoverUpdate GeoDNS records

10. Using Global Traffic Management

ToolStrength
AWS Global AcceleratorStatic anycast IPs
Azure Front DoorL7 global LB + WAF
Google Cloud Load BalancingSingle anycast IP, premium tier
Cloudflare Load BalancingAnycast, steering rules