Numbers to Know
The rounded latency, size, capacity and availability figures worth knowing for system design interviews, and how to use them to check a design.
On this page
This page is a short reference of rounded figures for latency, data size, server capacity, time conversions and availability. Interviewers expect you to use them to check whether a design is feasible, for example whether a request fits its latency budget, whether the data fits on one machine, or how much downtime a target allows. You do not need to know exact values. You need figures that are right within a factor of about three, and you should say that they are assumptions, because real values depend on hardware, distance and load.
Without these numbers, a design can look correct on the whiteboard and still be unusable. A page that calls three services in another region one after another spends more than 300 ms waiting before it does any work of its own, and nothing in the diagram shows it. Knowing the figures lets you catch that while you are still drawing.
Where the numbers apply
Latency
A read from main memory takes about 100 ns, a random read from an SSD about 100 µs, and a spinning disk needs about 10 ms for a seek. A round trip between two machines in one data center takes about 0.5 ms, and a round trip between zones in one region takes about 1 ms. A database read by index, including the network, takes 1 to 10 ms. A round trip between regions or continents takes 50 to 150 ms, and 100 ms is a good value to use. A request from a user's device to a server in the same country usually takes 20 to 50 ms, and a new HTTPS connection adds a few more round trips before the first byte of the response.
| Operation | About |
|---|---|
| Read from main memory | 100 ns |
| Random read from an SSD | 100 µs (0.1 ms) |
| Round trip within one data center | 0.5 ms |
| Round trip between zones in one region | 1 ms |
| Indexed database read, including the network | 1 to 10 ms |
| Disk seek on a spinning drive | 10 ms |
| Round trip between regions or continents | 50 to 150 ms |
The ratios matter more than the values. A call within the same region costs thousands of memory reads, and a cross-region call costs about two hundred same-region calls. This is why a cache in memory is worth adding, and why a call to another region should stay off the path of a user's request.
Where a request should read its data
The latency figures decide where data should live. There are four common places, and each has a different cost.
The app server's own memory
A lookup costs about 100 ns, so it is effectively free. Each server holds its own copy, so an update reaches the servers slowly and unevenly, and the data is limited to what one server's memory can hold. Use it for small data that rarely changes, such as configuration, or for a few very hot keys that can be cached for a few seconds.
A shared cache in the same region
A read costs one round trip in the data center, about 0.5 ms, and all app servers share one copy. The costs are one more component that can fail and entries that can be out of date. This is the usual choice for hot data that many servers read.
The database in the same region
A read costs 1 to 10 ms. The database is the source of truth, so use it for anything that must be current and for every cache miss. Its reads are also the most expensive to scale, which is why the cache sits in front of it.
A service or database in another region
Each call costs about 100 ms and fails if the link between regions is slow or down. Keep these calls off the request path and use them for background work such as replication. If a request needs the data, copy it into the local region and accept that updates arrive a little late.
| Option | Good at | Bad at | Pick it when |
|---|---|---|---|
| App server memory | About 100 ns per lookup, with no network call. | Each server has its own copy, and memory is limited to one machine. | Small, rarely changing data, or a few hot keys for a few seconds. |
| Shared cache, same region Usual default | About 0.5 ms, with one copy shared by all servers. | It is another component to run, and entries can be stale. | Hot reads that many servers share. |
| Database, same region | It holds the current data and answers in 1 to 10 ms. | Its reads are the most expensive to scale. | Data that must be current, and every cache miss. |
| Another region | There is one copy for the whole world. | Each call costs about 100 ms and fails when the link does. | Background work only, such as replication. |
Sizes and throughput
An ASCII character takes 1 byte, an integer or a timestamp 8 bytes, and a UUID 16 bytes. A row of metadata is usually between 100 bytes and 1 KB, and a photo is a few hundred KB to a few MB. In powers of two, 210 is about a thousand, 220 about a million and 230 about a billion. A 32-bit ID runs out at about 4.3 billion, so use 64-bit IDs for any table that might pass a few billion rows.
Memory reads at about 10 GB/s, an SSD at about 1 GB/s, and a 10 Gbit/s network link carries about 1.25 GB/s, because a byte is 8 bits. These numbers tell you how long it takes to rebuild a replica, restore a backup or move data between shards.
Time and server capacity
A day has 86,400 seconds, which you can round to 100,000 for quick arithmetic. A month has about 2.6 million seconds and a year about 31.5 million. One million events a day is therefore about 12 a second, and you can call it 10 as long as you say that you rounded. Peak traffic is commonly 2 to 3 times the average.
The capacity of one server depends on its hardware and on what each request does, so use these as orders of magnitude:
- A stateless API server handles about 1,000 requests a second for typical work.
- A relational database primary handles a few thousand writes a second, and reads by index can reach tens of thousands a second.
- An in-memory cache node handles about 100,000 simple reads a second.
- One server can hold tens of thousands of open WebSocket connections, and up to about 100,000 when most of them are idle.
- One large machine has hundreds of GB of memory and a few TB of SSD. If your data fits on one machine, say so, because one machine is the simplest design.
Availability
An availability target translates directly into the downtime it allows. The values below are for a 30-day month and a year.
| Target | Down per month | Down per year |
|---|---|---|
| 99% | 7.2 hours | 3.7 days |
| 99.9% | 43 minutes | 8.8 hours |
| 99.99% | 4.3 minutes | 53 minutes |
| 99.999% | 26 seconds | 5.3 minutes |
When a request needs several components and every one of them must work, you multiply their availabilities. Three services at 99.9% each give 0.9993, which is about 99.7%, or roughly 2 hours of downtime a month. When redundant copies are used and any one of them is enough, you multiply their failure probabilities instead. Two copies at 99% each give 1 − 0.012 = 99.99%, but only if the copies fail independently. More on this is in Reliability and Failure.
Problems interviewers probe
Calls that add up and calls that overlap
Sequential calls add their latencies, and independent calls made at the same time cost only as much as the slowest one. Three independent 100 ms calls made in parallel take about 100 ms, but made one after another they take about 300 ms. Before you add up latencies, say which calls depend on each other.
Presenting numbers as exact
Saying that an SSD read takes 87 µs invites an argument about hardware that you cannot win and that does not matter. Say "about 0.1 ms". The order of magnitude is what decides the design, and an interviewer who disagrees by a factor of two will not change your conclusion.
Time to rebuild a failed node
If a database node with 1 TB of data fails and its replacement is copied over a fully used 10 Gbit/s link, the copy takes about 800 seconds, which is roughly 13 minutes. In practice it takes longer, because the source node is still serving traffic. For that whole time the partition has one copy fewer, and this is the reason to keep three copies instead of two.
In the interview
Bring in a number when a decision depends on speed, size or uptime, and finish the sentence with what it means for the design. For example: "A cross-region call is about 100 ms, so it cannot be on the checkout path." Or: "50 million sessions at 1 KB each is 50 GB, so they fit on one cache node plus a replica."
Questions to expect:
- "Is one server enough?" Convert the traffic to requests a second, apply a peak factor of 2 to 3, and compare it with about 1,000 requests a second per API server. Then check the data against one machine's memory and disk. Even when one server is enough for the load, say that you would run at least two so that a single failure does not cause an outage.
- "How many requests a second do 10 million daily users make?" State how many requests a user makes a day, for example 20, which gives 200 million a day. Divide by about 100,000 seconds to get about 2,000 a second on average, and multiply by 2 or 3 for the peak. Say clearly that each of these inputs is an assumption.
- "Why is a cross-region call so slow?" The delay comes from physical distance, and routing and equipment add to it, so a round trip between regions takes 50 to 150 ms and about 100 ms is a safe planning value. No software change can remove it, so the design must keep the call off the user's request path or copy the data into the local region.
- "What does 99.99% availability mean?" It allows about 4 minutes of downtime a month and about 53 minutes a year. Every dependency on the request path counts, so you would need automatic failover, redundancy in more than one zone, and no single component that all requests depend on.
- "When does the data stop fitting on one machine?" One machine can hold hundreds of GB in memory and a few TB on SSD. Multiply the row count by the row size, and if the result is below that, a single machine can store it. You would still add replicas for availability, and you would shard only when the data or the write rate outgrows one primary.
- "How long would it take to move or rebuild this data?" Divide the data size by the link speed. A 10 Gbit/s link moves about 1.25 GB/s, so 1 TB takes about 13 minutes at best. Mention that the real time is longer and that the data is less protected while the copy runs.
The checkout page must respond in 200 ms. Your design calls a tax service that runs in another region. Is that a problem?
Yes. A cross-region round trip is about 100 ms, so that one call uses half the budget, and it grows if the call is retried or the link is slow. I would copy the tax tables into the local region and read them from there, which costs about 1 ms.
What do you give up by copying them?
The local copy can be a little out of date after a tax change. That is acceptable here because tax rules change rarely, and I would refresh the copy in the background and add a time limit on how old it may be.
And the other calls on that page?
The cart read is a database call of about 5 ms, and the stock and fraud checks do not depend on each other, so I would run them in parallel. That way they cost as much as the slower of the two instead of the sum.
A page makes 4 sequential calls to a service in another region. About how long does it wait?
Product data is read on every request by 50 app servers and changes a few times a day. Where should it be read from?
A request needs three services in a row, and each has 99.9% availability. About what availability does the request get?
What to practise next
Use these numbers in Back-of-the-Envelope Estimation and Mock Interview Practice, or see latency drive a design in Design Typeahead Search.