core practice · coding problem
Queue backpressure
Producer 10k msg/s, consumer 2k msg/s. Queue depth grows 8k/s. When shed load — at depth 50k or consumer lag 60s?
The mechanism
A queue decouples producer speed from consumer speed and turns a sync call into a durable, retryable message. 'Exactly once' is mostly a myth — design for at-least-once delivery plus idempotent consumers.
Expected evidence
Alert on lag and depth; shed at SLA breach; scale consumers or throttle producer.
Try this drill in the practice workspace →
Hints when you need them
- Queues are buffers, not infinite.
- Dead-letter poison messages.
Watch for these mistakes
- Assuming exactly-once delivery
- Non-idempotent consumers on an at-least-once queue
- Ignoring ordering guarantees (or their absence)