Skip to content
StackDecode
System Design
16. Performance EngineeringAnimated

Asynchronous Programming

Do other work while waiting.

The idea

Async I/O avoids blocking threads during waits.

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. 1Start an operation
  2. 2Yield while waiting
  3. 3Resume on completion
  4. 4Handle errors

Where it is used

I/O-heavy services.

Watch out for

CPU-heavy work still blocks the event loop.

Related