System Design · Unit 15
Pub/sub vs queues
A customer places an order. The email service needs to know, so it can send a confirmation. Analytics needs to know, so the dashboards update. The warehouse service needs to know, so someone packs a box. The loyalty service needs to know, so points get added. One thing happened, and four different parts of your system care.
The previous unit gave you the queue: put a message in, one worker takes it out, the work happens later. But look what happens if you push the order event into one queue that all four services read from. A queue delivers each message to exactly one consumer. The email service grabs it, and analytics, warehouse, and loyalty never hear about the order at all. Three quarters of your system is now silently broken, and the queue is working exactly as designed.
The mismatch is that a queue answers "who does this task?" while this situation asks "who needs to hear this news?" Those are different questions with different tools. This unit teaches you to tell them apart on sight, because interviewers plant this fork inside almost every design prompt.
The rest of the System Design course is premium
The first two units are free, and this is where the gate sits. Unlocking premium opens this unit and everything else in both courses:
- ✓This unit: 5 prediction-first lessons, 3 applied drills, and a 5-question graded test
- ✓All 20 System Design units, caching to CAP & consistency
- ✓The full DSA course: every unit, guided problem, and drill
Cancel anytime. Not useful within 7 days? Email for a full refund.