Skip to content
SD-8 · TYPEAHEAD AUTOCOMPLETE · INTERACTIVE

Break it.
Then fix it.

Turn up the typing, watch what melts, and add the parts a real autocomplete needs. Every switch is a decision you would defend in an interview.

CHALLENGEAnswer 600K keystrokes/s with p99 under 100 ms, no errors, and fresh trends.
StatusDOWNAt 600K keystrokes/s
p99 latency202 msTarget under 100 ms
Errors93.7%Suggestions dropped
New trends show inat onceCounts change on every search
TypistsLIVE
600K keystrokes/s · 50K searches/s
300K requests/s sent
Load balancerOK
Spreads over replicas
spreading 300K/s
Suggest servers × 16DOWN
Trie updated on every search
300K / 320K req/s
Count storeDOWN
Count += 1 per search
No prefix reads · 50K searches/s
Every replica takes every write. Each search updates the top-10 lists of all 12 of its prefixes, on every copy of the trie, and bumps a counter row. More replicas add reads, not write capacity. Log searches instead, count them in a batch job, and swap in a fresh trie snapshot.
12Keystrokes per searchEach one asks for suggestions, so reads outnumber searches 6 to 1 even after debouncing.
6 GBTrie per locale10M queries with a top 10 at every prefix fit in one server’s memory.
60%Answered at the edgeShort prefixes are the same for everyone, so the CDN can cache them.
5 minTrend delayA stream counts the last 15 minutes; the nightly trie does the rest.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.