0
0
Redisquery~5 mins

Eviction policies (LRU, LFU, random) in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does LRU stand for in Redis eviction policies?
LRU stands for Least Recently Used. It removes the keys that have not been accessed for the longest time when memory is full.
Click to reveal answer
beginner
Explain the LFU eviction policy in Redis.
LFU means Least Frequently Used. It removes keys that are used the least often, based on how many times they were accessed.
Click to reveal answer
beginner
What happens when Redis uses the random eviction policy?
Redis randomly removes keys to free memory, without considering usage or frequency.
Click to reveal answer
beginner
Why are eviction policies important in Redis?
Eviction policies help Redis manage limited memory by deciding which keys to remove when memory is full, keeping the system fast and stable.
Click to reveal answer
intermediate
Which eviction policy would be best if you want to keep the most recently used data in Redis?
The LRU (Least Recently Used) policy is best because it removes the oldest unused data, keeping recent data available.
Click to reveal answer
What does the LRU eviction policy remove in Redis?
AKeys that are the largest in size
BKeys that were least recently accessed
CKeys randomly chosen
DKeys that were most frequently accessed
Which eviction policy removes keys based on how often they are used?
ALFU
BLRU
CRandom
DFIFO
If Redis uses the random eviction policy, which keys get removed?
AThe largest keys
BThe least frequently used keys
CThe oldest keys
DRandomly selected keys
Why might you choose LRU over LFU in Redis?
ALRU is simpler and tracks recent usage, good for caching
BLRU removes keys randomly
CLFU removes the newest keys
DLFU is faster to compute
What is the main goal of eviction policies in Redis?
ATo backup data automatically
BTo increase disk space
CTo manage memory by removing keys when full
DTo encrypt stored keys
Describe how the LRU and LFU eviction policies differ in Redis.
Think about whether the policy tracks time or frequency of access.
You got /4 concepts.
    Explain why Redis needs eviction policies and give an example of when one might be used.
    Consider what happens when Redis runs out of memory.
    You got /4 concepts.