Backpressure and Bounded Stream Queues

Connect a slow downstream consumer to upstream admission and decide which records can wait, spill, or be dropped under the data contract.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A queue stores the difference between arrival and service
  2. Credits link capacity to sending

A queue stores the difference between arrival and service

If input arrives at 1200 items per second and a stage serves 1000, an initially empty queue grows by about 200 items each second until something changes. With space for 1000 items, it fills in roughly five seconds under constant rates. Buffering can absorb a temporary burst, but cannot resolve a permanently faster producer.

Credits link capacity to sending

A downstream stage can grant credits representing available space. Upstream consumption of credit limits outstanding work until completion returns it. Policies can instead spill or drop records whose semantics allow it, with explicit metrics. Backpressure can propagate across many stages and delay other coordinated work. Little’s law relates stable occupancy and latency. Checkpoint barriers explain why in-flight data can affect snapshot timing.[1][2]

References

  1. Tyler Akidau et al., The Dataflow Model ↩
  2. Apache Beam, Programming Guide ↩