Instacart's search infrastructure evolved through four architectural stages to handle billions of products and billions of daily writes. Starting with Elasticsearch, the team discovered its denormalized document model caused catastrophic indexing overhead under heavy write loads, so they migrated to Postgres with GIN indexes, reducing write workload by 10x. To handle semantic search, they added a parallel FAISS service in 2021, but maintaining two systems created operational overhead and limited pre-filtering capabilities. Eventually they consolidated onto pgvector inside Postgres, enabling pre-ANN inventory filtering, cutting zero-result searches by 6%, and roughly halving search latency by eliminating multiple network round trips and application-layer joins. The key architectural lesson: bring compute to the data for latency-sensitive workloads, and measure the true cost of keeping multiple systems in sync.

12m read timeFrom blog.bytebytego.com
Post cover image
Table of contents
New Year, New Metrics: Evaluating AI Search in the Agentic Era (Sponsored)The Shape of Search at InstacartAgentic Fine-Tuning and Inference with Pioneer (Sponsored)Leaving Elasticsearch BehindSemantic Search and the Two-System ProblemPutting It All Back Together with pgvectorBring the Compute to the DataThe Limits of This ApproachConclusion

Sort: