Design StreamShop — StreamHub's marketplace for creator merchandise: browse products, add to cart, checkout with payment, and track order fulfilment. Amazon-scale patterns at StreamHub's 50M buyer audience.
Requirements
Functional requirements
- Product catalog: browse, search, filter by creator/category/price.
- Shopping cart: add/remove items; persist across sessions.
- Checkout: shipping address, payment, order confirmation.
- Inventory management: track stock; prevent overselling.
- Order tracking: status updates (placed, shipped, delivered).
- Seller dashboard: list products, manage inventory, view orders.
Non-functional requirements
- Scale: 50M buyers; 500K sellers; 10M products; 1M orders/day.
- Checkout latency: Under 3 seconds end-to-end.
- Inventory accuracy: Zero overselling — strong consistency on stock decrements.
- Payment reliability: Exactly-once charge via idempotency keys.
- Availability: 99.99% for browse; 99.9% for checkout (graceful degradation).
Out of scope: Recommendation engine, auction/bidding, international customs/tax calculation.
Estimation
- 1M orders/day × 3 items avg = 3M order line items/day.
- 50M buyers × 5 cart items avg × 200 bytes = 50 GB cart storage — Redis with Postgres backup.
- Product catalog: 10M products × 2 KB metadata = 20 GB — Elasticsearch for search, Postgres for transactional.
- Order storage: 1M/day × 365 × 1 KB = 365 GB/year — partition by date, archive after 2 years.
- Payment: 1M transactions/day ≈ 12 QPS average — Stripe handles scale; focus on idempotency.
StreamShop e-commerce architecture
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 4 sections
- API design
- High-level architecture
- Deep dive: inventory consistency
- Deep dive: checkout saga
Test yourself
Answer these before moving on — recall is what makes it stick.