Message Queues
A to-do list for servers.
A message queue is a to do list that servers share. One part of the system adds jobs to the list. Other parts take jobs off, and do them, at their own pace.

- A shared to-do list
- Producers add jobs
- Consumers do them
Producer, queue, consumer
The checkout service is the producer. It puts a message on the queue, like send receipt for order seven. The queue stores it safely. A worker, the consumer, takes the message, sends the email, and confirms it's done. Only then does the queue delete the message.
- Producer
- Queue stores
- Consumer takes
- Does the work
- Acknowledges

Why queues help
Queues give us a lot. The producer and consumer don't need to be up at the same time. Bursts of work are smoothed out, because the queue just gets longer for a while. We can add more workers to go faster. And if a worker crashes, its message goes back on the queue, for someone else.
Summary
A message queue lets producers hand off work, and consumers process it at their own pace. Popular queues include RabbitMQ and Amazon SQS. Next, sending one message to many listeners.
Key takeaways- Producers add
- Consumers take
- Acknowledge when done