Skip to content
intermediatePhase 43 · System Design Foundations

Availability

Measure and improve uptime with redundancy and failover mechanisms.

45m
0 problems
Topic Progress0%

Measuring Availability

Availability is the percentage of time a system is operational and accessible.

The Formula

Availability = (Uptime / Total Time) × 100%

Example:
Uptime = 364 days 23 hours 56 minutes = 364.9972 days
Total Time = 365 days
Availability = (364.9972 / 365) × 100% = 99.999%

The Nines of Availability

Nines Downtime/Year Downtime/Month Use Case
99% 3.65 days 7.31 hours Non-critical
99.9% 8.76 hours 43.8 min Internal tools
99.99% 52.6 min 4.38 min Web applications
99.999% 5.26 min 26.3 sec Financial systems
99.9999% 31.5 sec 2.63 sec Critical infrastructure

Downtime Cost Example

System: E-commerce platform
Revenue: $100,000/hour

99.9% availability → 8.76 hours downtime → $876,000 lost
99.99% availability → 52.6 min downtime → $87,700 lost
99.999% availability → 5.26 min downtime → $8,770 lost

Why Availability Matters

User Expectations:
- 99.9% = Users notice occasional downtime
- 99.99% = Users rarely notice downtime
- 99.999% = Users never notice downtime

Business Impact:
- Downtime = Lost revenue
- Downtime = Lost trust
- Downtime = SLA penalties

Common Availability Numbers

Service Target Availability
Google Search 99.99%
AWS EC2 99.99%
Azure 99.95%
Netflix 99.99%
Banking 99.999%

Redundancy

Redundancy eliminates single points of failure by having backup components.

Types of Redundancy

Redundancy
├── Hardware Redundancy
│   ├── Duplicate servers
│   ├── RAID storage
│   └── Redundant power supplies
├── Software Redundancy
│   ├── Multiple instances
│   ├── Replicated data
│   └── Backup services
├── Network Redundancy
│   ├── Multiple network paths
│   ├── Redundant switches
│   └── Multiple ISPs
└── Geographic Redundancy
    ├── Multiple data centers
    ├── Multi-region deployment
    └── CDN distribution

Server Redundancy

Without Redundancy:        With Redundancy:
┌──────────┐              ┌──────────┐ ┌──────────┐
│ Server 1 │              │ Server 1 │ │ Server 2 │
│ (SPOF)   │              │ (Active) │ │ (Standby)│
└──────────┘              └──────────┘ └──────────┘
      │                        │            │
      │                        └──────┬─────┘
      ▼                               ▼
  Failure = Downtime            Failure = No downtime

Data Redundancy

Primary Database ──── Replication ────→ Replica 1
      │                                 Replica 2
      └──── Replication ────→ Replica 3

If Primary fails:
- Promote Replica to Primary
- Continue operations with minimal downtime

Geographic Redundancy

                    ┌─────────────────────┐
                    │    Load Balancer     │
                    └──────────┬──────────┘
               ┌───────────────┼───────────────
               │               │               │
        ┌──────▼──────┐ ┌─────▼───────┐ ┌────▼──────┐
        │  US-East    │ │  US-West    │ │  EU-West  │
        │  Data Center│ │  Data Center│ │  Data Ctr │
        └─────────────┘ └─────────────┘ └───────────┘

Region Failure → Traffic routed to other regions

Failover Mechanisms

Failover is the automatic switching to a backup system when the primary fails.

Types of Failover

Type Description Recovery Time
Automatic System detects failure and switches Seconds to minutes
Manual Operator triggers failover Minutes to hours
Semi-automatic Auto-detect, manual trigger Minutes

Active-Passive Failover

Normal Operation:
┌─────────────┐     ┌─────────────┐
│   Active    │     │   Passive   │
│  (serving)  │     │  (waiting)  │
└──────┬──────┘     └──────┬──────┘
       │                   │
       └────────┬──────────┘
                │
         ┌──────▼──────┐
         │   Traffic   │
         └─────────────┘

After Failure:
┌─────────────┐     ┌─────────────┐
│   Active    │     │   Passive   │
│   (DOWN)    │     │  (NOW ACTIVE)│
└──────┬──────┘     └──────┬──────┘
       │                   │
       └────────┬──────────┘
                │
         ┌──────▼──────┐
         │   Traffic   │
         └─────────────┘

Active-Active Failover

Both servers actively serve traffic:

┌─────────────┐     ┌─────────────┐
│  Active 1   │     │  Active 2   │
│  (serving)  │     │  (serving)  │
└──────┬──────┘     └──────┬──────┘
       │                   │
       └────────┬──────────┘
                │
         ┌──────▼──────┐
         │   Traffic   │
         └─────────────┘

If one fails, other continues serving 100% of traffic

Health Check Configuration

HealthCheck:
  Protocol: HTTP
  Path: /health
  Port: 8080
  Interval: 10 seconds
  Timeout: 5 seconds
  UnhealthyThreshold: 3  # Failures before marking unhealthy
  HealthyThreshold: 2    # Successes before marking healthy

Failover Best Practices

  1. Test failover regularly: Don't wait for real failures
  2. Monitor failover events: Alert on unexpected failovers
  3. Use circuit breakers: Prevent cascading failures
  4. Implement graceful degradation: Reduce functionality under load
  5. Document runbooks: Know how to handle each failure scenario

Practice Problems

0/3solved
Design Availability System

Design a scalable Availability system. Cover high-level architecture, data model, and API design.

Solution
// Complete system design:
// - Functional + Non-functional requirements
// - Capacity estimation
// - Data model (SQL/NoSQL choice)
// - API endpoints
// - Component architecture
// - Scaling strategy
// - Monitoring & reliability
Availability Scaling

How would you scale Availability to handle 10x the current load? Identify bottlenecks and solutions.

Solution
// Scaling approach:
// 1. Load balancing
// 2. Database sharding/replication
// 3. Cache layer (Redis)
// 4. CDN for static assets
// 5. Async processing (queues)
// 6. Microservices decomposition
Availability Failure Modes

Analyze potential failure modes for Availability and design mitigation strategies.

Solution
// Failure mitigation:
// 1. Redundancy (multi-AZ)
// 2. Circuit breakers
// 3. Retry with backoff
// 4. Dead letter queues
// 5. Health checks
// 6. Graceful degradation

Quiz

1. How much downtime does 99.99% availability allow per year?

Question 1 options

2. What is the main benefit of redundancy?

Question 2 options

3. In active-passive failover, what happens when the active system fails?

Question 3 options

4. What is the difference between active-passive and active-active failover?

Question 4 options

Flashcards

Question

What is availability?

Answer

The percentage of time a system is operational and accessible. Measured in nines: 99.9% = 8.76 hours downtime/year, 99.99% = 52.6 minutes/year.

Question

What is a single point of failure (SPOF)?

Answer

A component whose failure causes the entire system to fail. Redundancy eliminates SPOFs by having backup components.

Question

What are the types of redundancy?

Answer

Hardware (duplicate servers, RAID), Software (multiple instances, replication), Network (multiple paths, ISPs), Geographic (multiple data centers).

Question

What is failover?

Answer

Automatic switching to a backup system when the primary fails. Types: Active-Passive (standby takes over), Active-Active (both serve traffic).

Question

What is Availability?

Answer

Availability is a key concept in system design.

Revision Notes

Key Takeaways

  • 1.Availability is measured in nines - each nine is 10x improvement
  • 2.Redundancy eliminates single points of failure
  • 3.Active-active provides better utilization than active-passive
  • 4.Test failover regularly - don't wait for real failures
  • 5.Geographic redundancy protects against regional outages

Interview Tips

  • Always discuss availability targets early (99.9%, 99.99%, etc.)
  • Identify single points of failure in your design
  • Discuss failover strategy and recovery time objectives
  • Consider geographic redundancy for critical systems

Cheat Sheet

Availability - Cheat Sheet

The Nines:

Nines Downtime/Year
99% 3.65 days
99.9% 8.76 hours
99.99% 52.6 minutes
99.999% 5.26 minutes

Redundancy Types:

  • Hardware: Duplicate servers, RAID
  • Software: Multiple instances, replication
  • Network: Multiple paths, ISPs
  • Geographic: Multiple data centers

Failover Types:

  • Active-Passive: Standby takes over
  • Active-Active: Both serve traffic

Health Check Config:

  • Protocol: HTTP/HTTPS
  • Interval: 10 seconds
  • Timeout: 5 seconds
  • Unhealthy threshold: 3 failures