All Questions
Vector Search hard

A multi-tenant SaaS stores 2B vectors for 20K tenants, and every query is scoped to one tenant. One tenant holds 40% of the vectors and sends bursty traffic; the rest are small. Vectors are hash-sharded by document ID across 32 shards, so every query fans out to all shards with a tenant filter. Small tenants see latency spikes during the large tenant's bursts. Which sharding change fits best?

  1. A Keep hash sharding; it spreads every tenant evenly, so the large tenant's bursts are already diluted across the cluster.
  2. B Add read replicas of every hash shard so the bursty tenant's QPS spreads out, leaving the shard key unchanged.
  3. C Hash on tenant ID so each tenant maps to exactly one shard, isolating tenants and limiting every query to one shard.
  4. D Shard by tenant, packing small tenants together and giving the large tenant its own dedicated set of shards.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions