Walk through sharding a vector database from 50 million toward 500 million vectors
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Your single-node vector database is at 50 million vectors with degrading p99 latency, and the roadmap points at 500 million. Walk through how you would shard it: the partitioning choice, how queries execute across shards, and what gets worse the moment you go distributed.
Shard by tenant if queries are scoped, hash and scatter-gather if global. Tail latency, per-shard ANN tuning, rebalancing, and hybrid score fusion all get worse the moment you go distributed.
Imagine a library that outgrew one building. You can split it two ways. Option one: give each company its own building. Most visitors only need their company's books, so they go to one building and life is fast. Option two: spread all books across many buildings randomly. Now every visitor sends helpers to all buildings, each helper grabs the best matches, and they meet at the door to pick the overall best. This is slower because the slowest helper sets the pace. The trick is choosing which split matches how people actually search, and then accepting that p99 latency, recall tuning, and rebalancing all get harder no matter which choice you make.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
8 min: memory math forces the move, choose partitioning from the query shape, plan for slowest-shard tail latency, tune per-shard ANN and k, plan rebalancing and reindexing from day one.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Hash-sharding when queries are tenant-scoped, which forces scatter-gather across every shard for what could have been a one-shard lookup, paying tail latency for no benefit.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.