System Design
Product Catalog
Design the product catalog service for a retailer like Walmart or a Shopify store.
Functional requirements
- Shoppers can view a product page with title, description, attributes, images, and variants (e.g., a shirt in 5 sizes and 3 colors), each variant with its own price, SKU, and in-stock flag.
- Shoppers can browse a category page (e.g., Electronics > Headphones) listing its products with thumbnail, name, and starting price, 48 per page, newest first.
- Merchants can create and edit a product, its variants, and its category placement one at a time through an admin API.
- Merchants can push a bulk feed (e.g., a file changing prices on 1M SKUs before a sale) and see the job's progress and completion.
- Internal services such as cart and checkout can fetch current price and availability for up to 200 variants in one call.
Non-functional requirements
- Product and category reads are the critical path: p99 under 100ms for a product page and 150ms for a category page at the API, excluding image bytes.
- Availability over consistency for reads: a shopper may see an old price or description for up to 60 seconds after an edit, but a variant's fields always come from one version and a never-published value is never shown.
- Every edit, single or bulk, is visible on the storefront within 60 seconds of being applied; a bulk job reports progress so the merchant knows when sale prices are live.
- The catalog is the system of record: an acknowledged edit is never lost, and a bulk job that fails partway is resumed or reported, never silently half-done.
- Merchants can modify only their own products; the storefront read API is public and must keep shopper latency intact while scrapers pull whole categories.
Scaling & constraints
- 300M products across 2M merchants, 3 variants each on average; a product record with variants and attributes is about 4KB, up to 100KB with hundreds of variants.
- Reads peak at 500,000 product lookups per second during sales (one category page fetches 48 products) and average 100,000 per second; read:write ratio is over 1,000:1.
- 1% of products draw 80% of product-page reads; the top 1,000 categories draw 90% of category-page reads.
- Merchants make 5M single edits per day; bulk feeds are files of up to 1M rows, and 200 can land in the hour before a major sale.
- Price and in-stock changes dominate: about 2,000 variant updates per second on average and 10,000 per second during flash sales, pushed by the pricing and inventory systems.
- Each product has 6 images averaging 200KB in object storage; the category tree has 50,000 nodes up to 6 deep, and a large category (e.g., Women's Shoes) has 5M products.
Out of scope
- Full-text search, ranking, and search autocomplete.
- Image upload, resizing, and transcoding (the catalog stores image URLs).
- Inventory counting and reservation (the inventory system pushes an in-stock flag to the catalog).
- Merchant authentication, billing, and the admin UI.
Sign in to save your progress
AI design evaluation
Get a score, what your board does well, what to fix first, and what an interviewer would ask next.
Sign in to get AI feedback on your design.