Skip to content
Visual explainer 2h to learn 3 steps

Redundancy, failover & multi-region

Eliminate single points of failure and design active-passive or active-active setups.

By Invicly Tech, , in System Design Deep Dive. About 11 minutes to read.

Topic 16 of 33

In short

Redundancy removes single points of failure by running spare copies of every critical component. Failover moves traffic to a healthy copy, either a standby (active-passive) or peers that already serve traffic (active-active).

Explained simply

Every machine, cable and data centre fails sooner or later. Redundancy means having a spare for each important part, so when one fails another takes over and users barely notice. A part with no spare, whose failure stops everything, is called a single point of failure.

Think of a car with a spare tyre. The spare is useless unless you also know how to change the tyre and the jack is in the boot. In systems, the spare is a second server or database, and changing the tyre is failover: moving traffic from the broken part to the healthy one.

There are two main styles. In active-passive, the spare waits quietly and only starts working when the main one fails. In active-active, every copy serves real traffic all the time, so losing one just means the others carry a bit more.

Cloud providers split each region into availability zones: separate data centres with their own power and network, a few kilometres apart. Spreading copies across zones survives a data-centre outage. Spreading across regions survives the loss of a whole city's worth of infrastructure, but costs more and makes keeping data in sync harder.

Press Play on a diagram to walk through it one step at a time.

LayersRedundancy at every tier
  1. 1
    DNS and global routing

    Health-checked records steer users between regions

  2. 2
    Load balancers

    Redundant pair across availability zones

  3. 3
    App servers

    Multiple instances in several zones

  4. 4
    Cache cluster

    Replicas with automatic promotion

  5. 5
    Database

    Primary plus standby replica in another zone

CompareActive-passive vs active-active
Active-passive
  • Standby idle until failover
  • Simple data consistency
  • Failover takes seconds to minutes
  • Pays for idle capacity
Active-active
  • All regions serve traffic
  • Instant failover, lower latency
  • Write conflicts across regions
  • More complex to operate
MapDisaster recovery strategies, cheapest to fastest
DR strategy
  • Backup and restore
    • Restore from backups
    • RTO hours, RPO up to the last backup
  • Pilot light
    • Data replicated, servers off
    • RTO tens of minutes
  • Warm standby
    • Small running copy
    • Scale up on failover, RTO minutes
  • Active-active
    • Full capacity in each region
    • RTO near zero, highest cost

In depth

Finding single points of failure

Walk one user request from start to finish and ask, at each hop, what happens if this one thing disappears. The obvious ones are a single database server or a single load balancer. The hidden ones cause more outages: one DNS provider, one NAT gateway that all outbound traffic uses, a config service every app reads at startup, a TLS certificate that expires, one shared Redis used by every service, the deploy pipeline, or the one engineer who knows how the system works.

Also look for shared fate: two redundant servers in the same rack, on the same power feed, or both depending on the same zone's storage are not really independent. True redundancy needs independent failure domains (racks, zones, regions) and no shared dependency below them.

  • Draw the request path and mark every component with only one copy
  • Check dependencies used at startup, not just per request
  • Two copies in one failure domain count as one

Spare capacity: N+1 and the zone math

Having a spare is not enough if the survivors cannot carry the load. If you run in three zones and lose one, the other two must carry everything, so each zone must handle half of peak traffic. That means in normal times each zone should run at no more than about two thirds of its capacity. With two zones, each must be able to carry all traffic alone, so normal use must stay under 50%.

This is called N+1 (enough for peak plus one failure) or N+2 (still safe while one unit is down for maintenance and another fails). Autoscaling helps but is not instant: new instances may take minutes to start, which is too slow for a sudden zone loss. Keep the static headroom, and make sure your cloud quota allows the extra instances you will need.

Active-passive failover in detail

In active-passive, a standby copy is kept ready. How ready decides the recovery time (RTO) and cost. A cold standby is restored from backups (hours). A warm standby runs a smaller copy with data replicated continuously (minutes). A hot standby is a full copy ready to take traffic (seconds).

Failover time is the sum of its steps: detecting the failure (health checks every few seconds, failing after several misses), deciding (automatic or a human), promoting the standby, and moving traffic. DNS-based failover adds the record's TTL on top, and some clients and resolvers cache longer than the TTL. A floating virtual IP or a load balancer switch moves traffic faster.

The data loss (RPO) depends on replication: synchronous replication can reach zero, asynchronous loses whatever was not shipped yet.

FlowWhere failover time goes
  1. 1
    Detect

    3 missed checks x 10 s = 30 s

  2. 2
    Decide

    Automatic: seconds; human: minutes

  3. 3
    Promote standby

    Database promotion: 10 to 30 s

  4. 4
    Move traffic

    DNS TTL 60 s or instant VIP switch

  5. 5
    Verify

    Health checks pass on new primary

Active-active across regions

In active-active, every region serves users all the time. Routing sends each user to a nearby healthy region using latency-based or geo DNS, or anycast (one IP address announced from many places). If a region fails, routing simply stops sending users there.

The hard part is data. Read-only or cacheable data is easy to copy everywhere. For writes there are three common patterns. Home region: each user's data lives in one region, and other regions forward that user's writes there. Multi-active with conflict rules: DynamoDB global tables accept writes in every region and reconcile concurrent updates with last writer wins. Globally consistent databases: Spanner and CockroachDB use consensus across regions, which gives strong consistency but adds cross-region latency to writes.

Capacity matters here too: if one of three regions fails, the other two must absorb its users.

CompareHandling writes in active-active
Home region per user
  • Each user's data has one owner region
  • No write conflicts
  • Writes from afar are slower
  • Failover moves the home
Multi-active, LWW
  • Write anywhere
  • Async replication between regions
  • Concurrent edits: last one wins
  • DynamoDB global tables
Global consensus
  • Strongly consistent everywhere
  • Write latency includes a quorum
  • No conflict code needed
  • Spanner, CockroachDB

Testing failover before you need it

Failover that has never been tested is a guess. Common surprises: the standby has an old config, the runbook points to a renamed dashboard, the promoted database lacks a needed index, DNS takes ten minutes instead of one, or the remaining capacity is too small.

Teams build confidence with regular drills. A game day is a planned exercise where you deliberately fail a component in a controlled way, with everyone watching. Chaos engineering automates this: Netflix's Chaos Monkey randomly terminates production instances so services must tolerate it. Start in staging, then move to production during working hours with a clear abort plan.

Measure each drill against your targets: how long until users recovered (RTO) and how much data was lost (RPO). Fix what broke, then repeat. Failing back to the original primary is a separate step and deserves its own test.

Learn it in 3 short steps

About 40m each. Track them with a timer in your plan.

  1. 1
    Find single points of failure~40m
  2. 2
    Design active-passive failover~40m
  3. 3
    Design active-active multi-region~40m

Key points

  • Spread instances across availability zones to survive data-center failures.
  • Every tier needs redundancy, including load balancers and databases.
  • Test failover regularly; untested failover usually fails.
  • RTO is how fast you recover; RPO is how much data you can lose.

Key terms

Tap a card to flip it. 0/5 known

Examples

Availability math for redundant parts

A single app server is available 99.9% of the time, so it is down 0.1% of the time. Step 1: put two independent servers behind a load balancer. The service fails only when both are down at once: 0.001 x 0.001 = 0.000001, so availability is 99.9999%. Step 2: but components in a chain multiply. If the load balancer (99.99%) and the database (99.95%) are each single, the whole path is 0.9999 x 0.999999 x 0.9995, about 99.94%. Step 3: the weakest single component dominates, so make the database redundant next. These numbers assume failures are independent, which shared dependencies can break.

Planning failover for a web app in two zones

Targets: RTO under 2 minutes, RPO zero for orders. Step 1: run app servers in zones A and B behind a managed load balancer that spans both zones; each zone can carry full peak load. Step 2: run PostgreSQL with a primary in zone A and a synchronous standby in zone B, so committed orders exist in both. Step 3: use a failover manager such as Patroni with etcd; it promotes the standby about 30 seconds after the primary stops renewing its leader lock. Step 4: apps connect through a stable endpoint that follows the leader. Step 5: rehearse monthly by stopping the primary on purpose and timing recovery.

Quick reference

  • Two independent 99.9% parts in parallel give about 99.9999%; in series they give about 99.8%
  • With 3 zones, keep each zone under about 66% at peak so 2 zones can carry everything
  • RTO = how long recovery takes; RPO = how much recent data you may lose
  • Failover time = detect + decide + promote + move traffic (+ DNS TTL)
  • Hidden SPOFs: DNS, NAT gateway, config service, certificates, shared cache, one person
  • DR ladder: backup-restore, pilot light, warm standby, active-active
  • Test failover and failback regularly with game days

Common mistakes

  • Redundant servers that all depend on one shared database or config service.
  • Running at 90% capacity so survivors overload after failover.
  • Never rehearsing a region failover.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1You run in three availability zones. What is the highest safe normal utilisation per zone if you must survive losing one zone?

Question 2

2Which is a single point of failure even though you run 10 app servers?

Question 3

3What mainly decides the RPO of a database failover?

Question 4

4DynamoDB global tables accept writes in every region. How are concurrent updates to the same item resolved?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    List every single point of failure in this setup: one DNS provider, one load balancer, three app servers in one zone, one PostgreSQL server, one Redis server.

  2. Exercise 2medium

    Peak traffic is 9,000 requests per second and each server handles 1,000. How many servers do you need in total across 3 zones to survive one zone failure at peak?

  3. Exercise 3hard

    Design active-active for a note-taking app in two regions (EU and US) with RTO under 1 minute. Explain routing, where writes go, and what happens to EU users if the EU region fails.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is a backup a form of redundancy?
It is redundancy for data, not for service. A backup lets you recover lost data, but restoring it takes time, so it does not keep the system running during a failure.
Do I need multi-region?
Most applications are fine in one region with multiple availability zones. Go multi-region when the business needs to survive a full regional outage, or when users on several continents need low latency.
What is the difference between high availability and disaster recovery?
High availability keeps the service running through common failures like a server or zone loss, usually automatically. Disaster recovery is the plan for rare, large events such as losing a region or data corruption.

Go deeper

ShareXLinkedInWhatsApp