Skip to content
← All concepts

Messaging & flow

Back-pressure & queues

When producers outpace consumers, buffer and slow down instead of falling over.

Spikes (a viral upload, a flash sale) arrive faster than workers can process. A queue absorbs the burst so the cost is delay, not failure, and signals upstream to slow down when it grows too long.

See it in action

Step through the scenarios on the diagram.

Laying out diagram…

1/3A viral moment brings 10× the usual uploads; the API just enqueues jobs and replies 'accepted'.

API
— Accepts uploads quickly
Job queue
— Absorbs bursts
Workers
— Process at their own pace
Dead-letter queue
— Messages that keep failing
Autoscaler
— Scales on queue depth

How it works

  • Queue between request path and heavy work (transcoding, emails, fan-out).
  • Autoscale consumers on queue depth.
  • Dead-letter queues for messages that keep failing.
  • Reject or shed low-priority load when queues are full.

Trade-offs

  • Users see delays during spikes; queues need monitoring.

Seen in

Components involved

Related concepts