Prerequisites
What it is
Backpressure is a feedback mechanism that prevents producers from overwhelming consumers. Instead of accepting unlimited work, the system slows, buffers, sheds, or rejects work.
Why it matters
Overload often cascades. Queues grow, memory fills, latency spikes, retries multiply, and healthy services become unhealthy. Backpressure keeps overload bounded.
How it works
Signals include queue depth, consumer lag, CPU, memory, connection buffers, and downstream errors. Producers respond by reducing rate, batching, pausing reads, or returning a retryable error.
When to use it
Use it in queues, streaming APIs, WebSocket gateways, media pipelines, and inference schedulers.
Tradeoffs / failure modes
Too much buffering hides problems and increases latency. Too little buffering rejects work prematurely. The product must decide what to degrade first.
Tiny example
If a WebSocket client’s send buffer grows too large, the gateway stops reading new events for that connection or disconnects it.
Related guides and systems
See Job Queues, WebSocket Infrastructure, Server-Sent Events, Video Transcoding, ChatGPT, Discord, YouTube, and Slack.
Seen in deeper dives
Capability
Job Queues & Background Workers
Async task processing with retries, dead-letter queues, and priority scheduling
Capability
Server-Sent Events
One-way real-time streaming from server to client over HTTP
Capability
Video Transcoding Pipeline
Adaptive bitrate encoding, queue-based processing, and HLS/DASH delivery for streaming
Capability
WebSocket Infrastructure
Persistent bidirectional connections at scale for real-time applications
Case Study
ChatGPT
Serving large language model inference to hundreds of millions of users
Case Study
Discord
Real-time voice, video, and text for communities at massive scale
Case Study
Slack
Channel-based messaging for the enterprise workplace
Case Study
YouTube
The world's largest video platform serving billions of hours daily
Related concepts
Circuit Breaker
Stop calling an unhealthy dependency before failures cascade through the system.
Idempotency
Make repeated requests safe so retries do not create duplicate side effects.
Retry with Exponential Backoff
Retry transient failures slowly enough that recovery is possible.