Glossary

Message queue

A message queue sits between two parts of a system: one side puts a message in, the other takes it out and processes it, and neither has to be available at the same moment. It is the standard way to decouple slow or unreliable work from a request a user is waiting on.

The pattern appears everywhere once you look for it. Accept the upload and confirm immediately, then convert the video in the background. Take the order, then send the confirmation email through a queue, so that a mail outage does not fail the checkout.

Queues also absorb bursts: ten thousand simultaneous requests become ten thousand queued messages processed at whatever rate the system can sustain, instead of an outage. The discipline they demand in return is that consumers be idempotent, because every serious queue can deliver a message twice.

← Back to the glossary