System Design
7. Caching ArchitectureAnimated
First-In-First-Out (FIFO)
Evict the oldest inserted entry.
The idea
Simple queue-based eviction that ignores how often items are used.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- hit
- current request
A is missing: fetch it from the database and store it.
- step:
- 1
- hits:
- 0
1/22
Eviction policy: oldest inserted.
Step by step
- 1Insert at the tail
- 2When full remove the head
- 3Hits do not change order
- 4Oldest entries leave first
Where it is used
Simple or small caches.
Watch out for
May evict hot items.