Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is backpressure?

Batch & Streaming · Core Concepts

What is backpressure?

Mediumstream-08
backpressurelagthroughputbuffers

Question

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

Solution

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.

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.

PreviousNext