Flipkart Marketplace Platform  ·  View 17 of 25  ·  5 · Runtime

Discovery Pipeline

How 150M listings become a ranked page in under 300 ms, and how the ranking learns.

Editable source SVG draw.io All views
Change capture Catalog changes compacted topic Price and offer Availability delta Enrich Attribute normalise Flink Embed title and image Azure OpenAI Listing quality score Index Bulk indexer p95 lag 30 s Lexical + kNN index OpenSearch Alias swap zero downtime Serve Query understanding spell, intent Retrieve BM25 + vector Rank KServe · 40 ms Buy Box choose price, SLA, rating Learn Clicks and buys Feature store Feast Train and register MLflow Canary and rollback 1% traffic promote model search Discovery Pipeline — Index, Retrieve, Rank, Learn Queue / topic Application we own Data store Security / platform Decision point batch synchronous Search never reads the catalog database. If the pipeline stops, the index serves stale-but-correct results and the availability filter is applied at query time from Redis. v 1.0 · owner Discovery Engineering · date 2026-09

Decisions

  • Search never queries the catalog database; it reads an index built from the change log, so a catalog outage does not stop browsing
  • Hybrid retrieval — BM25 plus vector kNN in one OpenSearch cluster — avoids running a second vector database for the same corpus
  • Availability is applied as a query-time filter from Redis rather than baked into the index, because stock changes far faster than the index can be rebuilt

Numbers

  • Index freshness p95 30 seconds from catalog change to searchable
  • Ranking model budget 40 ms at p99; anything slower is not deployed
  • Zero-downtime index swaps by alias, so a bad rebuild is a pointer change to undo

Risks

  • Embedding cost scales with catalog churn, not catalog size — a bulk feed re-upload is the expensive event
  • Ranking and Buy Box selection interact: a model that favours cheap listings can starve reliable sellers, so seller SLA is a ranking feature
  • Canary at 1% catches latency regressions but not slow relevance decay; a weekly human relevance review is part of the design