1. Latency
- Definition: The time it takes for one request to travel through a system and get a response.
- Measured in milliseconds (ms) or seconds.
- Itβs about speed per request.
π Example:
- You click a link β page loads in 120 ms β thatβs the latency.
- In F1 telemetry, latency = how quickly sensor data reaches the pit crew.
2. Throughput
- Definition: The amount of work done (requests/data processed) per unit of time.
- Measured in requests per second (RPS), transactions/sec, or MB/sec.
- Itβs about capacity.
π Example:
- A web server handles 10,000 requests per second β thatβs its throughput.
- In F1 telemetry, throughput = how many data points per second can be handled from all cars.
3. Latency vs Throughput β Analogy
Imagine a highway π£οΈ:
- Latency = how fast one car goes from point A β point B.
- Throughput = how many cars in total can pass per minute.
π Low latency = one car reaches fast. π High throughput = many cars move through at the same time.
4. Trade-offs in System Design
- Sometimes reducing latency reduces throughput, or vice versa.
-
Example:
- Database in batch mode β high throughput (process thousands of rows at once), but higher latency (results after a delay).
- Database in real-time mode β low latency (instant results), but lower throughput (one request at a time).
5. Summary Table
| Feature | Latency | Throughput |
|---|---|---|
| Meaning | Time per request (speed) | Requests processed per second (capacity) |
| Unit | ms, sec | req/sec, MB/sec, tx/sec |
| Focus | How fast? | How many? |
| Analogy | Speed of one car | Number of cars per minute |
| Ex: In F1 Racing | Time for one telemetry update | Total data points per second |
β In short:
- Latency = delay per request (speed).
- Throughput = total volume of requests processed (capacity).