Skip to content

Case study: Full-text search engine

Design a distributed full-text search engine: document-partitioned inverted indexes, two-phase scatter-gather, WAND early termination, and tail-latency defences across shards.

35 min9 steps

By the end you can
  • Estimate postings-list storage with delta compression and quantify fan-out tail latency across shards
  • Justify document partitioning over term partitioning for multi-word queries
  • Design a two-phase scatter-gather query pipeline with query caching and multi-stage ranking
  • Mitigate slow or unavailable index shards using caching, hedging, and partial-result soft timeouts

Pin down what you are building

Full-text search

  • Boolean/phrase queries; BM25 + PageRank + re-ranking; snippets; continuous indexing

20B documents

  • ~100k queries/s; p99 <200-250ms; production partial results

When a search coordinator scatters a query to 64 index shards in parallel and waits for all of them, what determines the query's response time?

Answer this step to continue.