System design · interactive
Backpressure
A producer sends 120 messages a second; the consumer can only handle 80. Something has to give: memory, messages, or the producer's speed.
Queue length, 20 s
Dashed: a bound of 200.
- Queued
- 800
- Wait
- 10.0 s
- Dropped
- 0
producer now sending 120/s
The queue grows by 40 a second forever. After 20 s it holds 800 messages and each waits 10.0 s. Eventually memory runs out.
Queue
Step 1 of 4 · read left to right
In production
Tools and technologies
Every queue and stream library has a backpressure mechanism.
Not tied to one language — use these names when you search docs or design a system.