Recall & Review
beginner
What is an eviction policy in Redis?
An eviction policy in Redis decides which keys to remove when the memory limit is reached to make space for new data.
Click to reveal answer
beginner
Explain the noeviction policy in Redis.
The noeviction policy means Redis will return an error when memory is full and no keys are removed.
Click to reveal answer
intermediate
What does the allkeys-lru eviction policy do?
The allkeys-lru policy removes the least recently used keys from all keys in Redis to free memory.
Click to reveal answer
intermediate
Describe the difference between volatile-lru and allkeys-lru policies.
volatile-lru removes least recently used keys only among keys with an expiration set, while allkeys-lru considers all keys.
Click to reveal answer
intermediate
What is the purpose of the volatile-ttl eviction policy?
The volatile-ttl policy removes keys with the shortest time to live (TTL) first, but only among keys with expiration set.
Click to reveal answer
Which Redis eviction policy returns an error when memory is full?
✗ Incorrect
The noeviction policy stops Redis from removing keys and returns an error when memory is full.
What does the allkeys-random eviction policy do?
✗ Incorrect
allkeys-random removes random keys from all keys to free memory.
Which eviction policy only removes keys with an expiration set?
✗ Incorrect
volatile-lru only removes keys that have an expiration set.
What does LRU stand for in eviction policies?
✗ Incorrect
LRU means Least Recently Used, removing keys that were used least recently.
Which eviction policy removes keys with the shortest time to live first?
✗ Incorrect
volatile-ttl removes keys with the shortest TTL among keys with expiration.
Explain how Redis eviction policies help manage memory when it is full.
Think about what happens when Redis runs out of memory.
You got /4 concepts.
Describe the difference between allkeys-lru and volatile-lru eviction policies.
Focus on which keys each policy targets.
You got /3 concepts.