Skip to main contentSkip to user menuSkip to navigation

Reliability & Availability

Understand system reliability and availability: SLA levels, downtime calculations, and strategies for building fault-tolerant systems.

12 min readBeginner
Not Started
Loading...

What is Reliability and Availability?

Reliability is the probability that a system performs correctly during a specific period. Its focus is preventing failures from happening in the first place. Availability is the percentage of time a system is operational and accessible. Its focus is minimizing downtime when failures do occur.

These qualities are related but different. A system can be available but unreliable if it responds with incorrect data. It can also be reliable but not highly available if it often goes down but works correctly whenever it is running. System designers therefore have to prevent failures, contain the failures that still happen, and restore service quickly.

99%

3.65 days/year

Basic internal or non-critical service

99.9%

8.76 hours/year

Common production starting target

99.99%

52.6 minutes/year

Requires tested redundancy and fast recovery

99.999%

5.26 minutes/year

Demands exceptional isolation and operations

  1. 1

    MTBF

    Prevent predictable failures

    Use sound design, testing, capacity management, and maintenance to increase the time between incidents.

  2. 2

    Observe

    Detect the user impact

    Alert on service-level indicators such as successful requests and latency, not only on machine health.

  3. 3

    Isolate

    Contain the blast radius

    Apply timeouts, circuit breakers, bulkheads, and load shedding so one dependency cannot consume every shared resource.

  4. 4

    MTTR

    Restore and learn

    Fail over or roll back quickly, verify recovery, then remove the conditions that allowed the incident to recur.

Availability Levels and SLAs

An availability target defines how much downtime a service can tolerate. Each additional "nine" sharply reduces the downtime budget and usually increases cost and operational complexity.

AvailabilityApproximate downtimeService levelExample
99%3.7 days/yearBasic service levelInternal tools
99.9%8.8 hours/yearStandard web serviceE-commerce sites
99.99%52 minutes/yearHigh availabilityBanking systems
99.999%5.3 minutes/yearUltra-high availabilityCritical infrastructure

The original comparison used 99% as the basic target and 99.999% as the ultra-high target:

ComparisonBasicUltra-high
Availability99%99.999%
Downtime per year3.7 days0.005 days
Relative cost factor1x100x

Reliability Patterns

Reliability patterns help systems handle failures gracefully instead of allowing one fault to become a full outage.

PatternPurposeImplementation examplesCostComplexity
RedundancyRun multiple instances of critical components.Load balancers, database replicas, multi-AZ deploymentHighMedium
Circuit breakerPrevent cascading failures.Fail fast when a dependency is unavailable; Netflix HystrixLowLow
BulkheadIsolate resources to prevent total failure.Separate thread pools or connection pools per serviceMediumMedium
Timeout and retryHandle transient failures gracefully.Exponential backoff, jitter, maximum retry limitsLowLow

MTBF, MTTR, and Availability

MTBF: Mean Time Between Failures

MTBF is the average time between system failures. Improving it means preventing failures through:

  • Better testing and quality assurance
  • Redundant components and systems
  • Regular maintenance and updates

MTTR: Mean Time to Recovery

MTTR is the average time needed to restore service after a failure. Reducing it means recovering faster through:

  • Automated monitoring and alerting

  • Quick rollback mechanisms

  • Clear incident-response procedures

  • Formula: Availability = MTBF / (MTBF + MTTR)

The practical strategy is to increase MTBF and decrease MTTR.

Reducing MTTR

StrategyImpactTools and techniquesRelative priority
Monitoring and alertingDetect issues in less than 1 minutePrometheus, Grafana, PagerDuty95%
Automated rollbackRestore service in less than 5 minutesBlue-green deployment, feature flags85%
RunbooksStandardize response proceduresDocumentation, automated scripts70%
Post-mortem processLearn from and prevent future issuesIncident analysis, action items45%

Real-world Examples

Netflix: 99.99% Availability

  • Strategy: Chaos engineering, microservices, and multi-region deployment. The architecture can lose an entire AWS region without service impact, and production components are intentionally broken to test resilience.

Google: 99.99% SLA

  • Strategy: Global load balancing, automatic failover, and Site Reliability Engineering practices. SRE teams focus on automation and reducing toil, while error budgets balance reliability against feature velocity.

AWS: 99.99% SLA

  • Strategy: Multi-AZ deployment, auto-scaling, and health checks. Each service has specific SLA commitments, and Availability Zones are isolated from one another to prevent cascading failures.

Common Failure Modes

Failure modeTypical examplesMitigation
Hardware failuresDisk crashes, network outages, power failuresRedundancy and quick replacement
Software bugsMemory leaks, infinite loops, null pointer exceptionsTesting, monitoring, and quick rollback
Human errorsMisconfigurations, accidental deletions, deployment mistakesAutomation, safeguards, and training
Cascading failuresOne component failure triggers othersCircuit breakers, bulkheads, and graceful degradation
Load spikesTraffic exceeds capacityAuto-scaling, load balancing, and rate limiting
Dependency failuresAn external service becomes unavailableTimeouts, retries, fallbacks, and caching

Building Reliable Systems Checklist

Design Phase

  • Identify single points of failure.
  • Plan for redundancy at each layer.
  • Design for graceful degradation.
  • Define SLA requirements early.
  • Plan the monitoring and alerting strategy.

Implementation Phase

  • Implement circuit breakers.
  • Add comprehensive logging.
  • Set up health checks.
  • Create deployment automation.
  • Test failure scenarios.

Turn an availability target into an operating budget

An SLA percentage becomes useful only after it is converted into time. The allowed downtime in an evaluation window is:

  • downtime budget = window duration × (1 - availability target)
  • projected downtime = incident count × average recovery time

Use the lab to compare the promise with an incident plan. Notice how another nine can make an otherwise reasonable recovery time consume the entire budget.

Availability budget lab

Turn a target into an incident budget

Set the promise, then test whether incident frequency and recovery speed fit inside it.

Availability target
Evaluation window
Revenue while unavailable
Within the target

99.907%

Projected availability for this window

Budget remaining

3.2 min

Error budget consumed93%
0 minutes used43 min allowed

43 min

Allowed downtime

40 min

Projected downtime

$6,667

Revenue exposure

The operational lever: At 2 incidents, recovery must stay below 22 min per incident to hold this target.

Match redundancy to the failure boundary

Redundancy helps only when the healthy copy sits outside the boundary that failed. Two instances in one zone can survive a process crash, but not a zone outage. Two zones in one region can survive a zone outage, but not a region outage. A shared slow dependency can still affect every copy unless timeouts, circuit breakers, and fallbacks contain it.

Inject failures below and change the deployment shape. The outcomes are illustrative; the important question is whether traffic retains a tested healthy path.

Failure boundary lab

Place redundancy where failure can happen

Inject a fault, choose a deployment boundary, and see whether traffic has somewhere healthy to go.

1. Inject a failure

Power or networking removes one availability zone.

2. Choose the redundancy boundary

3. Add recovery controls

Survival map

Can traffic cross the failed boundary?

Failover path survives
Primary regionActive

Zone A

Failed

Zone B

Standby

Secondary region

Not provisioned

Shared provider

Healthy

Traffic retains a usable path

A healthy copy exists outside the failed boundary, and automated routing moves traffic to it.

5%

Users affected

4 min

Time to stabilize

Replica remains available

Data posture

2.15x

Illustrative cost

Outcomes are an illustrative teaching model. Real impact depends on capacity headroom, replication lag, health-check thresholds, and tested recovery procedures.

Learn from representative incidents

These scenarios show how detection, isolation, redundancy, and recovery choices affect business outcomes.

Database Primary Failure

The main database goes down and automatically fails over to a replica.

MetricResult
Detection time30 seconds
Failover time2 minutes
Total downtime2.5 minutes
Affected users100%
  • Outcome: Service is restored quickly with minimal data loss, maintaining 99.995% monthly availability.

  • Lessons: Automated failover is crucial for database reliability; read replicas can serve traffic during primary failures; sub-minute monitoring prevents longer outages; and regular failover tests verify behavior under pressure.

Cascading Service Failure

An overloaded authentication service causes downstream failures.

MetricResult
Initial serviceAuthentication, overloaded
Cascade time5 minutes
Services affected12 of 15
Recovery time45 minutes
  • Outcome: A major outage caused by missing circuit breakers loses $500K in revenue and damages customer trust.

  • Lessons: Circuit breakers prevent cascades; bulkheads isolate critical services; rate limiting protects upstream services; and service dependencies should be mapped and monitored.

Regional Datacenter Outage

An entire AWS region goes down, but a multi-region setup keeps the service running.

MetricResult
Primary regionus-east-1, down
Failover targetus-west-2, active
Traffic switch8 minutes
Service impact5% slower
  • Outcome: Multi-region architecture limits user impact and maintains 99.99% availability.

  • Lessons: Multi-region deployment protects against regional failures; DNS failover enables automatic switching; cross-region data replication is essential; and the higher cost is justified only by critical availability requirements.

Memory Leak in Production

Gradual memory consumption causes rolling server crashes.

MetricResult
Time to detection3 hours
Servers affected8 of 20
User impact40% degraded
Resolution time15 minutes
  • Outcome: A quick rollback prevents a complete outage, and memory-monitoring alerts are improved.

  • Lessons: Monitor memory with automatic alerts; use canary deployments to catch issues before full rollout; make rollback fast; and set resource limits so one process cannot crash a server.

DDoS Attack During Peak Hours

A massive botnet targets API endpoints during Black Friday.

MetricResult
Attack volume100 Gbps
Mitigation time4 minutes
Legitimate traffic preserved95%
Revenue impactMinimal
  • Outcome: CDN protection and rate limiting absorb the attack, allowing the business to continue normally.

  • Lessons: A CDN provides the first line of defense; rate limiting by IP and API key prevents abuse; geo-blocking can reduce the attack surface; and a DDoS mitigation service should be ready.

Configuration Typo in Production

A database connection-string typo causes all new connections to fail.

MetricResult
Error introduced14:32 UTC
Detection90 seconds
Rollback3 minutes
Total impact4.5 minutes
  • Outcome: Health-check failures trigger an automated rollback and limit customer impact.

  • Lessons: Validate configuration before deployment; use automated health checks; stage rollouts to limit blast radius; and keep configuration as code for quick rollback.

Third-party Payment Provider Outage

Stripe becomes unavailable during checkout processing.

MetricResult
Provider downtime47 minutes
Failover to PayPal5 minutes
Lost transactionsApproximately 200
Recovery rate85%
  • Outcome: A secondary provider prevents total checkout failure and lets most customers complete their purchases.

  • Lessons: Multiple providers improve resilience; graceful degradation preserves partial functionality; failed transactions can be queued for retry; and clear communication reduces frustration.

Kubernetes Node Failure

A worker node suffers a hardware failure during a traffic spike.

MetricResult
Pod redistribution45 seconds
Service disruptionNone
Auto-scaling response2 minutes
Capacity restored100%
  • Outcome: Kubernetes redistributes pods automatically with no customer impact.

  • Lessons: Container orchestration provides automatic recovery; resource reservations leave capacity for redistribution; node auto-scaling handles capacity changes; and health checks trigger pod restarts.

Cache Stampede After Restart

A Redis restart causes every client to hit the database simultaneously.

MetricResult
Cache miss rate100%
Database load50x normal
Response time8 seconds
Recovery12 minutes
  • Outcome: The database connection pool is exhausted, causing a partial outage until the cache warms.

  • Lessons: Warm caches deliberately; use jittered TTLs to avoid simultaneous expiration; protect the database with circuit breakers; and preload critical data when appropriate.

No quiz questions available
Could not load questions file
Spotted an issue or have a better explanation? This page is open source.Edit on GitHub·Suggest an improvement