Backpressure Pattern

Slow producer; protect consumer.

Overview

Backpressure slows producers when consumers cannot keep up. Without it, an unbounded queue silently grows until memory exhausts and the consumer dies under a load it never had a chance to drain.

The approach

Three properties make backpressure work in practice: bounded queues, demand-driven flow, and a documented overflow policy. None of the three is optional.

Why this compounds

Backpressure-discipline compounds across services. Each correctly-flowing channel removes one source of OOM in the system, and the patterns transfer to the next service the team builds.