CodeWithYash
DSA
Spring Boot
System Design
Series
Articles
Leaderboard
Sign In

Subscribe to Newsletter

Get the latest articles, DSA sheets, and system design challenges delivered to your inbox.

<CODEWITHYASH/>

The ultimate sanctuary for software engineers seeking deep mastery of core technical principles.

Library

  • Articles
  • DSA Sheets
  • Roadmaps

Connect

  • GitHub
  • LinkedIn
  • About
  • Contact

Legal

  • Privacy
  • Terms
  • Support

© 2026 CodeWithYash Global Systems.

Status: OperationalVersion: 4.2.0
System Design
OverviewTheory lessonsHLDLLD
All SeriesSeries
Distributed Systems

System Design Series

0%

0 of 33 topics completed

Progress
Hardware Numbers Every Systems Engineer Must KnowCore
20 min
Network Protocols & Real-Time Communication ParadigmsCore
25 min
Latency vs. Throughput & The Tail at ScaleCore
25 min
Scalability Dimensions & Universal LawsCore
25 min
Availability, SLOs, SLIs & Error BudgetsCore
20 min
ACID vs. BASE & The Consistency SpectrumCore
30 min
CAP Theorem & PACELC FrameworkCore
25 min
System DesignFoundations & Mental ModelsAvailability, SLOs, SLIs & Error Budgets

Foundations · Phase 1: Foundations

Availability, SLOs, SLIs & Error Budgets

Quantify uptime math (99.9% vs 99.99%), calculate serial vs parallel system reliability, and establish actionable SRE error budget burn rates.

Primary specification: Google SRE Book: Service Level Objectives

Written & reviewed by Yash Patel 20 minBaseline 2026.1 Curated Blueprint· Verified 2026-09-14

Lesson 5 of 33

1d streak

The Architectural Question

Engineers promise 99.99% availability without recognizing that chaining five 99.9% services mathematically reduces end-to-end availability below 99.5%.

Core Engineering Objectives

  • Uptime translation: 99.9% (8.7 hrs downtime/yr) vs 99.99% (52.6 mins downtime/yr)
  • Component composition: serial availability product vs parallel redundancy math
  • SLI measurement, SLO targets, and error budget burn rate alert thresholds

1. What is it & Why it Matters

Reliability in production systems is governed by four core terms: - SLI (Service Level Indicator): The quantifiable metric you measure (e.g., % of HTTP requests returning < 500 in under 200ms). - SLO (Service Level Objective): The internal reliability target agreed by product and engineering (e.g., 99.9% availability over 30 days). - SLA (Service Level Agreement): The contract with external customers featuring financial penalties if breached. - Error Budget: 100% - SLO (e.g., for a 99.9% SLO, the error budget is 0.1% allowable failure).

The Myth of 100% Availability

A 100% target leaves no room for safe deployments or inevitable failures. Choose an SLO from user needs and business impact, then decide whether the cost of each additional nine is justified.

2. The Mathematics of the Nines

Every additional "9" of availability cuts allowable downtime by a factor of 10 while exponentially increasing architectural complexity:

Availability TargetDowntime per YearDowntime per Month (30 days)Downtime per Week
99% (Two 9s)3.65 days7.2 hours1.68 hours
99.9% (Three 9s)8.76 hours43.2 minutes10.1 minutes
99.95% (Three and a half 9s)4.38 hours21.6 minutes5.04 minutes
99.99% (Four 9s)52.6 minutes4.32 minutes1.01 minutes
99.999% (Five 9s)5.26 minutes25.9 seconds6.05 seconds

3. Serial vs. Parallel Availability Math

Architectural Boundary · Do Not Confuse

Concept A

Serial Dependencies Multiply Unavailability

Concept B

Parallel Redundancy Mitigates Failures

Serial availability is the product of components: A_total = A1 * A2 * A3. Three 99.9% services in series yield (0.999)^3 = 99.7% availability (downtime triples from 43 min to 130 min/month). In parallel, A_total = 1 - (1 - A1)(1 - A2). Two 99% instances in parallel deliver 1 - (0.01)^2 = 99.99% availability.

4. How Error Budgets Govern Velocity

Error Budget StatusBurn RateEngineering ActionDeployment Policy
Budget Healthy (> 50% remaining)Normal (< 1x)Focus on rapid feature deliveryContinuous deployment allowed
Budget Burning (10% lost in 24h)Elevated (2x – 5x)Investigate telemetry regressions during work hoursCanary deployments with automated rollback
Budget Exhausted (100% burned)Critical (> 14x)All non-critical feature releases frozen100% engineering bandwidth diverted to reliability

Use it when

Enforce automatic deployment freezes when error budgets are exhausted to re-align product and engineering incentives around stability.

Reconsider when

Do not page on-call engineers for slow burns; route them to standard ticket queues to prevent alert fatigue.

5. Interview Cheat Sheet: MTBF vs. MTTR

  1. 01Formula: Availability = MTBF / (MTBF + MTTR), where MTBF is Mean Time Between Failures and MTTR is Mean Time To Recovery.
  2. 02The High-Yield Lever: Doubling MTBF (preventing bugs) is extremely hard. Reducing MTTR from 60 minutes to 1 minute (via health-check ejection, feature flags, automated rollbacks) improves availability by 60x with vastly lower engineering cost.

6. Active Recall Checkpoint

Active Recall Checkpoint

If a system consists of 3 microservices in a strict synchronous serial chain, each with 99.9% availability, what is the overall availability of the system?

Hint: Multiply the individual availabilities: (0.999)^3.

Show answer & explanation

Overall availability is (0.999)^3 ≈ 0.997, or 99.7%. Despite every component maintaining "three nines", the serial chain drops overall availability to under two and a half nines, allowing over 2 hours of downtime per month.

Engineering Decision Matrix

Architectural Trade-Off Analysis

Compare latency, throughput, consistency, and operational complexity across core industry alternatives.

Architectural Trade-Off Matrix

Architecture Decision Matrix

Multi-axis engineering evaluation and FAANG interview rules of thumb.

Option A

SQL (Postgres / MySQL)

Relational ACID Store

Structured schema, relational joins, ACID transactions, and strict foreign keys.

Option B

NoSQL (Cassandra / DynamoDB)

Distributed Non-Relational Store

Horizontal partition keys, denormalized documents/wide-columns, and tunable consistency.

Evaluation AxisSQL (Postgres / MySQL)NoSQL (Cassandra / DynamoDB)Details
Latency
Moderate Strong
Throughput
Moderate Strong
Scalability
Moderate Strong
Consistency
Strong Moderate
Complexity
Strong Moderate
Cost
Moderate Strong
FAANG Interview Rule of Thumb

When to Choose in an Architecture Interview

Pick SQL (Postgres / MySQL) If:

Choose SQL when ACID guarantees are non-negotiable (financial ledgers, payment processing, inventory checkout) or when query access patterns are unpredictable and require ad-hoc analytical joins.

Pick NoSQL (Cassandra / DynamoDB) If:

Choose NoSQL when write volume exceeds single-node capacity (>20K writes/sec), data is unstructured/hierarchical (logs, telemetry, user feeds), or multi-region active-active replication is mandatory.

Examiner Trap to Avoid:

Never say "NoSQL is faster than SQL" without qualification. SQL with proper B-Tree indexes on indexed primary keys is lightning fast. NoSQL wins on horizontal write scaling, not inherent single-row read speed.

Production Postmortem & Verification

Production Incident Postmortem

  1. Trigger / Setup: A critical financial service chains 6 microservices in series, each independently rated for 99.9% availability.
  2. Production Symptom: Fleet encounters over 43 hours of cumulative downtime annually, violating customer SLA commitments.
  3. Root Cause & Fix: Serial availability multiplies: (0.999)^6 = 99.4%; decouple dependencies with asynchronous queues and read replicas.

Acceptance Criteria & Outcomes

  • Calculate annual and monthly allowed downtime minutes for any given number of 9s.
  • Compute overall system availability for mixed topologies containing serial and parallel redundant components.
  • Formulate an error budget burn-rate policy that halts feature deployments when risk thresholds are crossed.

End-of-Chapter Synthesis & Key Takeaway

Availability, SLOs, SLIs & Error Budgets is built around one fundamental rule: Establish clear responsibility and explicit trade-offs.. Before adding components, establish explicit quantitative SLAs for latency, throughput, and consistency. Choose the simplest architecture that meets stated constraints.

Architectural & Technical Interview Review

Core FAANG Interview Questions

3 Questions
Q01
How do you justify introducing Availability, SLOs, SLIs & Error Budgets into a high-scale production architecture?
Click to reveal model answer →Hide answer ↑Requirements & Design Brief

Introduce Availability, SLOs, SLIs & Error Budgets only when measured scale, data size, or failure boundaries exceed single-node capacity. State the exact bottleneck, evaluate operational overhead, and verify that the trade-offs justify the added moving parts.

Source section: Requirements & Design Brief
Q02
What is the primary trade-off and hidden operational cost of Availability, SLOs, SLIs & Error Budgets?
Click to reveal model answer →Hide answer ↑Architecture Trade-offs

It improves scalability and availability, but introduces network hops, serialization overhead, and eventual consistency or coordination complexity.

Source section: Architecture Trade-offs
Q03
How do you handle catastrophic failure or dependency degradation in Availability, SLOs, SLIs & Error Budgets?
Click to reveal model answer →Hide answer ↑Failure Review & Recovery

Implement connect/read timeouts, exponential backoff with jitter, and fallback defaults so downstream degradations do not cause cascading outages.

Source section: Failure Review & Recovery

Production Pitfalls & Anti-Patterns

Critical Failure Anti-Patterns

!

Premature Distributed Complexity

Scattering distributed components before identifying concrete write, read, or storage limits creates accidental points of failure and operational debt.

Production Mitigation: Start with the simplest modular design that satisfies requirements, evolving it only as measured constraints dictate.

!

Unbounded Retries and Cascading Storms

When a dependency degrades, immediate synchronized retries multiply downstream traffic, turning a minor slowdown into a total fleet outage.

Production Mitigation: Enforce strict retry budgets, exponential backoff, and full randomized jitter on all client calls.

!

Neglecting Observability and Metrics

Deploying architecture without distributed tracing or p99 tail latency alerts leaves engineers blind when partial partitions occur.

Production Mitigation: Export metrics for request rate, error rate, p95/p99 duration, and saturation at every service boundary.

Primary Documentation & Specifications

Google SRE Book: Service Level Objectives
Previous LessonScalability Dimensions & Universal LawsFoundationsNext LessonACID vs. BASE & The Consistency SpectrumFoundations

In this chapter

01Architectural Question021. What is it & Why it Matters032. The Mathematics of the Nines043. Serial vs. Parallel Availability Math054. How Error Budgets Govern Velocity065. Interview Cheat Sheet: MTBF vs. MTTR076. Active Recall Checkpoint08Trade-Off Analysis09Production Verification10Synthesis & Review11Primary References

Chapter promise

Uptime translation: 99.9% (8.7 hrs downtime/yr) vs 99.99% (52.6 mins downtime/yr)