Back to roadmap
Module 8 · Caching, Queues, Async WorkDay 07925 min

Backpressure and Flow Control

Signal slowness upstream — don't drown.

Day 079

Backpressure and Flow Control

Producer
service
Bounded queue
queue
Consumer
service
Signal path
Bounded queue applies backpressure
Producer
service
flow
Bounded queue
queue
Bounded queue
queue
flow
Consumer
service
Bounded queue
queue
async
503 on full
note
Memory hook

Backpressure and Flow Control: signal slowness upstream

Mental model

absorb bursts before they become outages

Design lens

Blocking producers can cascade to client errors.

Recall anchors
Bounded queuesReject vs blockLoad shedding

Why it matters

Backpressure is the principle that downstream slowness propagates as a signal upstream so producers slow down rather than buffering forever. Without it, queues grow unbounded and the system collapses.

Deep dive

Bounded queues with reject-or-block tell producers what's happening.

TCP and HTTP/2 have built-in flow control; many message brokers have credit windows.

Load shedding is the last line: drop low-priority work to keep critical paths up.

Demo / scenario

Async pipeline overwhelmed during spike.

  1. Bounded queue at 1000.
  2. On full, return 503 to producer (or block).
  3. Producer applies retry with backoff and circuit breaker.
  4. Drop low-priority items first.

Tradeoffs

  • Blocking producers can cascade to client errors.
  • Reject-with-503 is more honest.
  • Shedding requires priority labels.

Diagram

Producer
Bounded queue
Consumer
503 on full
Bounded queue applies backpressure.

Mind map

Check yourself

Loading quiz…

Sources & further reading