Designing an E-commerce Platform in 45 Minutes: A Complete System Design Interview Guide
Step-by-step system design walkthrough for building a large-scale e-commerce platform. Covers search, product catalog, carts, checkout, inventory consistency, caching, sharding, and reliability patter
1. Problem definition
We are designing a global online marketplace where millions of users can browse products, manage shopping carts, and place orders. The system needs to be highly reliable for financial transactions and highly available for browsing.
Main User Groups:
Customers: Search for items, add to cart, and checkout.
Sellers/Admins: Manage inventory and view orders (we will focus mainly on the system impact of these).
Scope: We will design the Customer Buying Journey.
In Scope: Product Search, Product Details, Shopping Cart, Checkout, and Inventory Reservation.
Out of Scope: Third-party seller portals, warehouse logistics (shipping routing), machine learning recommendations, and customer reviews.
2. Clarify functional requirements
Must Have:
Search & Browse: Users can search by keywords and view detailed product pages (images, price, description).
Shopping Cart: Users can add/remove items and update quantities. The cart persists across sessions.
Checkout: Users can place an order, which triggers payment processing and inventory deduction.
Inventory Management: The system must strictly prevent “overselling” (selling items that are out of stock).
Order History: Users can view a list of past orders and their status.
Nice to Have:
Flash Sales: Handling extreme traffic spikes for hot product launches (e.g., new gaming console).
Guest Checkout: Ability to buy without a permanent account.
3. Clarify non-functional requirements
Target Users: 100 Million Daily Active Users (DAU) (Modeling a top-tier retailer).
Traffic Pattern: Highly Read-Heavy. Users view many items before buying one (approx. 100:1 read-to-buy ratio).
Latency:
Search/Browse: Ultra-low (< 200ms) for high conversion.
Checkout: Low to Moderate (< 1-2s). Correctness is more important than speed here.
Availability:
Storefront: 99.99%. Browsing should never go down.
Checkout: High, but in partition scenarios, we favor Consistency (CP) over Availability to prevent overselling.
Consistency:
Catalog: Eventual consistency (prices can lag by a few seconds).
Inventory: Strong consistency (stock counts must be accurate).
4. Back-of-the-envelope estimates
Traffic Estimates:
DAU: 100 Million.
Reads: Assume 10 page views per user/day.
100M * 10 = 1 Billion requests/day.
1B / 86,400 12,000$ QPS (Average).
Peak QPS: $5 \times$ Average ≈ 60,000 QPS.
Writes (Orders): 1% conversion rate.
1M orders/day.
≈ 12 orders/sec average.
Peak: Flash sales can spike to 10,000+ orders/sec for specific items.
Storage Estimates:
Product Catalog: 100M items * 1KB metadata ≈ 100 GB (Fits in memory/cache).
Media: 100M items * 1MB images ≈ 100 TB (Needs Object Storage).
Orders: 1M orders/day * 2KB ≈ 2GB/day. ~730 GB/year (Manageable with sharding).







