LESSON 02 · Workload estimate

Count requests, not just searches

One typing session can generate many reads, while completed searches become ranking signals.

SYSTEM VIEW

The suggestion path

Diagram view
Origin reads—
Searches—
Peak egress—

Follow two million people’s typing into reads per second, then see which of those requests count as searches.

  1. Two million active people make six searches a day each, and after debouncing the client sends four suggestion requests per search. That is 48 million reads a day, about 556 a second on average, all arriving at the Query API.

    People
    2 million
    Searches
    6 a day each
    Reads per search
    4

    What changed

    • 48 million reads a day
    • About 556/s on average
  2. Traffic isn’t spread evenly over the day. A tenfold busy-hour multiplier gives about 5,600 reads a second, and capacity has to meet the peak. These are illustrative assumptions: check real keystroke patterns, cache hits and regional peaks before sizing.

    Busy hour
    ×10
    Peak
    about 5,600/s

    What changed

    • 556/s → about 5,600/s at peak
  3. Each response carries five suggestions in about 300 bytes. At the peak, egress is 5,600 × 300 bytes, about 1.7 MB a second, so bandwidth won’t decide this design. Latency and hot prefixes will.

    Response
    300 bytes
    Peak egress
    1.7 MB/s

    What changed

    • 1.7 MB/s out at peak
    • Latency and hot prefixes decide
  4. If a CDN edge or the browser cache answers half the reads, the origin peak at the Query API falls to about 2,800 a second. If only a few reads a second were expected, a database index on one server might be all you need.

    Answered at edge
    half the reads
    Origin peak
    about 2,800/s

    What changed

    • CDN edge
    • Origin: 5,600/s → 2,800/s
  5. A person typing “camera” may request “ca”, “cam” and “came” before submitting “camera”: three reads on the read path, but one search. The Collector records only the submitted search. Counting each prefix request as a search would fill popularity with partial words.

    Prefix reads
    3
    Search events
    1

    What changed

    • Collector
    • 3 reads: “ca”, “cam”, “came”
    • 1 search: “camera”
  6. Users submit 12 million searches a day, about 139 a second on average: 1.2 GB of logs a day at 100 bytes each. With consent and retention rules they feed popularity counts. The Event stream keeps collection and index building apart from the read-heavy path.

    Searches
    12 million a day
    Logs
    1.2 GB a day

    What changed

    • Event stream
    • About 139 searches/s on average
    • Reads and searches kept apart

Space plays · ← → step · Home resets

THE IDEA

How it works

Suppose two million active people make six searches a day and the client sends four suggestion requests per search after debouncing. That is 48 million suggestion reads a day, about 556 queries per second (QPS) on average. A tenfold busy-hour multiplier suggests about 5,600 QPS. These are illustrative assumptions; check real keystroke patterns, cache hits, and regional peaks before sizing.

Follow the estimate through to see what it decides. If a response with five suggestions is about 300 bytes, peak egress is 5,600 × 300 bytes, about 1.7 MB per second, so bandwidth is not the constraint. Latency and hot prefixes are. If a CDN or browser cache answers half the reads, the origin peak falls to about 2,800 QPS. If only a few reads per second are expected, a database index on one server may be all you need.

Do not count each prefix request as a completed search. A person typing “camera” may request “ca,” “cam,” and “came” before submitting “camera.” Those are three reads but one search. The same example produces 12 million completed searches a day, about 139 per second. With consent and retention rules, those can feed popularity counts. At 100 bytes each, they add 1.2 GB of logs daily. Keep the read-heavy serving path separate from collection and periodic index building; a log such as Kafka is a common boundary between the two.

DECISION POINT

An estimate says 12 million searches per day means 12 million autocomplete requests. What is missing?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Estimate suggestion reads from typing behavior and peaks.
  • Intermediate prefixes and completed searches are different events.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
ApplyQUESTION 01

Three million users make four searches a day, each causing five suggestion reads. What is the average read rate?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 3 checkpoints answered correctly to complete this lesson.