Skip to content
StackDecode
System Design
9. Message Queues and Event-Driven SystemsAnimated

Backpressure

Telling producers to slow down when consumers are overwhelmed.

The idea

Bounded buffers and signals protect systems from overload.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

arrivals 4queue 1allowed 4 rejected 0steady rate
  • allowed
  • rejected

4 arrive, 3 are served. The queue holds 1.

tick:
1
allowed:
4
rejected:
0
1/24

Bars show how many requests were let through each tick.

Step by step

  1. 1Queue fills
  2. 2Signal slow down or reject
  3. 3Producer reduces its rate
  4. 4System recovers

Where it is used

Streaming systems.

Watch out for

Unbounded queues hide the problem until memory runs out.

Related