Batch & Streaming · Core Concepts

What is backpressure?

Mediumbackpressurelagthroughputbuffers

Interview question

What is backpressure in streaming systems, and how do systems handle it?

How to answer

The short answer

Backpressure is the slowdown signal that travels upstream when a consumer cannot keep up. Without it, buffers explode, lag grows forever, or the job OOMs.

Output
fast producer --> [buffer filling] --> slow sink / slow operator
                      ^
                 backpressure: slow down / block / drop (policy)

What shows up in the wild

  • Kafka consumer lag climbing
  • Flink in-flight buffers full; credit-based flow control
  • Spark SS batch duration > trigger interval (falling behind)
  • GC thrashing, disk spill, or checkpoint timeouts

What helps

  • Scale consumers / parallelism
  • Make sinks faster (batch writes, async I/O)
  • Reduce work per event
  • Autoscale; temporary load shedding only when product allows

Interview tip: Define backpressure as "downstream forcing upstream to slow." Then name lag and batch-duration > interval as symptoms.