Availability is a number, not a vibe
Availability = uptime / (uptime + downtime). "Reliability" is the broader idea: the system does the right thing, at the right time, even when parts fail. Availability is the part of reliability you can write into a contract (SLA/SLO), so let us do the math properly.
The nines, converted into downtime
- 99% (two nines): 3.65 days/year down. A weekend-long outage every month or so.
- 99.9% (three nines): 8.8 hours/year. Acceptable for many internal tools.
- 99.99% (four nines): 52.6 minutes/year. Serious production systems.
- 99.999% (five nines): 5.3 minutes/year. Telecom-grade; brutally expensive.
Each extra nine is roughly 10x less downtime and easily 10x more engineering cost. "We want five nines" without a budget is not a requirement, it is a wish.
Availability math: serial and parallel
Serial chain: request goes LB -> app -> DB. If each is 99.9%, the chain is 0.999 x 0.999 x 0.999 = 99.7%. Every component you add lowers total availability. Fewer moving parts is an availability strategy.
Parallel redundancy: two components where either can serve: 1 - (1 - 0.999)^2 = 99.9999%. Redundancy is how you buy nines. This is the entire reason for replicas, multi-AZ deployments and active-passive failover pairs.
Single points of failure (SPOF) hunting
Walk the request path and ask "if this dies, does the user notice?" for every box: one LB (add a failover pair or use a managed LB), one app server (run at least 2, behind the LB), one DB primary (replica + automatic failover), one Redis (sentinel/cluster), one queue (it is replicated already, usually), one engineer who knows the deploy command (documentation is availability too).
Failure detection and failover
Redundancy is useless without fast detection. Health checks (LB-level, every few seconds), heartbeats (service-level), and a failover mechanism: DNS failover (slow, minutes), virtual IP takeover (fast), or managed multi-AZ failover (RDS promotes a replica in ~60-120 seconds). Know your failover time, because downtime = detection time + failover time, not just crash time.
Worked example
Target: 99.95% for a web API. LB: managed (multi-AZ, ~99.99%). App: 3 stateless servers across 2 zones. DB: primary + replica with auto-failover (~99.9% effective). Chain: 0.9999 x 0.999 x 0.999, roughly 99.9%. To hit 99.95 you would improve the weakest link first: DB failover automation and health-check tuning, not a fourth app server.
Common interview traps
- Claiming "high availability" with one database.
- Adding components to be "robust" and accidentally lowering serial availability.
- No answer for "how does the system notice the primary died, and how long does failover take?"
Interview Q&A
Q: How do you get from three nines to four?
A: Remove SPOFs with redundancy (multi-AZ everything), automate failover so detection + promotion is under a minute, add health checks and alerts, and practice failure (game days). The jump from 99.9 to 99.99 is mostly operational discipline, not new components.
Q: Is 100% availability possible?
A: No. Networks partition, disks die, humans deploy bugs. The honest goal is a target number of nines per feature, plus graceful degradation so failures hurt less.
Availability ek number hai, vibe nahi
Availability = uptime / (uptime + downtime). "Reliability" bada concept hai: system sahi kaam, sahi time par kare, jab parts fail ho rahe hon. Availability reliability ka wo hissa hai jo contract (SLA/SLO) mein likha ja sakta hai, to chalo math sahi se karte hain.
Nines, downtime mein convert karke
- 99% (two nines): saal mein 3.65 din down. Har mahine lagbhag ek weekend ka outage.
- 99.9% (three nines): saal mein 8.8 ghante. Kayi internal tools ke liye theek.
- 99.99% (four nines): saal mein 52.6 minute. Serious production systems.
- 99.999% (five nines): saal mein 5.3 minute. Telecom-grade; bahut mehenga.
Har extra nine matlab ~10x kam downtime aur aasaani se 10x zyada engineering cost. Bina budget ke "five nines chahiye" requirement nahi, wish hai.
Availability math: serial aur parallel
Serial chain: request LB -> app -> DB se guzarti hai. Har ek 99.9% ho to chain = 0.999 x 0.999 x 0.999 = 99.7%. Har naya component total availability ghatata hai. Kam moving parts bhi ek availability strategy hai.
Parallel redundancy: do components jinme se koi bhi serve kare: 1 - (1 - 0.999)^2 = 99.9999%. Nines aise kharide jaate hain. Replicas, multi-AZ deployments aur active-passive failover pairs ka poora reason yehi hai.
SPOF hunting
Request path par chalo aur har box ke liye poochho "ye mara to user ko pata chalega?": ek LB (failover pair ya managed LB), ek app server (kam se kam 2, LB ke peeche), ek DB primary (replica + automatic failover), ek Redis (sentinel/cluster), ek queue (usually already replicated), ek engineer jisko deploy command aati hai (documentation bhi availability hai).
Failure detection aur failover
Fast detection ke bina redundancy bekaar hai. Health checks (LB-level, har kuch second), heartbeats (service-level), aur failover mechanism: DNS failover (slow, minutes), virtual IP takeover (fast), ya managed multi-AZ failover (RDS replica ko ~60-120 seconds mein promote karta hai). Apna failover time jaano, kyunki downtime = detection time + failover time, sirf crash time nahi.
Worked example
Target: web API ke liye 99.95%. LB: managed (multi-AZ, ~99.99%). App: 3 stateless servers, 2 zones mein. DB: primary + replica, auto-failover (~99.9% effective). Chain: 0.9999 x 0.999 x 0.999 ≈ 99.9%. 99.95 tak pahunchne ke liye sabse weak link pehle sudharo: DB failover automation aur health-check tuning, chautha app server nahi.
Common interview traps
- Ek hi database ke saath "high availability" claim karna.
- "Robust" banane ke chakkar mein components badhakar serial availability gira dena.
- "Primary mara to system ko kaise pata chalega aur failover kitne time mein hoga?" ka jawab na hona.
Interview Q&A
Q: Three nines se four nines kaise?
A: Redundancy se SPOF hatao (sab kuch multi-AZ), failover automate karo taaki detection + promotion ek minute ke andar ho, health checks aur alerts lagao, aur failure ka abhyaas karo (game days). 99.9 se 99.99 ka jump mostly operational discipline hai, naye components nahi.
Q: 100% availability possible hai?
A: Nahi. Networks partition hote hain, disks marti hain, log bugs deploy karte hain. Imaandaar goal: har feature ka apna nines target, aur graceful degradation taaki failures kam dukh den.