Latency numbers every designer should know
Memory, disk, network and distance: the rough costs that decide where data should live.
12 min readOrders of magnitude, not exact values
Hardware changes, but the ratios between kinds of access stay remarkably stable. Reading memory is about a thousand times faster than a round trip inside a data centre, which is in turn hundreds of times faster than crossing an ocean. Knowing these rough numbers lets you predict whether a design will meet its latency goal before you build it.
- Read from main memory: about 100 nanoseconds
- Read 1 MB sequentially from memory: about 10 microseconds
- Random read from an SSD: about 100 microseconds
- Round trip within a data centre: about 0.5 milliseconds
- Read 1 MB sequentially from an SSD: about 1 millisecond
- Round trip across a continent: about 40 to 80 milliseconds
- Round trip between continents: about 150 milliseconds
What the numbers imply
An in-memory cache lookup is dominated by the network hop to reach it, about half a millisecond, while a database query that has to touch disk and run a plan often takes 5 to 20 ms. That is why caching typically makes reads around ten times faster. Distance dominates everything else: no amount of server optimisation saves a user in Sydney from a 150 ms round trip to a server in Virginia. The only fix is to move data or computation closer, which is what CDNs and regional deployments do.
Latency budgets
Start from the target and split it across the path. If a page must load its data in 200 ms at the 99th percentile, and 80 ms is spent on the network to the user, the backend has 120 ms. If it calls four services in sequence, each gets about 30 ms, which rules out anything slower than a cached read. Budgets turn a vague goal into concrete limits for each component, and they show early when a design needs parallel calls, precomputation or a cache to fit.
Tail latency matters
Averages hide pain. The p99 latency, the time within which 99% of requests finish, is what your heaviest users actually feel, because a single page load may trigger dozens of backend calls and only one of them needs to be slow. Tail latency comes from queueing on busy servers, garbage collection pauses, cache misses and retries. Running components below about 70% utilisation keeps queues short and the tail under control. The Feedback panel flags latency targets per test case, so check the slow path, not just the typical one.
Key takeaways
- Memory is nanoseconds, SSDs are microseconds, networks are milliseconds
- Distance cannot be optimised away; move data closer to users instead
- Split a latency target into a budget per component on the critical path
- Design for p99, not the average: queues and misses create the tail
Sign in to track lessons and earn badges.