Lesson 12 of 16
42. Design E-commerce Cart and Checkout (Amazon / Flipkart)

42.11 What would you say in the last five minutes?

3 min read+10 XP

Step 6: Wrap-up (5 minutes)

  • Bottlenecks: hot stock rows (conditional updates, bucketing, waiting rooms), payment gateway limits (rate limiting, multiple gateways), order writes at sale opening (sharded orders DB).
  • Single points of failure: payment gateway (a second gateway), orders DB shard (replicas and failover); the cart store accepts writes even when degraded.
  • Correctness: conditional stock updates, idempotency keys end to end, state machine for payments, reconciliation jobs, saga compensations.
  • Next with more time: split shipments across warehouses, split payments (wallet + card), price-drop protection, and fraud checks before payment.

Memory code: "Never oversell, never double-charge, never lose an order, and always know which state it's in."