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.
- 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
- 1Start an operation
- 2Yield while waiting
- 3Resume on completion
- 4Handle errors
Where it is used
I/O-heavy services.
Watch out for
CPU-heavy work still blocks the event loop.