Persistence, memory, and eviction
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
fsyncpolicies (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
maxmemoryand an eviction policy (allkeys-lru,allkeys-lfu,volatile-*, ornoeviction). noevictionmakes writes fail when full; a cache usually wants anallkeys-*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.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.