Skip to content
StackDecode
System Design
9. Message Queues and Event-Driven SystemsAnimated

Asynchronous Communication

The caller does not wait for the result.

The idea

Work is sent as a message and handled later, so the caller continues immediately.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

ProducerEvent brokerBillingEmailAnalytics
  • 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

  1. 1Caller sends a message
  2. 2Returns at once
  3. 3Receiver processes later
  4. 4Result delivered by callback or event

Where it is used

Long tasks.

Watch out for

Harder to reason about and debug.

Related