DVA-C02 Eviction Policy Practice Question
A developer is troubleshooting an application that uses Amazon ElastiCache for Redis to cache database query results. The application experiences high latency during cache misses. The developer notices that frequently accessed keys (hot keys) are often missing from the cache, suggesting they are being evicted. Which action should the developer take to reduce cache misses for hot keys?
⚠ Common exam trap
Many candidates assume scaling up or out is the only solution for cache misses, overlooking that the eviction policy directly controls which keys are removed under memory pressure, and 'volatile-lru' by default excludes keys without TTL from eviction consideration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Switch to the 'allkeys-lru' eviction policy.
ElastiCache for Redis defaults to the 'volatile-lru' eviction policy, which considers only keys that have a TTL for eviction. Under memory pressure, Redis may evict frequently accessed TTL-bearing keys while cold keys without TTL cannot be evicted. Switching to 'allkeys-lru' expands the candidate set to include keys without TTL, allowing Redis to evict less-recently-used non-TTL keys first and reducing the likelihood that hot TTL-bearing keys are evicted.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the number of cache nodes.
Why it's wrong here
Adding nodes increases total memory but does not change how eviction selects keys; hot keys may still be evicted if not properly prioritized.
- ✓
Switch to the 'allkeys-lru' eviction policy.
Why this is correct
allkeys-lru evicts the least recently used keys from all keys, which tends to retain frequently used hot keys.
- ✗
Disable the TTL on all cached keys.
Why it's wrong here
Disabling TTL can cause the cache to fill with stale data and increase memory pressure, potentially worsening eviction of hot keys.
- ✗
Increase the size of the cache cluster.
Why it's wrong here
More memory can reduce eviction frequency, but if the eviction policy is not LRU-based, hot keys may still be evicted in favor of other keys.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 1,135 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.