← Back to the map

Unit 0 · Lesson 4

Latency numbers every engineer should know

Reading a value from memory takes about 100 nanoseconds. Sending a request across the ocean takes about 150 milliseconds. That's over a million times longer. Your design has to know the difference.

By the end you can

Watch

Prefer reading? The same lesson is written out below.

You don't need exact numbers. You need the order of magnitude, because the gaps between them are huge, and those gaps explain most design decisions.

×1,000×5×20×15RAM 100 nsSSD 100 µsSame DC 0.5 msDisk seek 10 msAbroad 150 ms
Rough latencies, each step much slower than the last: memory about 100 nanoseconds, SSD read about 100 microseconds, a round trip inside a data centre about 0.5 milliseconds, a spinning-disk seek about 10 milliseconds, a round trip to another continent about 150 milliseconds.
OperationRoughly
Read from memory (RAM)100 ns
Random read from an SSD100 µs (1,000× slower than RAM; fast NVMe drives manage 10–20 µs)
Round trip inside one data centre0.5 ms
Seek on a spinning hard disk10 ms
Round trip to another continent150 ms

Units, for reference: 1 ms = 1,000 µs = 1,000,000 ns.

A human-sized way to feel it: if a memory read took one second, an SSD read would take about 17 minutes, and a round trip across the ocean would take about seventeen days.

What the gaps tell you

Key idea: RAM ≈ 100 ns, SSD ≈ 100 µs, same data centre ≈ 0.5 ms, cross-ocean ≈ 150 ms. Keep hot data in memory, keep data close to users, and avoid long chains of network calls.

Check yourself

Order these from fastest to slowest.

  1. 1Round trip to another continent
  2. 2Round trip within one data centre
  3. 3Random read from an SSD
  4. 4Read a value from RAM

Your new flashcards

Practice them now. With a free account they come back in your daily review.

Card 1 of 3