System Design
7. Caching ArchitectureAnimated
Redis
An in-memory data store with rich data types.
The idea
Redis supports strings, hashes, lists, sets, sorted sets and streams, with optional persistence and replication.
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
Check the in-process cache: nanoseconds.
- step:
- 1/4
- at:
- Request
1/10
The green dot is a request moving through the system.
Step by step
- 1Client connects
- 2Sends commands such as GET and SET
- 3Redis serves from memory
- 4Optionally persists to disk
Where it is used
Caching, rate limiting, queues, leaderboards.
Watch out for
Single-threaded commands, so big values and slow commands block everyone.