71. Design a Search Engine like Elasticsearch
Search a billion documents in 200 ms: inverted indexes, analysers, Lucene segments, shards and replicas, query then fetch with BM25, fed by CDC.
Start with a template. Work through each step. Ask Coach when you need a second opinion.
Company tags are community-reported. Counts on cards show how many people reported that design.
Search a billion documents in 200 ms: inverted indexes, analysers, Lucene segments, shards and replicas, query then fetch with BM25, fed by CDC.
Radius, k-nearest and map-box search over places that rarely move and drivers that ping every few seconds: R-trees, geohash, H3 and S2 cells, Redis GEO and OpenSearch. One-hour boards for junior, senior and staff, with the theory.
Nearest-neighbour search over a billion embeddings: HNSW, IVF-PQ and disk graphs, filters, segments, sharding, and hybrid search with re-ranking.
Embed a billion chunks on GPUs, keep a k-NN index fresh through CDC with versioned writes and provable deletes, and migrate models blue-green.