Buying a ticket looks like a single click. Behind it, a chain of things happens: the seat is held, payment is confirmed, the ticket is generated, an email goes out, the organiser's report updates, the fraud check runs. If all of that is one long chain of calls, it takes just one part stalling – say the email service – and the buyer sees an error even though the payment went through.
A queue: “it's written down, it will be done”
A message queue (e.g. Amazon SQS) is like a mailbox between two parts of a system. One part drops a message (“order 123 is paid”) and moves on immediately. The other picks it up when it gets to it – and if it's down right now, the message waits.
- Peaks get absorbed. A thousand orders a second don't have to be processed in that same second. The queue takes them in, and processing runs at a steady pace.
- Failures stay local. If the email service goes down, checkout keeps working; messages wait and are processed when the service is back.
- Retries are built in. A message that wasn't processed successfully goes back to the queue. If it still fails after several attempts, it moves to a separate error queue (a dead-letter queue) – nothing is lost silently.
One event, many receivers
Amazon SNS (or any similar publish–subscribe system) answers a different question: what if several parts of the system need to know about the same event? Instead of the payment service calling email, tickets, reporting and fraud checks one by one, it publishes one event – “paid” – and each interested part has its own queue and handles it at its own pace. New parts are added without touching the existing ones.
The ticketing example
- The buyer pays → a paid event is published.
- Ticket queue: generates the ticket and sets the seat status to “paid”.
- Email queue: sends the confirmation; if the service is slow, the buyer has still bought.
- Reporting queue: the organiser sees sales almost in real time.
- Fraud queue: checks for suspicious patterns without slowing checkout down.
One thing is mandatory: every consumer must handle the same message twice. Queues guarantee a message arrives at least once, not exactly once. So every message carries a unique key and the consumer checks “have I already done this” – and a buyer never gets two tickets for one payment.
The chat example
In chat, order is everything. “On my way” after “where are you?” makes sense; the other way round doesn't. Standard queues don't guarantee order, so FIFO queues are used (e.g. SQS FIFO), where every conversation is its own message group: order is strict within a conversation, while different conversations are processed in parallel. The same “new message” event then fans out – push notification, search, moderation – each in its own queue.
We have to know what happened – and when
The biggest payoff shows up when something goes wrong. A customer says: “I paid, but there's no ticket.” Without events, the team digs through the logs of five services and guesses. With events, the answer is a list: held at 20:00:03, paid at 20:01:12, ticket generated at 20:01:13, email bounced at 20:01:14 – address doesn't exist.
It's worth knowing that a queue on its own is not an archive – an SQS message disappears once it's processed. So besides being sent to queues, events are also written to a durable log (an append-only table, file storage, or a system like Kafka that keeps history). That way you can:
- reconstruct the exact flow of any order or conversation,
- resolve a complaint in minutes, not days,
- replay events through fixed processing when needed,
- keep a trail for accounting and for disputes with payment providers.
When you need this
Not every site does. But if one customer action triggers several steps, if you have peaks, or if people ask “what exactly happened to my order” – queues and an event log are one of the most cost-effective changes you can make to your architecture. How it all behaves under pressure is checked with a load test, and we wrote about ticket sales themselves here.








