What is the difference between latency and throughput?
Latency and throughput are the two primary axes of performance, and they measure fundamentally different things.
**Latency** is the time elapsed between a request being sent and its response being received — the 'delay' experienced by a single operation. It is typically measured in milliseconds (or microseconds for high-performance systems) and reported at percentiles: p50 (median), p95, p99, p99.9. The tail latency (p99, p99.9) is often more operationally important than the median because it represents the worst-case experience for a real fraction of users. A system can have a p50 latency of 10ms and a p99 latency of 2 seconds, masking severe tail behavior.
**Throughput** is the amount of work a system can complete in a unit of time — typically measured in requests per second (RPS), transactions per second (TPS), or data transfer rate (MB/s). Throughput describes the system's capacity ceiling and is the primary metric for batch processing, data pipelines, and high-volume APIs.
The relationship between latency and throughput is described by **Little's Law**: `L = λW`, where L is the average number of requests in the system, λ is the arrival rate (throughput), and W is the average time in system (latency). As throughput approaches a system's capacity, queuing delays increase latency sharply — this is the fundamental trade-off. At low load, latency is dominated by processing time. At high load, it is dominated by queue wait time.
In practice, they often trade off: batching operations improves throughput by amortizing per-request overhead but increases latency for individual requests. Conversely, parallelism can reduce latency for individual complex queries but may reduce overall throughput by increasing resource contention.
Optimization strategies differ: improving latency requires reducing coordination overhead, co-locating data with computation, and minimizing lock contention. Improving throughput requires maximizing parallelism, minimizing I/O stalls, and efficient use of CPU pipelines and memory bandwidth.
Good system design establishes separate SLOs for latency (p99 < 200ms) and throughput (system handles 10,000 RPS) — they require different optimization approaches and measurement strategies.
Correctly defines both terms with appropriate units and recognizes that they can trade off. May not mention percentile latency, Little's Law, or practical optimization strategies.
Explains tail latency and why p99 matters over p50, invokes Little's Law to describe the relationship under load, discusses the batching trade-off, and gives concrete optimization strategies for each metric separately.
Reading the answer is step one. Explaining it unprompted — under interview pressure — is what actually matters. Get AI-graded feedback on your answer with follow-up probes on your weak points.
Get Graded — Free Assessment