Skip to content
StackDecode
System Design
20. System Design Case StudiesAnimated

Large-Scale Vector Search Engine

Similarity search over billions of vectors.

The idea

Sharded ANN indexes, replicas and a merge step return the nearest neighbours.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Query vectorRouterShard 1 (HNSW)Shard 2 (HNSW)Shard 3 (HNSW)Merge top-k
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Billions of vectors are partitioned across shards.

step:
1/4
at:
Query vector
1/8

The green dot is a request moving through the system.

Step by step

  1. 1Embed the query
  2. 2Fan out to shards
  3. 3Each searches its ANN index
  4. 4Merge the top results

Where it is used

Semantic search and recommendations.

Watch out for

Memory cost and index updates.

Related