Grokking Microservices for System Design Interviews
0% completed
Pub/Sub and Event-Driven Communication
1. Commands vs. Events
A command names its receiver. An event does not.
Two kinds of messages flow through brokers. A broker is a middleman service that holds messages and hands them to consumers. The difference between the two kinds shapes more of your design than it first looks like.
A command tells a specific service to do something: "send this email," "generate this thumbnail." It is addressed to one handler. The sender knows who will process it, and the sender cares that it gets done.
An event announces that something happened: "order 4711 was placed," "payment 981 failed
.....
.....
.....
Like the course? Get enrolled and start learning!