Warehouse Throughput Simulator
A package-flow simulation that maps physical operations concepts to queues, backpressure, retries, processing state, and observability.
Problem
In a logistics operation, work does not disappear when processing capacity is saturated. It waits in a visible backlog. SQS gives a cloud system the same kind of buffer and makes the backlog measurable.
Design
- The demo page signs in with Cognito and calls a protected API route.
- A producer Lambda creates a run summary and simulated package records in DynamoDB.
- The producer sends one SQS message per package event.
- An event source mapping invokes a consumer Lambda in small batches.
- The consumer simulates processing latency, marks packages processed or failed, and updates aggregate run metrics.
- The browser polls the run endpoint to show processed count, failed count, backlog, average processing time, and package state.
Cost and abuse controls
Reviewer accounts are limited to three simulator runs per day, each run is capped at 25 events, SQS retention is one day, DynamoDB records expire with TTL, and the Lambda functions use modest memory and short timeouts. The owner account is exempt for testing.
Operational lesson
The interesting part is not simply using SQS. It is deciding what signal should trigger action: queue depth, message age, failed processing attempts, or a business SLA. That mirrors the way physical operations use backlog and throughput to make staffing decisions.