Search Autocomplete: The Name Everyone Types
Hard · system design problem
News breaks: searches triple, a third of them start with the same name, and the trending pipeline floods the index with updates. Suggestions must stay fast and fresh.
Every keystroke asks suggest-api for completions (50,000 requests/s). Popular prefixes are cached in Redis (4 nodes); misses query Elasticsearch, which also receives the trending pipeline: query logs → Kafka → indexer, one index request per term. At T+20s a story breaks: searches ×3 for the rest of the hour, and 60% of them are prefixes of one name. At T+50s the trending pipeline catches up with the surge: 6× more terms to index. New trending terms must show up in suggestions within two minutes.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.