Design a Marketplace Product Search Service
Design a large-marketplace search service that filters by price and taxonomy, serves stable ranked pages, and safely incorporates versioned catalog changes.
Problem statement
For this exercise, assume shoppers search a large product marketplace using optional query text plus price, category, and subcategory criteria and receive bounded pages of ranked product summaries.
A response uses a deterministic ranking version and product-ID tie break, and its opaque cursor is bound to the normalized query, filters, and one coherent search-index generation so ordinary updates do not repeat or skip results within that cursor contract.
An existing catalog authority publishes monotonic product, price, category, and subcategory versions to a derived search projection; delayed, duplicate, or reordered older updates must not regress searchable state. Search responses expose projection freshness rather than implying immediate visibility.
The report calls out large-marketplace scale but supplies no numeric catalog size, query rate, latency target, availability target, freshness bound, page size, or ranking formula, so state bounded assumptions and explain how they drive index partitioning, query fanout, caching, update capacity, and rebuilds.
Inventory reservation, checkout, payments, recommendations, reviews, advertising, seller catalog authoring, and the catalog authority's internal data model are outside scope.
What to build
- The search service can ingest monotonic product, price, category, and subcategory updates without an older delivery regressing projected state.
- A shopper can search products with optional query text and price, category, and subcategory criteria and receive matching summaries.
- The service can return bounded deterministic ranked pages with an opaque cursor tied to the normalized query and one coherent index generation.
- Readers and operators can inspect projection freshness, and operators can rebuild and promote an index generation without mixing partial state into a page.
At scale
- The source explicitly describes large-marketplace scale and price, category, and subcategory criteria but gives no numeric catalog size, query rate, latency, availability, freshness, or page-size target; state bounded assumptions before choosing the physical design.
- Traffic and catalog distribution may be skewed by popular queries, products, categories, and subcategories, so explain hot-partition and cache behavior under the candidate's chosen bounds.
- Catalog and price changes may be duplicated, delayed, or reordered, but a lower source version must never replace a higher searchable version and responses expose a freshness watermark.
- A complete index generation can be rebuilt and promoted without mixing it with an incomplete generation or silently invalidating the documented cursor contract.