System Design: Category Browsing and Product Search for an E‑commerce Platform
Context
You are designing the category browsing and product search functionality for a large consumer e‑commerce platform with millions of SKUs, product variants (size/color), a hierarchical category taxonomy, and global traffic. The system must support fast, relevant search and browsing, and integrate cleanly with the order flow (product detail, cart, checkout) while honoring inventory, pricing, and promotions.
Assume read-heavy workloads (search/browse) and frequent catalog updates (price, stock, promotions). Latency targets for search/browse are sub-200 ms at p95.
Requirements
Design the following end-to-end:
-
Catalog structure
-
How to model products, variants, attributes, categories, and facets.
-
Multi-region availability, pricing, and promotions.
-
Indexing
-
Index schema, analyzers, and faceting support.
-
Incremental and full reindex strategies; handling high-churn fields (inventory, price).
-
Query processing
-
Tokenization, spell correction, synonym handling, filters/facets, and query understanding.
-
Autocomplete/typeahead.
-
Ranking
-
Relevance signals (text), business signals (popularity, margin, inventory), personalization, and diversity.
-
How to tune, evaluate, and A/B test.
-
Category browsing
-
Faceted navigation, sorting, pagination, and caching.
-
SEO considerations and URL design.
-
Integration with order flow
-
Product detail page data needs; add-to-cart and checkout validation for price/inventory/promotions.
-
Reservation policies and consistency guarantees.
-
APIs and architecture
-
Service boundaries, data stores, and key API endpoints.
-
Scale, availability, and data freshness targets.
State assumptions where needed and justify trade-offs.