← Lessons

quiz vs the machine

Gold1400

Concurrency

The Backpressure End to End

How a slow consumer can push a signal back through a pipeline so producers slow down.

5 min read · core · beat Gold to climb

When the fast outruns the slow

In a pipeline a fast producer can overwhelm a slow consumer. Without a feedback signal the excess piles up in buffers until memory runs out. Backpressure is the signal that tells upstream stages to slow down.

How the signal travels

Backpressure must flow end to end, from the slowest stage all the way back to the source:

  • A bounded buffer fills and blocks or rejects the stage feeding it.
  • That stage in turn slows the stage feeding it, and so on.
  • Eventually the original producer feels the pressure and throttles.

If any stage hides the pressure behind an unbounded buffer, the signal breaks and the system absorbs load until it falls over.

Push versus pull

  • A pull system has consumers request the next item, so it is naturally backpressured: nothing arrives unless asked for.
  • A push system needs explicit credit or a bounded queue to create the same effect.

Key idea

Backpressure carries a slow consumer signal end to end so producers throttle, and one unbounded buffer anywhere breaks the chain.

Check yourself

Answer to earn rating on the learn ladder.

1. What does backpressure communicate?

2. What breaks the backpressure chain?