Opening your learning path
Progress is saved as you study.
Opening your learning path
Progress is saved as you study.
Opening your learning path
Progress is saved as you study.
Availability & SLA Math is a depth lesson in the Foundations family of the Thita system design course.
The 45-minute interview framework, estimation with modern numbers, and CAP theorem.
It sits on the Deep Dive path — worth reading once the Interview Soon lessons are solid, or when a role names this area explicitly.
Availability is arithmetic. If a design has five required services in the request path, each at 99.9%, the user-facing system is about 99.5% available. That means almost two days of downtime per year. Interviewers ask about availability math because it turns vague reliability claims into design choices.
Availability is the percentage of time a system serves requests within its defined contract. The contract must be measurable. “API returns HTTP 200 within 300 ms” works. “System is healthy” does not.
Treat nines as downtime budgets. A jump from 99.9% to 99.99% cuts allowed downtime from hours to minutes. That change usually affects architecture, operations, staffing, and cost.
| Availability | Downtime / Year | Downtime / Month | Meaning |
|---|---|---|---|
| 99% | ~3.65 days | ~7.3 hours | Acceptable for internal tools |
| 99.9% | ~8.7 hours | ~43.8 minutes | Common target for normal production services |
| 99.95% | ~4.4 hours | ~21.9 minutes | Common target for high-value user-facing APIs |
| 99.99% | ~52 minutes | ~4.4 minutes | Needs redundancy, fast rollback, and disciplined operations |
| 99.999% | ~5.3 minutes | ~26 seconds | Needs specialized engineering and high cost |
For interviews, memorize three anchor points:
Those numbers are enough to sanity-check most reliability discussions.
Avoid saying “we need five nines” by default. Five nines gives you about five minutes per year for deploy mistakes, bad config, dependency failures, regional outages, expired certificates, overload, and operator error. Most products cannot justify that cost for every path.
A service-level agreement is the promise users or customers see. A service-level objective is the internal target the team builds toward. A service-level indicator is the measurement, such as successful requests divided by total requests over a time window.
Use this format in interviews:
1SLI: successful checkout requests under 500 ms / total checkout requests
2SLO: 99.95% monthly success rate
3SLA: customer-facing contractual promise, usually lower than the SLOThe SLO should be tighter than the SLA because teams need margin for measurement noise, incident response, and unknown failure modes. If the public SLA is 99.9%, an internal SLO of 99.95% gives the team room before it violates the customer promise.
Define availability from the user request’s point of view. Server uptime is a poor proxy unless the user directly connects to that server. A machine can be up while the product is unavailable because DNS is broken, the database is saturated, a dependency is timing out, or latency exceeds the promised threshold.
If a request needs multiple components to succeed, total availability is the product of their availabilities. This is series availability. It is the fastest way to catch overconfident designs.
If checkout requires the API, cache, database, and payment provider, checkout availability is:
1A_total = A_api × A_cache × A_db × A_paymentExample:
1API: 99.9% = 0.999
2DB: 99.9% = 0.999
3
4Total: 0.999 × 0.999 = 0.998001
5Result: 99.8%That drop doubles downtime from roughly 8.7 hours/year to roughly 17.5 hours/year. The design lost another full business day of annual availability.
Interview rule: every required dependency reduces availability. If the dependency is on the critical path, include it in the math. If it can fail open, degrade, or run asynchronously, it can stay outside the core user-visible availability calculation.
| Request Path | Availability Math | Result | Readout |
|---|---|---|---|
| API only at 99.9% | 0.999 | 99.9% | ~8.7h/year downtime |
| API + DB, both 99.9% | 0.999 × 0.999 | 99.8% | ~17.5h/year downtime |
| API + DB + cache, all required at 99.9% | 0.999³ | 99.7% | ~26.3h/year downtime |
| API + DB + payment, all 99.99% | 0.9999³ | 99.97% | ~2.6h/year downtime |
Remove required dependencies from the critical path when the product can tolerate degraded behavior. A feed service can serve cached or stale content if ranking is down. A checkout service usually must wait for payment authorization.
Each required dependency multiplies in: 99.9% alone, then 99.8%, 99.7%, 99.6% as cache, database and payment join the checkout path.
Redundancy improves availability when any one of several replicas can serve the request. The formula is:
1A_total = 1 - (1 - A)^NA is the availability of one independent replica. N is the number of replicas.
If one instance is 99.9% available, two independent instances behind a load balancer are:
11 - (1 - 0.999)^2
2= 1 - 0.001^2
3= 0.999999
4= 99.9999%State the assumption clearly: the replicas must fail independently. Two app servers in the same availability zone, using the same deploy, database, load balancer, and config service are exposed to many of the same failures. Redundancy helps only against the failure modes it separates.
| Design | Formula | Result | What It Protects Against |
|---|---|---|---|
| 1 instance at 99.9% | 0.999 | 99.9% | No redundancy |
| 2 independent instances | 1 - 0.001² | 99.9999% | Single-instance failure |
| 3 independent instances | 1 - 0.001³ | 99.9999999% | Multiple independent instance failures |
| 2 instances, same DB required | app redundancy × DB availability | Often DB-limited | App failure only |
Candidates often miss the last row. Adding ten stateless API servers still leaves the service capped by a single-primary database with no failover. System availability is usually capped by the weakest required component.
Availability math is easy. Independence is the design work. Two replicas are independent only when the same event is unlikely to take both down.
Common sources of correlated failure:
Say the independence assumption out loud in interviews:
1Two app replicas improve availability for instance-level failures.
2To protect against AZ failure, I place replicas across AZs and make the load balancer, database failover, and deployment process tolerate AZ loss.Active-active multi-region should come after multi-AZ for most systems. Cross-region systems add latency, data consistency problems, failover risk, and operational burden. Use multi-AZ first. Use multi-region when the prompt explicitly requires tolerance for a full regional outage.
An error budget is the amount of failure allowed by an SLO. If the monthly SLO is 99.95%, the error budget is 0.05% of requests or time for that month.
For time-based availability:
130-day month = 30 × 24 × 60 = 43,200 minutes
2
399.95% target
4Error budget = 0.05% = 0.0005
5
643,200 × 0.0005 = 21.6 minutes/monthA 99.95% monthly target gives about 21.6 minutes of allowed downtime per month. One bad deploy, one database failover that stalls, and one dependency incident can burn the entire month.
For request-based availability:
1Monthly requests: 1,000,000,000
2SLO: 99.95%
3Error budget: 0.05%
4
5Allowed failed requests:
61,000,000,000 × 0.0005 = 500,000Request-based budgets usually fit APIs better because they match user impact. A five-minute outage during peak traffic hurts more than five minutes at 3 a.m. Time-based math hides that difference. In interviews, use request-based SLOs when traffic varies heavily. Use time-based SLOs for simpler service availability discussions.
Error budgets turn reliability decisions into policy. If the service is burning budget too fast, slow down risky releases and fix the top failure mode. If the service has plenty of budget left, normal shipping can continue.
| Budget State | Meaning | Engineering Decision |
|---|---|---|
| Budget healthy | Failures are within target | Continue normal releases |
| Budget burning fast | Reliability risk is higher than planned | Freeze risky launches, fix top failure mode |
| Budget exhausted | SLO already missed or close to missed | Stop nonessential changes until stable |
| Chronic budget surplus | Target may be too loose or the system may be overbuilt | Consider lowering cost or raising the SLO for selected paths |
Monitoring tells you something happened. Error budgets tell you whether the system is violating the product promise and how release behavior should change.
Tie the budget to the user journey that matters most. A social app might set a strict SLO for posting and reading the home feed, with a looser SLO for analytics dashboards. A payments system usually needs strict SLOs for authorization and settlement. Reporting exports can be slower and less available.
Availability includes latency when the contract includes latency. If the contract says “99.9% of reads under 200 ms,” slow responses count as failures. Overloaded systems often become slow before they return errors.
A service can have high machine uptime and poor user availability. For example, Postgres may be running while indexed reads take 5 seconds because a migration caused lock contention. Under a latency-based SLO, the user-facing API is unavailable.
Use latency thresholds in SLIs when user experience depends on speed:
1Good request = HTTP 2xx AND latency < 300 ms
2Bad request = HTTP 5xx OR timeout OR latency >= 300 msKeep the first pass simple. Pick a threshold that matches the product path, then refine if asked. For checkout, 500 ms to 1 second may be acceptable for backend completion. For autocomplete, 200 ms can feel slow.
Use this sequence when an interviewer asks for a reliability target or challenges your design.
11. What user action are we protecting?
22. What is the target SLO?
33. What dependencies are required for that action?
44. Multiply required dependencies for composite availability.
55. Add redundancy where failure must be masked.
66. Check independence: AZ, deploy, config, data store, dependency.
77. Define the error budget and release policy.The sequence prevents two common mistakes: jumping to multi-region too early, and treating availability as a property of one service rather than the full request path.
For most interviews, start with 99.9% or 99.95% for normal user-facing services. Move to 99.99% for paths like payments, authentication, order placement, or infrastructure used by many services. Use 99.999% only when the prompt describes life-safety systems, core financial infrastructure, telecom-grade systems, or contractual penalties that justify the cost.
Assume checkout requires four components:
| Component | Availability |
|---|---|
| API tier | 99.99% |
| Inventory service | 99.9% |
| Payment provider | 99.95% |
| Database | 99.99% |
Composite availability:
10.9999 × 0.999 × 0.9995 × 0.9999
2= 0.9983007
3= 99.83%That is about 14.9 hours of downtime per year, even though each component looks reliable alone. The inventory service at 99.9% and payment provider at 99.95% dominate the result because every checkout requires them.
Start by deciding which failures can degrade safely. If inventory is unavailable, the system might allow checkout only when the item was recently reserved, or it might place the order into a pending state. If payment is unavailable, checkout usually cannot complete. The system can still preserve the cart and retry authorization later.
A strong design answer sounds like this:
1Checkout completion depends on payment, so payment availability caps the path.
2I would make the API and database multi-AZ, keep cart state durable, and design inventory with reservations so short inventory outages do not always block checkout.Interviews require fast directional math, not perfect arithmetic. The goal is to catch bad designs quickly.
Useful shortcuts:
When under pressure, convert availability to failure probability. Multiplication becomes easier. Two required services at 0.1% failure each roughly add to 0.2% failure for small probabilities, giving 99.8% availability.
A short Python snippet can help verify the formulas while studying:
1def series(*availabilities):
2 result = 1.0
3 for a in availabilities:
4 result *= a
5 return result
6
7def redundant(a, n):
8 return 1 - (1 - a) ** n
9
10print(series(0.999, 0.999)) # 0.998001
11print(redundant(0.999, 2)) # 0.999999Write code in the interview only if asked. Internalize the formulas so you can explain the tradeoff without pausing for long arithmetic.
Default: For most system design interviews, propose 99.9% to 99.95% for ordinary user-facing services and 99.99% for critical paths such as login, checkout, payments, or order placement. Calculate composite availability by multiplying required dependencies. Improve the weakest required path with multi-AZ redundancy, graceful degradation, retries with timeouts, and rollback-safe deploys. Use a monthly error budget: for 99.95%, the budget is 0.05%, or about 21.6 minutes per 30-day month.
Warning: Common failure modes:
- They memorize nines without converting them into downtime. If you cannot say “99.9% is about 8.7 hours/year,” your reliability discussion sounds decorative.
- They add availability instead of multiplying required dependencies. Two required 99.9% systems produce about 99.8%.
- They apply the redundancy formula without checking independence. Two replicas sharing the same database, AZ, deploy pipeline, and config share many real failure modes.
- They claim five nines without explaining cost, operations, failover, rollback, and dependency isolation. Five nines is an engineering program.
- They define availability as server uptime. Interviewers care whether the user action succeeds within the latency contract.
- They ignore third-party dependencies. A payment provider, identity provider, or email service can cap the availability of the user journey.
- They cannot calculate an error budget. For 99.95%, the allowed failure is 0.05%; over a 30-day month, that is about 21.6 minutes.
- They treat all features as equally critical. A product can need 99.99% for checkout and 99% for admin analytics.
| Category | Metric | 2026 Number | Interview Use |
|---|---|---|---|
| Availability | 99.9% downtime | ~8.7 hours/year, ~43.8 minutes/month | Baseline for normal production services |
| Availability | 99.99% downtime | ~52 minutes/year, ~4.4 minutes/month | Critical-path target |
| Availability | 99.999% downtime | ~5.3 minutes/year, ~26 seconds/month | Rare target; requires strong justification |
| Error budget | 99.95% monthly target | 0.05% budget, ~21.6 minutes/month | Good default for high-value user-facing APIs |
| Compute | General-purpose machine | 512 GiB RAM, 128 vCPUs | Modern servers can be large |
| Compute | Memory-optimized machine | 4 TB RAM | Useful for cache-heavy or analytics-heavy systems |
| Compute | High-memory machine | 24 TB RAM | Relevant for very large in-memory datasets |
| Storage | Local SSD | Up to 60 TB | One machine can handle more data than many candidates assume |
| Storage | Local HDD | Up to 336 TB | Good for high-capacity local storage; poor for low-latency paths |
| Network | Within datacenter | 25–100 Gbps | Check network capacity before blaming the network |
| Latency | Same AZ | <1 ms | Use for low-latency service calls |
| Latency | Cross-AZ | 1–2 ms | Usually acceptable for high availability within a region |
| Latency | US–EU cross-region | 70–90 ms | Too high for many synchronous request paths |
| Latency | US–India | 150–250 ms | Use regional serving or async workflows |
| Latency | Redis GET | <1 ms | Useful for hot reads and session lookup |
| Latency | Postgres indexed read | 1–5 ms | Check DB capacity before adding cache |
| Latency | S3 first byte | 50–100 ms | Fine for objects; poor for tight synchronous loops |
| Latency | CDN edge | 5–30 ms | Good default for global static or cacheable content |
| Throughput | Redis | 100K–500K ops/sec per instance | One instance handles substantial read/write load |
| Throughput | Postgres single primary | 10K–50K TPS, tens of TB before sharding | Avoid sharding at 100 GB |
| Throughput | Kafka | 1M+ msg/sec per cluster, single-digit ms latency | Good default for high-throughput event pipelines |
| Throughput | Elasticsearch | 10K–50K queries/sec per cluster | Useful for search-heavy workloads |
| Estimation | QPS from DAU | DAU × actions/user ÷ 86,400; peak = 2–3× average | Fast traffic estimate |
| Estimation | Storage | writes/day × bytes/write × retention days | Fast capacity estimate |
| Estimation | Bandwidth | QPS × average response size | Fast network estimate |