Skip to main content

High Availability Concepts

What is High Availability?​

High Availability (HA) is the ability of a system to remain operational and accessible even in the event of a failure of one or more of its components.

┌─────────────────────────────────────────────────────────────┐
│ HIGH AVAILABILITY │
├─────────────────────────────────────────────────────────────┤
│ │
│ Objective: The service remains accessible despite failures │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Server failure? → Another server takes over │ │
│ │ Zone failure (AZ)? → Another AZ takes over │ │
│ │ Region failure? → Another region (DR) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Measure: Percentage of availability (uptime) │
│ │
│ 99% = 3.65 days of downtime/year (not acceptable) │
│ 99.9% = 8.76 hours of downtime/year (standard) │
│ 99.99% = 52.6 minutes of downtime/year (high availability)│
│ 99.999% = 5.26 minutes of downtime/year (very high) │
│ │
└─────────────────────────────────────────────────────────────┘

SPOF - Single Point of Failure​

A SPOF is a component whose failure causes the entire system to stop.

┌─────────────────────────────────────────────────────────────┐
│ IDENTIFYING SPOFs │
├─────────────────────────────────────────────────────────────┤
│ │
│ ARCHITECTURE WITH SPOF │
│ ────────────────────── │
│ │
│ Users │
│ │ │
│ ▼ │
│ ┌─────────┐ │
│ │ Server │ ← SPOF! If this server fails, everything stops │
│ │ Web │ │
│ └────┬────┘ │
│ │ │
│ ▼ │
│ ┌─────────┐ │
│ │ DB │ ← SPOF! A single database │
│ │ │ │
│ └─────────┘ │
│ │
│ Identified SPOFs: │
│ ❌ 1 single web server │
│ ❌ 1 single database │
│ ❌ 1 single availability zone │
│ │
└─────────────────────────────────────────────────────────────┘

Eliminating SPOFs​

┌─────────────────────────────────────────────────────────────┐
│ ARCHITECTURE WITHOUT SPOF │
├─────────────────────────────────────────────────────────────┤
│ │
│ Users │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Load Balancer│ ← Managed by AWS (native high availability)│
│ └──────┬──────┘ │
│ │ │
│ ┌─────┼─────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──┐ ┌──┐ ┌──┐ │
│ │S1│ │S2│ │S3│ ← 3 servers in 3 different AZs │
│ └┬─┘ └┬─┘ └┬─┘ │
│ │ │ │ │
│ └─────┼─────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ RDS Multi-AZ│ ← Database with automatic standby │
│ │ Primary │ │
│ │ ↓ │ │
│ │ Standby │ │
│ └─────────────┘ │
│ │
│ Eliminated SPOFs: │
│ ✅ Multiple web servers │
│ ✅ Multi-AZ Database │
│ ✅ Distribution across multiple AZs │
│ │
└─────────────────────────────────────────────────────────────┘

Multi-AZ Architecture​

AWS Availability Zones​

┌─────────────────────────────────────────────────────────────┐
│ AVAILABILITY ZONES (AZ) │
├─────────────────────────────────────────────────────────────┤
│ │
│ AWS Region (e.g., us-east-1) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
│ │ │ AZ-a │ │ AZ-b │ │ AZ-c │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ Datacenter│ │ Datacenter│ │ Datacenter│ │ │
│ │ │ isolated │ │ isolated │ │ isolated │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │
│ │ │ │ │ │ │
│ │ └──────────────┼──────────────┘ │ │
│ │ │ │ │
│ │ High-speed network │ │
│ │ (low latency between AZs) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Characteristics: │
│ • Each AZ = 1+ physically separated datacenters │
│ • Independent power, network, cooling │
│ • Sufficient distance to avoid common disaster │
│ • Latency < 2ms between AZs in the same region │
│ │
└─────────────────────────────────────────────────────────────┘

Availability Calculation​

┌─────────────────────────────────────────────────────────────┐
│ AVAILABILITY CALCULATION │
├─────────────────────────────────────────────────────────────┤
│ │
│ Formula: Total_Availability = 1 - (1 - Component_Availability)^n │
│ │
│ Example: A server has 99% availability │
│ │
│ 1 server: │
│ Availability = 99% = 0.99 │
│ Downtime = 3.65 days/year │
│ │
│ 2 servers (in parallel): │
│ Availability = 1 - (1-0.99)² = 1 - 0.0001 = 99.99% │
│ Downtime = 52 minutes/year │
│ │
│ 3 servers (in parallel): │
│ Availability = 1 - (1-0.99)³ = 1 - 0.000001 = 99.9999% │
│ Downtime = 32 seconds/year │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Number of servers Availability Downtime │ │
│ │ ────────────────── ──────────── ───────── │ │
│ │ 1 99% 3.65 days │ │
│ │ 2 99.99% 52 minutes │ │
│ │ 3 99.9999% 32 seconds │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ⚠️ Note: This assumes independent failures! │
│ If servers are in the same AZ, an AZ failure affects them all → use Multi-AZ │
│ │
└─────────────────────────────────────────────────────────────┘

High Availability Patterns​

Pattern 1: Active-Passive​

┌─────────────────────────────────────────────────────────────┐
│ ACTIVE-PASSIVE (Standby) │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ ACTIVE │ │ PASSIVE │ │ │
│ │ │ (Primary) │───────►│ (Standby) │ │ │
│ │ │ │ sync │ │ │ │
│ │ │ Processes │ │ Waits │ │ │
│ │ │ traffic │ │ its turn │ │ │
│ │ └─────────────┘ └─────────────┘ │ │
│ │ │ │ │
│ │ │ If failure │ │
│ │ ▼ │ │
│ │ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ (down) │ │ ACTIVE │ │ │
│ │ │ │ │ (new) │ │ │
│ │ └─────────────┘ └─────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ Advantages: Disadvantages: │
│ ✅ Simple ❌ Underutilized resources │
│ ✅ Synchronized data ❌ Failover not instant │
│ ✅ Moderate cost │
│ │
│ Use cases: RDS Multi-AZ, databases │
│ │
└─────────────────────────────────────────────────────────────┘

Pattern 2: Active-Active​

┌─────────────────────────────────────────────────────────────┐
│ ACTIVE-ACTIVE │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌─────────────────┐ │ │
│ │ │ Load Balancer │ │ │
│ │ └────────┬────────┘ │ │
│ │ │ │ │
│ │ ┌───────────┼───────────┐ │ │
│ │ │ │ │ │ │
│ │ ▼ ▼ ▼ │ │
│ │ ┌────────┐ ┌────────┐ ┌────────┐ │ │
│ │ │ ACTIVE │ │ ACTIVE │ │ ACTIVE │ │ │
│ │ │ (1) │ │ (2) │ │ (3) │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ Processes │ │ Processes │ │ Processes │ │ │
│ │ │ traffic │ │ traffic │ │ traffic │ │ │
│ │ └────────┘ └────────┘ └────────┘ │ │
│ │ AZ-a AZ-b AZ-c │ │
│ │ │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ Advantages: Disadvantages: │
│ ✅ All resources used ❌ More complex │
│ ✅ Better performance ❌ Data sync difficult │
│ ✅ Transparent failover │
│ │
│ Use cases: Stateless web servers, APIs │
│ │
└─────────────────────────────────────────────────────────────┘

AWS High Availability Services​

ServiceNative HARequired Configuration
S3✅ 99.999999999%None
DynamoDB✅ Multi-AZ autoNone
ALB/NLB✅ Multi-AZSpecify 2+ subnets
RDS⚠️ OptionEnable Multi-AZ
EC2❌ NoDesign with ASG
Lambda✅ Multi-AZ autoNone
Aurora✅ Multi-AZEnable replicas

Exercise: Identify the SPOFs​

Scenario​

Analyze this architecture and identify the SPOFs:

┌─────────────────────────────────────────────────────────────┐
│ ARCHITECTURE TO ANALYZE │
├─────────────────────────────────────────────────────────────┤
│ │
│ Internet │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │ ALB │ │
│ └────┬─────┘ │
│ │ │
│ ┌──────────┴──────────┐ │
│ │ │ │
│ ▼ ▼ │
│ ┌────────┐ ┌────────┐ │
│ │ EC2 │ │ EC2 │ │
│ │ AZ-a │ │ AZ-a │ │
│ └────┬───┘ └────┬───┘ │
│ │ │ │
│ └──────────┬──────────┘ │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │ RDS │ │
│ │ Single │ │
│ │ AZ │ │
│ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
💡 Solution

Identified SPOFs:

  1. ❌ All EC2s in the same AZ (AZ-a)

    • If AZ-a fails, all servers are down
    • Solution: Distribute in AZ-a and AZ-b at minimum
  2. ❌ RDS Single-AZ

    • If the DB's AZ fails, possible data loss
    • Solution: Enable RDS Multi-AZ
  3. ✅ ALB is OK (Multi-AZ by default if 2+ subnets)

Corrected Architecture:

  • EC2 in AZ-a AND AZ-b
  • RDS with Multi-AZ enabled
  • ALB with subnets in 2+ AZs

Summary​

ConceptDescription
HASystem remains accessible despite failures
SPOFSingle component whose failure stops everything
Multi-AZDistribution across multiple zones
99.9%~8h downtime/year (standard)
Active-PassiveOne active, one on standby
Active-ActiveAll process traffic

Next section: Load Balancers