🏗️Message Queue
Also known as Queue, Job Queue, Task Queue, Message Broker
A line where messages wait for a free worker.
Think of it like
Think of it like a line at a bakery. Each order waits its turn for a free baker.
Example
Jack's site lets people upload videos. Each upload adds a message to a queue. Four workers take messages out and convert the videos, while the site stays fast.
Why it matters
Slow jobs move out of the web request, so users are not kept waiting. Spikes of traffic just make the line longer.
Definition
Common mistake
Key takeaways
- 1Producer drops it in. And moves on.
- 2One worker takes it. When it is free.
- 3Waits safely. Through spikes and outages.