Design an E-commerce Checkout
A case study of an Amazon style shop, covering catalog, cart, inventory reservation, the order and payment saga, idempotency and flash sales.
Requirements
An e-commerce checkout turns a customer's cart into a paid order whose items are reserved in a warehouse. Browsing a catalog can be sloppy; checkout cannot.
Functional:
- Search and browse a catalog of products and sellers.
- Add items to a cart that survives across devices.
- Place an order: confirm prices, reserve stock, take payment.
- Show order status; cancel and refund before shipping.
Non-functional:
- Do not oversell (sell stock you do not have) beyond a small, deliberate margin.
- Never double charge, even if the user clicks twice or the network retries.
- Catalog and cart stay available during failures; checkout may fail safely.
- Survive flash sales where one item draws a huge crowd.
1 of 10