Suggestions in under 100 ms: a trie built offline, served from memory, with trending terms on top.
What is on this board
Parts
- Search box Web app
- Popular prefixes CDN
- Suggest Service
- Top 10 per prefix Cache · Redis
- What people search Event stream · Kafka
- Rebuild weekly Batch job · Spark
- Trending now Stream processor
- Search history Data lake
- Banned terms Rules engine
How they connect
- Search box → Popular prefixes: te
- Popular prefixes → Suggest: on a miss
- Suggest → Top 10 per prefix: top for te
- Search box → What people search: searched
- What people search → Search history: archive
- Search history → Rebuild weekly: input
- Rebuild weekly → Banned terms: filter
- Rebuild weekly → Top 10 per prefix: new index
- What people search → Trending now: last hour
- Trending now → Top 10 per prefix: boost
Notes and decisions
- Search box: Waits 150 ms between keystrokes
- Suggest: Under 100 ms
More like this
News feed, like TwitterFan-out on write or on read? Timelines in a cache, the celebrity problem, and how a post reaches millions of followers.
News feed, like TwitterFan-out on write or on read? Timelines in a cache, the celebrity problem, and how a post reaches millions of followers.
URL shortener, like BitlyThe first system design interview question: key generation, heavy reads, a cache in front, and click analytics off the request path.