iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

10.2 High Availability

High Availability architecture removes single points of failure through redundancy at every tier. HA differs from DR: HA tolerates component failure inside one site; DR tolerates site / region loss.

10.2 High Availability Architecture

HA vs DR

PropertyHADR
ScopeWithin a site / regionAcross sites / regions
Failure toleratedComponentSite or region
Typical RTOSub-second to secondsMinutes to hours
Cost driverRedundant componentsReplicated capacity

Patterns at each tier

TierHA pattern
NetworkDual ISP + BGP; HSRP / VRRP gateways
Load balancerActive-active LB pair
Web / appN+1 or N+M; auto-scaling
DatabasePrimary + replicas; auto-failover
StorageRAID + cluster filesystems; replicated
PowerDual feeds; UPS; generator
CoolingN+1 CRAC units

Database HA - two patterns

PatternBehaviour
Primary / replicaOne writes, replicas read; replica promotes
Multi-primaryAll write; conflict resolution required
EngineHA tech
PostgreSQLPatroni + repmgr
MySQLInnoDB Cluster, Galera
MongoDBReplica set with priority + arbiter
OracleData Guard + RAC

Worked example - small bank web tier

TierHA configuration
LBTwo F5 in active-active
AppFour Spring Boot instances; scale to 8 on peak
DBPostgres primary + 2 replicas in same region
CacheRedis Sentinel cluster
DNSMulti-A record + TTL 60 sec
FailoverSub-second for app; ~30 sec for DB promotion

Observability for HA

Signal typeTools
Health checksLB + service mesh
Synthetic monitoringCheckly, Pingdom
Distributed tracingOpenTelemetry, Jaeger
SLO + error budgetGrafana SLO, Sloth
Saturation alertsPrometheus + Alertmanager

Common pitfalls

  • HA components on the same power circuit.
  • Replica with stale data during writes.
  • Load balancer is itself a single point of failure.
  • Failover never tested; the day it matters, it does not work.
Mentor’s tip: HA inside; DR across. Every tier needs redundancy and a tested failover. SLO + error budget makes the trade-off explicit. Untested failover is the default cause of long outages.

Discussion

Loading…