staff-engineering-skills-backpressure
Installation
SKILL.md
Backpressure Trap
The producer is faster than the consumer. The buffer between them grows until something breaks. Before connecting a producer to a consumer, ask: what happens when the consumer is 10x slower than the producer?
The Core Problem
Backpressure is not a problem to solve -- it's a signal to propagate. When a consumer can't keep up, you have three options:
| Strategy | What happens | When to use |
|---|---|---|
| Slow down the producer | Producer blocks or is throttled until consumer catches up | When all work must be processed (financial transactions, critical events) |
| Reject at the entry point | Return 503/429 immediately, caller retries with backoff | When it's better to fail fast than queue indefinitely |
| Drop excess work | Newest or oldest items are discarded | When stale data is worthless (metrics, real-time telemetry, live video frames) |
What you must NOT do: add a bigger unbounded buffer. A bigger buffer just delays the failure and makes the OOM worse.
Detection: When Backpressure Is Missing
Stop and fix if you see: