← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 020 · Caching

Design a Product Catalog

Easy 30 min

Design the product catalogue for an online store with 2 million products. Shoppers view product pages with a title, description, price, stock status and several images. Pages are read about 15,000 times per second at peak, while merchants edit around 50 products per second. When a price changes, shoppers should see the new price within a minute. During sales events traffic doubles and almost all of it lands on a few thousand products.

Functional requirements

  • View a product page with details, price and images
  • List products in a category with paging
  • Merchants create and edit products and upload images
  • Price and stock changes appear on product pages within 60 seconds

Non-functional requirements

  • Product pages load in under 250 ms at p95
  • The catalogue stays readable if the database is briefly unavailable
  • Images load quickly worldwide

Constraints and scale

  • 2 million products, 5 images each
  • 15,000 page reads per second at peak, 50 edits per second
  • Sales events double traffic, concentrated on popular products

You will practise

  • Apply the cache-aside pattern to a read-heavy workload
  • Invalidate or expire cached entries when data changes
  • Offload static media to object storage and a CDN
Show 2 hints
  1. With 300 reads for every write, where should most reads be answered?
  2. When a merchant edits a price, which cache entries become wrong?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A wrong price stays cachedA merchant fixes a price typo (£9.99 listed as £0.99), but shoppers still see the old price ten minutes later and keep ordering.

Run them from the workspace once your design is in place.