Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/Trade-offs & Bottlenecks
RELIABILITY, SECURITY & CASE STUDIES · SUBTOPIC

Latency vs. Throughput & Tail Latency (p99)

Understand why optimizing throughput (batching) often increases single-request latency.

IntermediatePart of Trade-offs & Bottlenecks
Practice in AI HLD
Subtopics in Trade-offs & Bottlenecks (2)
OverviewLatency & p99Read/Write Amplification

In plain words

A bus carries way more passengers per hour (throughput) than a sports car, even though the sports car gets one person there faster (latency).

Think of it like…

Sports car (low latency) vs. bullet train / bus (high throughput).

Loading interactive diagram
Loading interactive exercise

Theory & how it works

Taming tail latency with Hedged Requests

If a read typically finishes in 5 ms (p50) but occasionally stalls at 200 ms (p99), sending a duplicate hedged request to another replica only after 10 ms passes cuts tail latency dramatically with <5% extra traffic.

Key points & practical guide

Summary checklist

  • Batching increases throughput while adding slight latency
  • Measure p95/p99, never just mean latency
  • Parallelize fan-out calls and cap with timeouts/hedging

When to use it

  • Performance tuning and SLA design

Watch out for

  • Quoting "average latency is 15 ms" when 1 in 20 users waits 3 seconds

Quick check

Loading quiz
Parent topic
Trade-offs & Bottlenecks
Next subtopic
Read vs. Write Amplification