System Design
20. System Design Case StudiesAnimated
Search Autocomplete System
Suggest completions as the user types.
The idea
A trie or prefix index returns top suggestions quickly, updated from query logs.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Each keystroke sends the prefix (debounced).
- step:
- 1/4
- at:
- Typing "sys"
1/10
The green dot is a request moving through the system.
Step by step
- 1User types a prefix
- 2The index finds matching completions
- 3Rank by popularity
- 4Return the top few within milliseconds
Where it is used
Search boxes.
Watch out for
Latency budget and offensive suggestions.