Design an Amazon-Like Online Store

Hard45 min
1 / 30
understanding•10 min read

Problem Statement: A Read-Heavy Commerce Machine With Write-Critical Money Paths

Frames the online store as five cooperating planes with radically different consistency and latency needs.

Problem statement

Design a global e-commerce platform in the style of Amazon: an effectively unlimited product catalog with images, descriptions and SKUs; search and filtering by category, brand and price; user accounts, wishlists and recommendations; shopping carts with a secure checkout flow; and order placement with tracking and email confirmations. The system must survive millions of daily visitors, flash-sale spikes of tens of times baseline, and seasonal surges such as Prime Day or Black Friday, while keeping page loads sub-second and never overselling inventory or double-charging a customer.

The defining property of this system is asymmetry. Browsing is enormously read-heavy: a shopper may generate hundreds of product views, search queries and recommendation impressions for a single order. Yet the moments that matter legally and financially - inventory decrement, payment authorization, order commit - are low-volume, strongly consistent transactions. A strong design therefore does not apply one consistency model or one database to everything; it separates the discovery plane (search, browse, recommendations), the merchandising plane (catalog, pricing, promotions), the transaction plane (cart, checkout, payment), the fulfillment plane (inventory, warehouse, shipment), and the engagement plane (reviews, notifications, loyalty), and gives each its own storage, caching and failure behavior.

Why the problem is distinctive

A social feed can show stale content; a store cannot show a stale price at checkout or sell inventory that does not exist. Conversely, requiring strong consistency everywhere would make the browse path slow and fragile. The interview-worthy tension is deciding exactly where correctness is non-negotiable (inventory ledger, payment, order aggregate) and where freshness-bounded eventual consistency is a feature (search index, recommendation scores, review counts, catalog cache).

Public operating baseline versus design assumptions

Public figures establish the category's scale. Amazon reported net sales of 574.8 billion USD in 2023 and stated that Prime Day 2023 was its biggest ever, with more than 375 million items sold worldwide. Alibaba publicly reported a peak of 583,000 orders per second during its 2020 Double 11 festival. Shopify reported that its merchants sold 9.3 billion USD worth of goods over Black Friday to Cyber Monday 2023. These are cited company figures for context, not requirements for our fictional platform. For capacity planning this answer explicitly assumes: 200 million registered customers, 20 million daily active users, 2 million concurrent browsers at peak, 240 million page views per day, 4 million orders per day, and an 8x flash-sale peak multiplier on reads with up to 60x on order creation for a featured deal. Unless a number is tied to a citation, it is a stated design assumption, target, or budget.

The five planes

  1. Discovery: search, category browse, recommendations, personalization.
  2. Merchandising: catalog, SKU/offer management, pricing, promotions, media.
  3. Transaction: session, cart, checkout, payment, tax, fraud screening.
  4. Fulfillment: inventory ledger, reservations, warehouse assignment, shipment, returns.
  5. Engagement: reviews, ratings, wishlists, notifications, loyalty, support.

Keeping these planes separate is what allows the discovery plane to degrade (stale recommendations, cached facets) without ever weakening the transaction plane.

Key Highlights

  • •Browse is read-heavy (hundreds of views per order) while money paths are low-volume, strongly consistent transactions.
  • •Five planes - discovery, merchandising, transaction, fulfillment, engagement - each get their own consistency and caching model.
  • •Public anchors: Amazon 574.8B USD net sales 2023 and 375M+ Prime Day 2023 items; Alibaba 583K orders/sec peak in 2020; Shopify 9.3B USD BFCM 2023.
  • •Design assumptions: 20M DAU, 2M peak concurrent, 240M page views/day, 4M orders/day, 8x read peak and 60x order peak on flash sales.
  • •Correctness is non-negotiable only for inventory ledger, payment, and the order aggregate; everything else may be freshness-bounded.
Lead With Read/Write Asymmetry
State in the first two minutes that browse traffic is hundreds of times heavier than order traffic, and that only inventory, payment and order state need strong consistency. This single sentence separates a commerce architect from a generic CRUD designer.
Do Not Draw One Database
A single relational database for catalog, search, cart, orders and clickstream fails on access patterns: faceted search needs an inverted index, carts need AP key-value semantics, orders need transactions, clickstream needs a stream and lake.

Section Rescue Kit

Buzzwords to use:

Read/Write AsymmetryCorrectness Boundary

Safe statements:

  • "Let me separate the planes that may degrade gracefully from the planes that must never lose a write."
  • "Before choosing databases, I will state which datasets carry money and inventory correctness."
Design an Amazon-Like Online Store - System Design | WinJob | WinJob