← Back to Index

9. Reliability

High Availability (HA)

Availability measures the percentage of time a system is operational. Standard targets:

HA is achieved through redundancy — eliminating single points of failure by having backup components ready to take over.

# Active-Passive HA
Primary server handles traffic
Standby server mirrors primary (data replication)
If primary fails → health check timeout → failover to standby
Users experience brief interruption (seconds to minutes)

# Active-Active HA
Both servers handle traffic simultaneously
If one fails, the other continues at reduced capacity
Zero failover time, but requires careful conflict resolution

Fault Tolerance

A fault-tolerant system continues operating, possibly at reduced capacity, when components fail.

Techniques

# Circuit Breaker Pattern (Pseudocode)
if circuit.state == CLOSED:
    try: result = call_service(); circuit.record_success()
    except: circuit.record_failure()
elif circuit.state == OPEN:
    return fallback_response() # Don't even try
elif circuit.state == HALF_OPEN:
    result = call_service() # Probing request
    if success: circuit.reset() else: circuit.open_again()

Backup Strategies

TypeDescriptionRPO (Recovery Point Objective)RTO (Recovery Time Objective)
Full backupCopy of all dataTime of last backupLong (hours to days)
IncrementalChanges since last backupRecentShort (need all increments)
DifferentialChanges since last full backupBetween full and recentModerate

RPO: Maximum acceptable data loss (in time). RTO: Maximum acceptable downtime to restore.

Disaster Recovery (DR)

SLA, SLO, SLI

Exercise: A payment processing system must achieve 99.999% availability. Identify the top 5 single points of failure. For each, propose a redundancy strategy. Calculate the maximum allowed downtime per quarter and describe your monitoring/alerting approach.