System Design
9. Message Queues and Event-Driven SystemsAnimated
Message Queues
A buffer that holds messages until a consumer processes them.
The idea
Producers add messages; consumers take them at their own pace, smoothing bursts.
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 sends a message
- 2The queue stores it
- 3A consumer receives it
- 4It acknowledges and the message is removed
Where it is used
Background jobs and decoupling.
Watch out for
Messages may be duplicated or delayed.