26 shards, one per letter. Launch night melts one.
transcript
Your typeahead index won't fit on one machine. So you split it. One shard per first letter. Tidy. Easy to explain. Until launch night.
A new phone launches. Everyone types i, p, h. Every one of those requests lands on shard i. Shards a to z can't help. They don't hold the letter i. And even on a normal day, letters aren't uniform.
Some shards always carry several times the average. And one launch puts it all on one. Each request needs exactly one key. So hash the whole prefix. Now a hot prefix is one hot key. The CDN can carry it.
Here's the twist. Size it before you split it. The whole index is about 11 gigabytes. After debounce and the CDN, about 4,400 requests a second reach it. And one replica, on 16 cores, handles about 20,000.
It fits in one machine's memory. So don't shard. Give every replica a full copy. Run three per region.
Full breakdown in the lecture.