Multi-AZ Deployments
What you'll learn: How to deploy databases across multiple availability zones to achieve infrastructure-level fault tolerance with automatic failover.
The Core Concept
Multi-AZ deployments distribute your database infrastructure across multiple isolated data centers (availability zones) within the same region. When you deploy your primary database in one AZ and maintain a synchronous standby replica in another AZ, you protect against entire data center failures—power outages, network disruptions, or natural disasters affecting a single location.
Think of it like having two identical restaurant kitchens in different buildings connected by a high-speed communication line. If one kitchen floods, the other instantly takes over service without customers noticing.
How It Works
In a Multi-AZ setup:
- Your primary database handles all read/write operations in AZ-A
- A synchronous replica runs in AZ-B, receiving every committed transaction
- Cloud providers maintain a single DNS endpoint that automatically redirects to the healthy instance
- When AZ-A fails, the system performs automatic failover to AZ-B (typically 60-120 seconds)
- No data loss occurs because replication is synchronous
This differs from primary-replica setups where you might use asynchronous replication across regions. Multi-AZ prioritizes zero RPO (no data loss) over geographic distribution, accepting slightly higher write latency due to synchronous commits.
When to Use Multi-AZ
Deploy Multi-AZ when:
- Production workloads require high availability
- Your RTO allows brief failover windows (1-2 minutes)
- You cannot tolerate data loss (RPO = 0)
- Infrastructure failures must be transparent to applications
Key Takeaway: Multi-AZ deployments provide infrastructure-level resilience by automatically failing over to a standby replica in a different availability zone, ensuring zero data loss and minimal downtime during data center failures.