Ecommet
Topic 62 of 75

Reliability Patterns: Availability and Resiliency

Patterns for staying up when whole servers, zones or regions fail: deployment stamps (cells), geodes, multi-zone and multi-region designs, plus a map of the resiliency patterns covered elsewhere in the course.

Advanced 4 min read 3 quiz questions

Jump to the quiz

In a nutshell

  • Spread across availability zones first: it handles the most common large failures at modest cost.
  • Deployment stamps (cells) run many independent copies of the whole stack, each serving a subset of users, limiting the blast radius.
  • Geodes run full copies in many regions, each able to serve any user, for global low latency and region-level resilience.
  • Within each copy, use the resiliency patterns: timeouts, retries, circuit breakers, bulkheads, health checks, throttling.

Zones and regions

Cloud providers group data centres into availability zones (separate power, cooling and networking, close enough for low-latency links) inside regions (far apart geographically). Running instances in at least two or three zones survives a data-centre failure with little extra complexity. Running in several regions survives a regional outage, but data replication over long distances brings latency and consistency trade-offs.

SetupSurvivesCost and complexity
Single zoneServer failuresLowest
Multi-zoneA data-centre outageModerate: synchronous replication is still practical
Multi-region, active-passiveA region outage, after failoverHigher: asynchronous replication, failover drills
Multi-region, active-activeA region outage with no failover pauseHighest: conflict handling, global routing

Deployment stamps (cells)

Instead of one giant deployment serving everyone, run many identical stamps, each a complete copy of the stack (app servers, databases, queues) serving a slice of customers. A routing layer maps each customer to their stamp. A bad deploy or a noisy tenant affects one stamp, not everyone; growth means adding stamps; and stamps can be placed in the regions their customers need.

Customers routed to independent stamps

Customers routed to independent stamps Customers → Cell router Cell router → Stamp 1: A–H Cell router → Stamp 2: I–P Cell router → Stamp 3: Q–Z CustomersCell routercustomer → stampStamp 1app + DB + queueStamp 2failingStamp 3app + DB + queueA–HI–PQ–Z
Each stamp is a full, isolated copy. A failure in stamp 2 affects only its customers.
Diagram as text
  • Customers → Cell router
  • Cell router → Stamp 1: A–H
  • Cell router → Stamp 2: I–P
  • Cell router → Stamp 3: Q–Z

Geodes

A geode deployment runs full copies of the service in many regions, each able to serve any user, with data replicated between them (usually through a globally distributed database). Users are routed to the nearest healthy region. The result is low latency everywhere and survival of a whole region going down, at the cost of a data layer that handles multi-region writes.

The resiliency toolkit

PatternProtects againstTopic
Timeouts, retries with backoffTransient failures, hung callsTimeouts, retries, backoff and jitter
Circuit breakerRepeatedly calling a broken dependencyCircuit breaker
BulkheadOne failure exhausting shared resourcesBulkhead
Health endpoint monitoringSending traffic to broken instancesHealth checks
Throttling, load levelingOverload from spikesThrottling and queue-based load leveling
Compensating transactionHalf-finished multi-step operationsCompensating transactions
Leader electionTwo coordinators at onceLeader election and consensus

Common mistakes

  • Running everything in one zone and calling it highly available.
  • Multi-region designs whose failover has never been tested.
  • One global deployment where a single bad config change reaches every customer at once.

Interview questions

Try answering out loud before you open each one.

How would you make this service survive a region outage?

Deploy to at least two regions. For active-passive, replicate data asynchronously to the standby region and fail over with DNS or global load balancing, accepting a small data-loss window (RPO) and failover time (RTO). For active-active, route users to the nearest region and use a data store that supports multi-region writes, handling conflicts. Within each region, run across zones. Practise failover regularly.

Check yourself

1. What is the cheapest step up from a single data centre?
Show the answer

Answer: Spreading across availability zones. Zones protect against data-centre failures with little complexity.

2. What do deployment stamps limit?
Show the answer

Answer: The blast radius of a failure. Each stamp serves only its slice of customers.

3. In a geode deployment, which region can serve a given user?
Show the answer

Answer: Any region, usually the nearest healthy one. Every region holds a full copy of the service.

Further reading

Your notes

Saved in this browser as you type.

Finished this topic?

Mark it read to track your progress, then carry on with the next one.

Next topic