Capacity performance and reliability targetsEstimate the demand. Know what your numbers mean.
Capacity performance and reliability targets. Learn the concepts, explore a model and defend your design.
03SYSTEM DESIGN
DEFINITION
Capacity is how much work a component can handle under a stated workload and quality limit. Latency is time for one operation; throughput is completed operations per time unit. A capacity estimate converts user behavior into demand, storage and resource assumptions. It is a planning model until a real implementation is measured.
Time, rate and work in progress
CONCEPTLatency200 ms for one request
CONCEPTThroughput100 completions / second
CONCEPTConcurrencyAbout 20 in progress
For a stable measured boundary: average concurrency = throughput x average time (0.2 seconds).
CONCEPT 1
Latency and throughput are different
The canteen comparison
Latency is how long one customer waits for a meal. Throughput is how many meals the kitchen finishes in a minute. A kitchen may finish many meals overall while one customer waits a long time. In software, latency is time per operation, often measured in milliseconds. Throughput is completed work per unit time, such as requests per second.
Why averages can mislead
Suppose nine requests take 20 ms and one takes 1,020 ms. The average is 120 ms, which describes neither the common fast request nor the very slow one particularly well. A percentile describes a position in the observed distribution. A p99 boundary says where 99 percent of observed operations finish under the measurement definition. Track errors and timeouts too; ignoring them can make a broken system look fast.
Concurrency connects work and time
Concurrency is the number of operations in progress. Under stable conditions, average in-flight work is approximately completion rate multiplied by average time in the system. At 100 requests per second and 0.2 seconds per request, that is about 20 requests in progress. This is a useful relationship, not permission to ignore bursty arrivals, overload or the boundary at which you measure.
CONCEPT 2
Calculate demand one step at a time
Start with users and actions
Assume a college app has 100,000 daily users and each makes 20 requests a day. Multiply to get 2,000,000 requests per day. There are 86,400 seconds in a day, so average traffic is about 23.1 requests per second. That is a calculated average, not a promise that lunchtime demand is only 23 requests each second.
Separate a peak assumption
If you assume peak traffic is ten times the average, the modeled peak is about 231 requests per second. Say clearly that ten is an assumption and explain why you selected it. An exam submission deadline may produce a much sharper burst. Separate reads from writes because they may stress different parts. At 90 percent reads, the model gives about 208 reads and 23 writes per second at peak.
Know which unknown matters
Changing the peak factor from ten to fifty changes the architecture more than rounding 23.1 to 23. A useful estimate identifies uncertainty rather than hiding it behind precise decimals. Ask for logs or run a realistic load test when available. Keep observed results separate from your hypothetical model, including the test hardware, data size and errors.
Convert daily behavior into peak demand
STEP 1Daily operations100,000 x 20 = 2 million
STEP 2Average2 million / 86,400 = 23.1/s
STEP 3Modeled peak23.1 x 10 = 231/s
The 10x peak multiplier is hypothetical. Keep that assumption separate from the arithmetic.
CONCEPT 3
Estimate storage without pretending it is exact
Count records and record size
Using the same 2 million daily requests, assume 10 percent create a 1 KB record. That is 200,000 records and approximately 200 MB of raw data each day. Thirty days adds about 6 GB before deletion or overhead. These calculations use decimal units: 1 KB is 1,000 bytes and 1 GB is one billion bytes. Binary KiB and GiB use powers of two.
Raw data is not the full storage bill
Indexes, row metadata, replicas and backups add space. File uploads can dominate small database records. Retention matters: keeping everything forever is a design choice, not a default law. Estimate the main categories separately so someone can change one assumption without recalculating an unexplained multiplier. Do not count a replica as a backup that can recover an old version after deletion.
Capacity must leave room for recovery
Suppose a load test shows a dependency is stable at 1,000 operations a second under a stated workload. Running it continuously at that limit leaves little margin for bursts, retries or a failed peer. The exact safety margin depends on the workload and objectives. Growth, recovery and maintenance are reasons to avoid treating the largest observed number as normal operating capacity.
Raw storage is only the first layer
CONCEPTRaw recordsCount x bytes x retention
CONCEPTServing overheadIndexes + replicas
CONCEPTRecovery capacityBackups + recovery margin
Do not label raw record size as the complete disk budget.
CONCEPT 4
Turn reliable and affordable into decisions
Availability and reliability
Availability concerns whether the service can perform a useful operation when needed. Reliability concerns correct dependable behavior over time under its stated conditions; definitions vary, so make your usage clear. A server returning errors quickly is not providing useful availability for the failed action. Define what a good user request means before counting success.
An SLO is a target you can check
A service-level indicator is a measurement, such as the fraction of valid order requests completed correctly. A service-level objective, or SLO, sets its target and time window. With 10 million eligible requests and a 99.9 percent good-request target, the request-based error budget is 10,000 bad requests. Do not automatically translate this into minutes of outage: that would need a different time-based definition.
Cost follows your choices
More copies, spare servers and shorter recovery targets can cost money and operator time. Estimate compute, storage, requests, data transfer and support effort separately. Actual cloud prices depend on service, region and date, so this booklet does not invent a universal monthly bill. Pick the least complicated design that meets the agreed need, and record when that need would justify a more expensive option.
A request-based error budget
STEP 1Eligible requests2,000,000
STEP 2Bad fraction1 - 0.995 = 0.005
STEP 3Allowed bad requests10,000
This budget counts requests. It does not directly specify outage minutes.
Key learning points
Write units beside users, actions, seconds, bytes and retention.
Calculate average demand separately from a declared peak assumption.
Split reads from writes and cheap requests from expensive operations.
Raw record bytes exclude indexes, replicas, backups and recovery margin.
Define good user events before setting an availability or latency target.
Compare the important ideas
Capacity performance and reliability targets: concepts and trade-offs
Quantity
Meaning
Example or equation
Latency
Time spent by one operation
200 milliseconds per request
Throughput
Completed work each second
100 requests per second
Concurrency
Work currently in progress
About rate x average time in a stable system
Average request rate
Daily operations spread across a day
Users x requests per user / 86,400
Request error budget
Allowed bad requests under a target
Eligible requests x (1 - target)
WORKED EXAMPLE
Estimate a campus application
Assume 100,000 daily users make 20 requests each. Demand is 2,000,000 requests/day, or about 23.1 requests/s average. A hypothetical 10x peak factor gives about 231 requests/s. If 10 percent create 1 KB records, raw data grows by 200 MB/day or 6 GB over 30 days using decimal units. Each assumption should be independently editable; none of these figures is a measured production result.
Further reading
Original teaching explanations by Buildfest Learn. Check these primary references for the underlying concepts and implementation details.
Change daily behavior and peak factor. Predict the average rate before reading the result.
12,000,000 requests/day
223.1 average/s
3231.5 modeled peak/s
Modeled peak demand: 231.5 requests/s
Daily users x requests per user / 86,400 gives the average. Multiply by an explicitly assumed peak factor. Measure real behavior before treating this as capacity evidence.
Chapter review: two questions
Attempt both questions before opening the model answers.
Question 1
Assume 250,000 daily users make 12 requests each, with a 12x peak factor. Find average and peak requests/s. One 2 KB write per user per day is retained for 30 days; estimate raw storage.
Reveal model answer
Three million daily requests / 86,400 is approximately 34.7 requests/s. The modeled peak is 416.7 requests/s. Writes add 500 MB/day and 15 GB over 30 days in decimal units, excluding indexes, replicas, backups and other overhead.
Question 2
A target requires 99.5 percent good requests among two million eligible requests. Calculate the request-based error budget. Explain why it cannot automatically be converted to outage minutes.
Reveal model answer
The allowed bad fraction is 0.005, giving 10,000 bad requests. A request-based budget weights time according to traffic. Converting it into outage minutes needs a time-based objective or explicit assumptions about traffic and the failure interval.
Answers stay in this tab. Download before leaving. This practice is not graded or saved to your account.