Local vs distributed caches
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
choose between an in-process cache and a shared one.
Planned topics
- Local (Caffeine): lives in the JVM heap, nanosecond access, no network. Each instance has its own copy.
- Distributed (Redis): one shared copy, network hop (about a millisecond), survives app restarts.
- Local caches drift between instances; invalidating all of them needs a broadcast.
- Common combo: small local cache (L1) in front of Redis (L2) for the hottest keys.
Draft outline details
Demonstration
| Local | Distributed | |
|---|---|---|
| Latency | ns | ~1 ms |
| Consistency across instances | weak | strong-ish |
| Memory | app heap | separate service |
Check your understanding
Why can two Shop instances return different prices from local caches?
Show answer
Each holds its own copy, expired or refreshed at different times.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.