LESSON 04 · Quality targets

Give latency and availability a budget

Translate a response goal and uptime target into constraints a design can test.

SYSTEM VIEW

The calculation

Diagram view
Swipe or scroll to explore the full diagram
Quality targets become measurable budgetsExample response path: 40 milliseconds of network, 30 of app, 110 of data, and 20 of reserve fit a 200 millisecond target. A 99.9 percent target allows 43.2 minutes of downtime in thirty days.Quality targets become measurable budgets+++40 ms networktravel and transport30 ms appbusiness logic110 ms dataquery and response20 ms reserveremaining budget200 ms targetfull request path99.9% uptime43.2 min / 30 daysThese are illustrative budgets; measure the actual path and its slow requests.
Example response path: 40 milliseconds of network, 30 of app, 110 of data, and 20 of reserve fit a 200 millisecond target. A 99.9 percent target allows 43.2 minutes of downtime in thirty days.
Follow the units from assumptions to a capacity decision.
THE IDEA

How it works

A response-time target is a budget shared by network travel, application work, data access, and serialization. Rough magnitudes show where it goes. These are approximate and vary by hardware: a memory read takes about 100 nanoseconds, an SSD read about 100 microseconds, a round trip within one data center about 0.5 ms, and a round trip between continents about 100 to 200 ms. One intercontinental round trip can use most of a 200 ms target. Compare options with these figures, then measure your own path.

Averages hide slow requests, so targets use percentiles: a p95 of 180 ms means 95% of requests finish within 180 ms. Percentiles do not add. If the database p95 is 180 ms and the application p95 is 30 ms, the request p95 need not be 210 ms, because the slowest database calls may not coincide with the slowest application work. Measure the whole request end to end. A page waiting on ten independent backend calls also has about a 10% chance that at least one lands in its slowest 1% (1 − 0.99¹⁰).

Availability percentages need a time window. At 99.9% over a 30-day month, the allowed unavailable time is 0.1% × 30 × 24 × 60 = 43.2 minutes; at 99.99% it is 4.3 minutes. Google’s site reliability engineers call this allowance an error budget. That figure is a target, not a guarantee from adding replicas, and each extra nine costs more, so a back-office tool rarely needs the same target as checkout.

DECISION POINT

A page has a 200 ms target, but the database alone takes 180 ms at the 95th percentile. What does the estimate reveal?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Split latency across the full request path and check its slowest cases.
  • Percentiles do not add, so measure end to end.
  • Convert availability targets to time and plan the failures that could consume it.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
ApplyQUESTION 01

Every request makes one database call and then does application work. The database p95 is 180 ms and the application p95 is 30 ms. What do you know about the whole request’s p95?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 3 checkpoints answered correctly to complete this lesson.