liveBook · Manning

Mean

As explained in The Coder Cafe

Latency is the time delay between initiating a request and receiving its response, often expressed as an upper bound for responsiveness.

Latency is the delay between making a request and receiving a response. For an online service, it affects whether a response arrives soon enough to be useful. A system that answers after thirty minutes may be available under a definition that requires only a non-error response, but it will feel unavailable to its users. section 6.12 section 6.2

In distributed systems, latency is also a design trade-off. PACELC asks what to prioritize when there is no network partition: low latency or consistency. Here, latency can be expressed as an upper bound for a non-error response, such as 500 ms. This adds a responsiveness question that CAP does not explicitly address. section 6.3 section 6.10.1

Small delays add up

Users can notice differences measured in milliseconds. Reported examples include a 1% drop in Amazon sales after a 100 ms increase in website load time and a 20% drop in Google search traffic after a 500 ms increase in result time. The practical question is not just whether a request succeeds, but how long users will wait. section 6.12.1

Three approaches address latency from the user’s perspective:

  • Make responses faster by optimizing a critical code path, adding caching, improving database speed, or using a CDN. section 6.12.2
  • Anticipate requests by preloading content. Netflix, for example, preloads part of a video while someone browses, reducing the delay they perceive when playback starts. section 6.12.2
  • Make a wait feel shorter when the work cannot be accelerated. A progress bar may change the experience of waiting, but it does not make the underlying task finish sooner. section 6.12.2

How The Coder Cafe covers it

How deep it goes
Defines request-to-response delay and a response-time upper bound, then outlines mitigation strategies without detailing their implementations.
Examples
Uses reported website and search delays, video preloading, and progress bars to illustrate actual and perceived waiting time.
What it assumes
Builds on request-response communication and CAP’s availability definition while defining latency explicitly.
What you can do after
Evaluate/understand it as a responsiveness requirement and choose among faster responses, anticipation, and perceived-speed techniques.
How it connects
Connects latency to availability, CAP, PACELC, consistency, caching, and perceived latency.

Also explained in

Compare how 35 books explain mean →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Coder Cafe. The section links point to the parts of the book it draws on.