Skip to content
Ameen Abozaid
Planned lessonMID-037-L02

Local vs distributed caches

  • Lesson 2 of 5
  • Mid-level
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

LocalDistributed
Latencyns~1 ms
Consistency across instancesweakstrong-ish
Memoryapp heapseparate 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.