Stage 4 · Provision
Designing for High Availability
Multi-Region Architecture
Active-active across regions, data replication, latency tradeoffs, and disaster recovery.
Why Multi-Region?
Single-region deployments are vulnerable to regional outages, natural disasters, and cloud provider failures. Multi-region architecture distributes your system across geographically distant regions to provide resilience and reduce latency for global users. However, it introduces significant complexity around data consistency and network partitions.
Deployment Models
| Model | Traffic | Complexity | RPO/RTO |
|---|---|---|---|
| Active-Passive | All to one region | Low | Minutes |
| Active-Active | Split across regions | High | Seconds |
| Follow-the-Sun | Moves with users | Medium | Minutes |
| Region-Scoped | Each region independent | Medium | None (independent) |
┌─────────────┐
│ Global LB │
│ (Route53) │
└──────┬──────┘
│
┌────────────┼────────────┐
│ │
┌────────▼────────┐ ┌────────▼────────┐
│ US-EAST-1 │ │ EU-WEST-1 │
│ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ App Tier │◄├──CRDT──┤ App Tier │ │
│ └──────┬──────┘ │ │ └──────┬──────┘ │
│ │ │ │ │ │
│ ┌──────▼──────┐ │ │ ┌──────▼──────┐ │
│ │ Database │ │ │ │ Database │ │
│ └─────────────┘ │ │ └─────────────┘ │
└─────────────────┘ └─────────────────┘Each region has its own full stack. Data replicates across regions using CRDTs or conflict-free merging. The global load balancer routes users to the nearest region.
Cross-Region Data Replication
Cross-region replication is the hardest part of multi-region design. The speed of light imposes a minimum latency of 30-100ms between regions. You must choose between synchronous replication (strong consistency, higher latency) and asynchronous replication (lower latency, potential data loss).
- Async replication — Data written locally, replicated asynchronously. Low latency, RPO > 0.
- Synchronous replication — Data written to all regions before acknowledging. Strong consistency, high latency.
- Semi-sync — Write to local + one remote. Balance between latency and durability.
- CRDT-based — Conflict-free data types that can merge without coordination. Best for active-active.
Recovery Point Objective (RPO) is how much data you can lose. Recovery Time Objective (RTO) is how long recovery takes. An RPO of zero requires synchronous replication. An RTO of seconds requires hot standbys.
Latency Tradeoffs
Every cross-region operation adds 30-100ms of network latency. Design your system to minimize cross-region calls in the hot path. Read from the local region, write asynchronously, and use regional data stores where possible.
interface RegionConfig {
region: string;
primary: boolean;
endpoints: string[];
replicationLagMs: number;
}
function routeRequest(userRegion: string): RegionConfig {
const region = getNearestRegion(userRegion);
// If nearest region is healthy, use it
if (isHealthy(region)) return region;
// Failover to another region
return regions.find(r => r.primary && isHealthy(r))!;
}Route requests to the nearest healthy region. When a region fails, failover to the next closest healthy region.
Routing Strategies
Global routing determines which region handles each request. The strategy affects latency, cost, and consistency. Common approaches include geo-DNS (Route53 latency-based), anycast (BGP), and application-level routing.
Disaster Recovery Runbooks
A multi-region architecture without a tested disaster recovery runbook is just expensive redundancy. Document the exact steps for regional failover, data recovery, and failback. Run quarterly DR drills.
Schedule quarterly DR drills. Simulate a region going down and execute your runbook end-to-end. Document what breaks and update the runbook. Netflix practices this with their Simian Army.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.