ShopSearch is building a search service for a mid-size e-commerce platform with 5 million products. The search must support:
- Full-text search - search product titles, descriptions, and attributes. Handle typos ("blue jens" → "blue jeans") and synonyms ("couch" = "sofa").•Faceted filtering - after searching, users filter by brand, price range, color, size, rating, and availability. Facet counts update in real time as filters are applied.•Autocomplete - as-you-type suggestions showing matching products and categories in < 100 ms.•Relevance ranking - rank results by text relevance, sales volume, rating, and (optionally) paid boost from sellers.•Personalization - re-rank results based on the user's browsing/purchase history.•Search analytics - track popular queries, zero-result queries, and click-through rates to improve the search quality.
Handle 10,000 search queries per second at peak (Black Friday).
Design a product search engine with faceted filters, autocomplete, spell correction, and relevance ranking for 5 M products. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> Load Balancer -> API Gateway -> API Service -> Primary SQL DB -> Redis Cache -> Search Index