Skip to content
Ameen Abozaid
Planned lessonMID-038-L05

Persistence, memory, and eviction

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

know what survives a restart and what happens when memory is full.

Planned topics

  • RDB: periodic snapshots; fast restart, may lose the last minutes.
  • AOF: log of writes, with fsync policies (every second, always); less loss, bigger files.
  • No persistence is valid for a pure cache. Replication does not replace backups, and failover can lose recent writes.
  • Set maxmemory and an eviction policy (allkeys-lru, allkeys-lfu, volatile-*, or noeviction).
  • noeviction makes writes fail when full; a cache usually wants an allkeys-* policy.
Draft outline details

Demonstration

config lines maxmemory 512mb, maxmemory-policy allkeys-lfu, appendonly yes, appendfsync everysec.

Check your understanding

If Redis is the only copy of an order and the node dies, what is lost?

Show answer

Anything not yet persisted or replicated: possibly the order. Never use it as the only copy.

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.