System Design
9. Message Queues and Event-Driven SystemsAnimated
RabbitMQ
A flexible message broker with routing.
The idea
Exchanges route messages to queues by rules. Good for task queues and complex routing.
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
- 1Producer publishes to an exchange
- 2Bindings route it to queues
- 3Consumers pull and ack
- 4Failed messages go to a DLQ
Where it is used
Work queues and RPC.
Watch out for
Lower throughput than log-based systems for huge streams.