Opening Scenario
Your order processing service calls a fulfillment API. The fulfillment API is slow — it takes 3–5 seconds per order. During flash sales, 10,000 orders arrive per minute. If your checkout service waits synchronously for each fulfillment call, users wait 3–5 seconds at checkout, and if the fulfillment service is down, orders fail completely. You need the checkout service to accept the order instantly and process fulfillment separately. How do you decouple them?
Question Progression
Concept 1: What is a message queue and what problem does it solve?
Question You have a producer (checkout service) and a consumer (fulfillment service). They have different speeds and different availability profiles. What breaks if you connect them directly?
Reasoning Direct synchronous calls couple the producer's success to the consumer's availability and speed. If the consumer is slow, the producer blocks. If the consumer is down, the producer fails. If…
In the full tutorial
- When to Reach for SQS
- Interview Follow-Ups