High availability architecture
Start with an outcome, not a replica count
High availability (HA) means a workload continues to deliver its required outcomes despite specified failures. Resilience includes absorbing faults, limiting harm and recovering correctly. A server responding to ping is not proof that a customer can place an order. Define a checkout success SLI, latency limit, accepted data-loss limit and a failure model first. Chapter 37 introduced service levels; Chapter 38 introduced partial failure. Here we design a fictional bookstore with two zones in one region. No real infrastructure is required.
Draw the dependency graph
A failure domain is a group of components that can fail together, such as a host, power system, zone, region or shared configuration. Separate replicas across domains and inspect dependencies, not only compute placement.
Customer -> regional router -> app A OR app BEach app -> shared writer -> durable order dataEach app -> identity verificationEach app -> optional recommendation serviceCheckout requires the router, at least one ready app, valid identity and a usable writer. Recommendations are optional. If both app instances rely on one zonal writer, losing its zone can disable checkout even though the other app is healthy. A synthetic fault tree for checkout failure is: router unavailable OR both apps unavailable OR identity unavailable OR writer unavailable. This is Boolean logic, not a probability estimate. Extend the writer branch with a failover-ready standby, writer fencing and connection recovery; a standby is not instantly usable merely because it exists. Examine shared DNS, certificates, quotas, secrets, deployment pipelines, data and network paths too. Correlated software bugs may cross every zone.
Stateless services and surviving capacity
Stateless application replicas do not rely on indispensable session data stored on one instance. Put durable business state in a suitable data service; validate session integrity and expiration. A replica can then serve another replica's requests. This does not make the state service redundant. A load balancer should send traffic only to ready targets, spread work across domains and drain connections before planned removal. Readiness means able to accept traffic; liveness means the process should remain running. Avoid restarting every instance just because a shared database is down. Deep checks can create load or correlated ejections; use bounded probes and thresholds, and measure real transactions separately.
Suppose each zone can sustain 120 requests/s within the latency objective. Peak demand is 180 requests/s. Normally 240 requests/s is sufficient; after losing a zone only 120 remains, a deficit of 60. To withstand either zone loss without scaling, each zone needs at least 180 requests/s. With a target utilization of 75%, provision 240 requests/s per zone (180 / 0.75). These are measured-equivalent fictional capacities, not CPU-based guarantees. Static stability means enough ready capacity exists before the fault; relying on new instances during failure introduces dependencies on quotas, initialization, images and control-plane operations. In a three-zone design with equal capacity, two surviving zones must cover peak demand. Test the bottleneck, not just application capacity.
Stop a local fault from becoming a cascade
If a recommendation call slows, it can occupy the same worker pool as checkout. The queue grows, callers time out, retries increase load and healthy dependencies become saturated. A bulkhead partitions resources: reserve separate worker pools, queues, connection limits and rate budgets for critical and optional work. Separate cells can isolate tenants or groups of requests. Check for shared downstream bottlenecks before assuming isolation. A circuit breaker stops repeated calls to an unhealthy dependency; bounded retry with jitter avoids multiplying traffic. Load shedding deliberately rejects work before overload destroys useful throughput. Graceful degradation preserves a safe subset of functionality: show a catalog without recommendations, but never report an order as paid if payment cannot be confirmed. Use 429 for applicable request limits and 503 for temporary service unavailability, with appropriate retry guidance and bounded clients. Instrument rejected requests as part of the relevant SLI rather than hiding them.
At 100 checkout and 80 optional requests/s with 120 requests/s total capacity, reserve checkout first: admit 100 checkout and 20 optional, shed 60 optional. At 150 checkout and 30 optional, admit 120 checkout and zero optional, shed 30 checkout and 30 optional. Priorities must be explicit, bounded and fair across tenants; protecting checkout is not a license to bypass authorization or integrity checks.
Compare specific managed deployment modes
| Service and mode | Protection described | Verify before choosing |
|---|---|---|
| AWS RDS Multi-AZ DB instance with one standby | Standby in another AZ supports failover; not a read-serving replica | Engine, instance vs Multi-AZ DB cluster, reconnect behavior |
| Azure SQL Database with zone redundancy enabled | Placement across zones in the primary region, with architecture dependent on tier | Region, tier, configuration and failover group needs |
| Google Cloud SQL for MySQL regional HA | Primary and standby in separate zones with synchronously replicated storage | Edition, region, standby health and restart/failover behavior |
See RDS single standby, Azure SQL reliability and Cloud SQL HA. These modes are not interchangeable, are not universal defaults and do not establish application uptime. RDS Multi-AZ DB clusters have a different topology with readable replicas. Azure zone support depends on deployment mode. A regional database's zone resilience does not establish region-loss recovery. Client reconnect, in-flight transaction ambiguity, data integrity and observed recovery must be handled. Replication also propagates some mistakes: an accidental deletion can affect every live copy. Keep independent, access-controlled backups with tested restores.
Check your design
Name three minimum single-fault cut sets in the original graph: router, writer and identity. The two-app branch needs both app failures if each really can serve the workload. Losing one app may still breach latency under peak load, so Boolean reachability is only a starting point. Add capacity and a ready writer in another zone; then list remaining regional or shared dependencies. Verify that every claimed surviving path can complete an authorized checkout and persist the correct result. Record the assumptions rather than declaring the architecture fully resilient.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
High availability architecture — knowledge check
Choose the best answer for each offline scenario.
Which dependency is a single point of failure in the two-app graph?
Peak is 180 requests/s; each of two zones can serve 120. What is the deficit after one zone fails?
Which action illustrates safe graceful degradation?
What is the purpose of a bulkhead?
What is true of an RDS Multi-AZ DB instance single standby?