System Design: Category Page with Facets, Sorting, Pagination, SEO, Caching, Personalization, and Real-Time Updates
Design the backend and serving architecture for an e-commerce category page (e.g., /electronics/phones) that supports:
Functional Requirements
-
Faceted filtering: brand, price, rating (extensible to others like attributes, availability)
-
Sorting: relevance, price (asc/desc), popularity
-
Pagination and infinite scroll (cursor-based preferred)
-
SEO-friendly rendering (SSR/SSG, crawlability, canonical URLs)
-
Optional personalization of ranking
-
Near-real-time inventory and price updates
Non-Functional Constraints
-
Scale: 10^6+ SKUs, 10^4 QPS on category endpoints
-
High-traffic categories should benefit from aggressive caching (CDN/edge/app)
-
Specify consistency vs freshness strategy
-
Specify APIs, data models, indexing/search strategy, ranking signals
-
Specify cache hierarchy and keys, read/write patterns
-
Approaches for A/B testing, metrics, and monitoring
-
Discuss key trade-offs and likely bottlenecks