System Design
9. Message Queues and Event-Driven SystemsAnimated
Message Brokers
Servers that route messages between producers and consumers.
The idea
Brokers handle storage, routing, delivery guarantees and subscriptions.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
A service publishes an event: "OrderPlaced".
- step:
- 1/4
- at:
- Producer
1/8
The green dot is a request moving through the system.
Step by step
- 1Producers connect
- 2The broker stores messages
- 3Routes by topic or queue
- 4Delivers to consumers
Where it is used
Kafka and RabbitMQ.
Watch out for
The broker needs replication to avoid being a SPOF.