System Design
7. Caching ArchitectureAnimated
Distributed Cache Synchronisation
Keeping several cache nodes aligned.
The idea
Updates are propagated using pub/sub invalidation, or all nodes use one shared cache.
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
- 1A node updates data
- 2It publishes an invalidation
- 3Other nodes drop their copy
- 4They reload on demand
Where it is used
Local caches on many servers.
Watch out for
Messages can be lost, so use TTLs as a safety net.