Amazon logo Amazon ยท System Design

Design Amazon Warehouse Fulfillment System

Frequency: 85/100 Scale: 10M orders/day, sub-second inventory updates

Problem Statement

Design the order fulfillment system that routes orders from placement to shipment. The system must track inventory in real time across thousands of warehouses and assign orders to the optimal fulfillment center.

Requirements Clarification

Functional:

  • Accept incoming orders and assign to fulfillment centers
  • Track inventory levels per SKU per warehouse in real time
  • Optimize assignment by distance, inventory availability, and SLA (Prime 1-day vs standard)
  • Update order status through picking, packing, and shipping stages

Non-Functional:

  • 10M orders/day โ†’ ~115 orders/second
  • Inventory reads must reflect stock within 1 second of change
  • No overselling (strong consistency required for inventory decrement)
  • System must handle warehouse outages gracefully

Critical Design Decision: Inventory Consistency

Inventory decrement is the most dangerous operation. Two approaches:

Optimistic Locking

Read stock level, attempt decrement with version check. Retry on conflict. Works for low contention SKUs.

Reserve-Then-Confirm

Reserve inventory (soft lock) at order placement. Confirm (hard decrement) only when payment clears. Releases reservation if payment fails after TTL.