Try
↑ ↓ move↵ openesc close

Interview prep / Load shedding and backpressure

Junior · Load shedding and backpressure · System design interview question

What is backpressure? Give two examples of how it shows up.

Sketch your own answer first, then compare it with the one below.

A strong answer

Backpressure is a signal from a consumer that is falling behind to the producer that feeds it, telling it to slow down. It lets the slow part of a pipeline set the pace, instead of letting work pile up in front of it.

It shows up in several forms. A bounded buffer that blocks the writer when full is one. A server that returns 429 or 503 with a Retry-After header is another. In a streaming library the consumer asks the producer for a specific number of items and the producer sends no more. Network transport does the same thing with a receive window that limits how much unacknowledged data a sender may have in flight.

The opposite is an unbounded buffer, which hides the problem until memory or latency runs out.

Dropping at the point of overload helps only the server. Backpressure helps the whole pipeline once the signal reaches the source of the work and makes it slow down.

Sources

Learn it by running it

The load shedding and backpressure lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms