E-commerce Order System – Scale-Up

12 min · scale-up · intermediate

E-commerce Order System – Scale-Up

Context: 50k orders/day. Multiple warehouses. Flash sales cause spikes.

Scale-Up Design

  • Order service: Accepts order, publishes to message queue (e.g., Kafka/SQS).
  • Workers: Consume, reserve inventory (by warehouse), charge payment, fulfill. Retries with DLQ.
  • Inventory: Separate service. Reserve/release with timeout (e.g., 15min cart hold).
  • Caching: Product catalog in cache; inventory checked against DB or inventory service.

Migration Path

  1. Add queue between API and processing
  2. Split inventory into its own service
  3. Introduce warehouse routing logic

Inline Check 1

Why use a message queue for order processing at scale?

<!-- quiz-candidate: true -->