Browsing is served almost entirely from caches, a CDN and a search index fed from the catalogue. Checkout is the hard part: an order touches inventory, payment and shipping, each owned by a different service, so it runs as a saga — a sequence of local steps with compensating actions if anything fails — instead of one distributed transaction.
Functional requirements
- Accounts with saved addresses and payment methods
- Browse categories and search with filters, sorting and suggestions
- Product pages with price, stock, images, seller and reviews
- A cart that persists across devices
- Checkout: reserve stock, take payment, create an order, send confirmation
- Order tracking, cancellations and returns
Non-functional requirements
- Browsing must stay fast and available even during big sales
- Never sell stock that doesn't exist (no overselling)
- Payments are exactly-once; orders are never lost
- Search results and product pages may be slightly stale; inventory at checkout may not
- Absorb 10× traffic spikes on sale days
Extensions
- Marketplace sellers with their own inventory and payouts.
- Reviews and Q&A with moderation.
- Dynamic pricing and deals.
- Personalised recommendations and 'frequently bought together'.
- Returns and refunds as their own saga.