Reason about latency and availability
Use latency numbers, percentiles, and “nines” to set and meet targets.
- Compare the rough cost of memory, disk, and network operations.
- Explain why percentiles matter more than averages.
- Calculate availability for components in series and in parallel.
Non-functional requirements are usually stated as latency and availability targets. To reason about them you need a feel for how long common operations take, how to describe latency honestly, and how combining components changes overall availability.
Latency and availability, by the numbers
Rough latencies (orders of magnitude): main memory read ~100 ns; SSD random read ~100 µs; round trip within a data center ~0.5 ms; spinning-disk seek ~10 ms; round trip between continents ~100-150 ms. Memory is roughly 1,000× faster than SSD, which is why caches matter.
Percentiles: p50 is the median; p99 is the latency that 99% of requests beat. Averages hide the slow tail that real users feel.
Availability “nines”: 99.9% allows ~8.8 hours of downtime a year; 99.99% ~53 minutes; 99.999% ~5 minutes.
Combining components: if a request needs A and B (in series), availability is A × B, which is lower than either. If either of two replicas can serve (in parallel), availability is 1 − (1 − a)².
What each level allows per year: 99% is about 5,256 minutes of downtime, 99.9% about 526 minutes, and 99.99% about 53 minutes.
Each extra nine costs a lot more engineering: redundancy, automated failover, careful deploys. Teams make targets explicit with an SLI (what you measure, such as the fraction of successful requests), an SLO (the internal target, such as 99.9% over 30 days), and sometimes an SLA (a contract with customers that carries penalties).
Practice: get a feel for latency
Try it
Up to 15 XPHow long does this take?
You don’t need exact numbers, just which order of magnitude each one is in.
“Reading from main memory.”
“A random read from an SSD.”
“A round trip within a data center.”
“A round trip between continents.”
Practice: reach four nines
Try it
Up to 15 XPBuild a path that meets its target
Every request passes through each of these tiers, so they multiply. Reach 99.99% with as few servers as you can.
Add all the replicas you like. Something will still hold you back. What can you do about a tier you can’t replicate?
- Load balancerEach instance: 99.900%1 instance
- App serverEach instance: 99.000%1 instance
- DatabaseEach instance: 99.900%1 instance
- Payment providerEach instance: 99.950%Third party: no replicas
- Path availability
- 98.752%
- Downtime a year
- 6,556 minutes
- Servers you run
- 3
Try it
Up to 15 XPQuick reliability math
These come up all the time. Estimate each one.
Key takeaways
Memory ≪ SSD ≪ data center round trip ≪ cross-continent round trip.
Describe latency with percentiles such as p99, not averages.
Series dependencies multiply availability down; redundancy multiplies failure probability down.
Lesson quiz
6 questions · pass with 5 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…