What is Backpressure

Backpressure is the condition that occurs when a system component receives data faster than it can process it. The term comes from fluid dynamics — pressure that builds up when flow is restricted.

How it works

A producer sends 1,000 messages per second. The consumer processes 500 per second. The queue between them grows by 500 messages per second. Without intervention, the queue eventually exhausts memory or disk.

The system must respond to backpressure:

  • Scale consumers — add workers to match the production rate.
  • Reject messages — return errors to the producer when the queue is full, forcing the producer to slow down.
  • Drop messages — discard the oldest or lowest-priority messages. Acceptable for metrics, not for financial transactions.
  • Rate limit producers — throttle the inflow. See How Rate Limiting Works.

Why it matters

Ignoring backpressure leads to cascading failures. Queues fill up, memory runs out, services crash, and recovery is slow. Well-designed systems make backpressure visible (monitoring queue depth) and handle it explicitly (auto-scaling rules, circuit breakers, or producer-side throttling).

Message queues absorb temporary spikes but are not a solution for sustained overload. If producers consistently outpace consumers, the system must either scale the consumer side or reduce the production rate.

For more on queues and backpressure handling, see How Message Queues Work.