Multi-region database deployments reduce latency for global users and provide geographic disaster recovery. Here are the main patterns and their tradeoffs.
Patterns Overview
Pattern | Write Latency | Consistency | Complexity
--------------------------|---------------|-------------|----------
Active-Passive (DR only) | Low | Strong | Low
Active-Active (all writes)| High | Eventual | Very High
Regional writes + sync | Low (local) | Strong | Medium
CRDT-based | Low | Eventual | HighActive-Passive with RDS
# Create cross-region read replica
aws rds create-db-instance-read-replica \
--db-instance-identifier mydb-eu-west \
--source-db-instance-identifier mydb-us-east \
--source-region us-east-1 \
--region eu-west-1 \
--db-instance-class db.r6g.large
# Promote to standalone for failover
aws rds promote-read-replica \
--db-instance-identifier mydb-eu-west \
--region eu-west-1Aurora Global Database
Aurora Global Database replicates with typically <1 second lag across regions using storage-level replication:
# Add secondary region to Aurora Global
aws rds create-global-cluster \
--global-cluster-identifier my-global-db \
--source-db-cluster-identifier arn:aws:rds:us-east-1:...:cluster:primary
aws rds create-db-cluster \
--db-cluster-identifier secondary-cluster \
--engine aurora-postgresql \
--global-cluster-identifier my-global-db \
--region eu-west-1Application-Level Read Routing
import boto3
# Route reads to nearest region
REGION_ENDPOINTS = {
'us-east-1': 'primary.cluster.us-east-1.rds.amazonaws.com',
'eu-west-1': 'secondary.cluster.eu-west-1.rds.amazonaws.com',
}
def get_read_endpoint(user_region: str) -> str:
return REGION_ENDPOINTS.get(user_region, REGION_ENDPOINTS['us-east-1'])
# All writes still go to primary region
WRITE_ENDPOINT = 'primary.cluster.us-east-1.rds.amazonaws.com'Conflict Resolution for Active-Active
True active-active (writes accepted in all regions) requires conflict resolution. Most applications are better served by routing writes to one region and reads to nearest:
- Last-write-wins: simple but data loss risk
- Application-level merging: complex but correct
- CockroachDB / YugabyteDB: distributed SQL with built-in conflict handling
Key Takeaways
- Active-passive with cross-region replicas covers most DR requirements with low complexity
- Aurora Global Database achieves <1s replication lag across regions for read scaling
- Route reads to nearest region, writes to primary — avoid true active-active unless truly necessary
- Test failover and promotion procedures regularly — at least quarterly
JusDB Can Help
Multi-region database architecture requires balancing latency, consistency, and cost. JusDB can design the right topology for your global application.