BitBootcampBitBootcamp ← all explainers 🔄 Review ⚙ Settings

Pattern — Backpressure

The problem it solves

A fast stage feeds a slow stage through a queue that nobody bounds, so a spike converts directly into an unbounded backlog. The edge keeps returning success — 202 Accepted — while work it can never finish piles up until the process OOM-kills or the pipeline stalls. This is the shape behind Drill 84 (the order gateway that returned 202 to 15,000 orders a second while the processing tier drained 4,000) and Drill 81 (the in-memory enrichment buffer that grew until the heap died in a crash loop). Both fail because load flows one way only: the slow stage has no channel to reach back and say stop.

The pattern

Backpressure is a return channel: the saturated stage publishes its pressure (queue depth, in-flight concurrency), and every upstream stage acts on it — by blocking, or by rejecting fast with a first-class "slow down" response — so arrivals can never outrun service for long. Acceptance is coupled to capacity. When the system cannot finish work, it refuses it cheaply at the edge instead of accepting it and dropping it later.

How to apply it

Ground every number in the measured drain rate of the slow stage (Drill 84: about 4,000 orders/s).

When to use it — and when not

Use it on any edge that returns success for work a slower tier must finish. Do not reach for it when the right answer is a bigger buffer for a transient spike that will drain on its own — backpressure trades throughput and caller convenience for survival, and rejecting work that a 10-second buffer would have absorbed just pushes retries and pain onto clients. It is also the wrong tool when the fix is genuinely more capacity (a real, sustained traffic increase) rather than protection against overload; backpressure keeps you alive, it does not make you faster. And it needs somewhere for the shed load to go — a caller that can back off, a priority tier to drop, or a durable store — otherwise you are just choosing where the data loss lands.

Signals it's working

Seen in the wild

See it

The CompareScene carries the point: an unbounded queue growing to hundreds of thousands and OOM-ing, versus a bounded 120,000-cap queue shedding at the edge with a 429 while admitted-p99 holds at 300 ms.

Named concepts: backpressure signalling, bounded queues, token-bucket admission control, concurrency limits.