Skip to content
Ameen Abozaid
Planned lessonMID-039-L04

Invalidation strategies

  • Lesson 4 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 how entries stop being stale.

Planned topics

  • TTL only: simple, but data is wrong for up to the TTL; unacceptable for prices.
  • Explicit invalidation on write: delete the key in the same service that writes.
  • Event-driven: the owner publishes ProductUpdated; every cache subscriber evicts or refreshes. Works across services.
  • Best practice: events plus a TTL as a safety net for lost events.
  • Deleting is safer than updating the cache: the next read loads the freshest data.
Draft outline details

Demonstration

StrategyStalenessCost
TTL onlyup to TTLnone
Delete on writetinycoupling
Event + TTLsecondsbroker

Check your understanding

Why keep a TTL when you have events?

Show answer

Events can be lost; the TTL bounds the damage.

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.