You are developing a media metadata caching solution using Azure Cache for Redis. The cache contains two types of keys:
1. Critical lookup tables that do not have a Time-to-Live (TTL) set and must remain in the cache indefinitely.
2. Dynamic media metadata keys that are set with a TTL. Under memory pressure, you want the cache to prioritize evicting the keys that are nearest to their expiration time.
You need to configure the cache to meet these requirements and ensure the instance has sufficient memory buffer to handle replication and system fragmentation.
Which of the following configuration options should you implement? (Select two.)
- Configure the maxmemory-policy setting to volatile-ttl.Answer
- Configure the maxmemory-reserved setting to allocate a buffer for replication and system overhead.Answer
- CConfigure the maxmemory-policy setting to volatile-lru.
- DConfigure the maxmemory-policy setting to allkeys-lru.
- EConfigure the maxmemory-policy setting to noeviction.
Answer
Configure the maxmemory-policy setting to volatile-ttl and configure the maxmemory-reserved setting to allocate a buffer for replication and system overhead.
The configuration requires preserving keys without a TTL (the critical lookup tables) while evicting keys with a TTL (dynamic metadata) based on their remaining lifetime. Configuring the maxmemory-policy to volatile-ttl achieves this by restricting eviction candidate keys to those with an expiration set and evicting the ones closest to expiration first. Additionally, configuring the maxmemory-reserved setting is necessary to allocate a dedicated memory buffer for background processes such as replication and failover, ensuring the instance remains stable under high load.
Step-by-Step Solution
Key Concept
Selecting appropriate eviction policies (maxmemory-policy) to manage volatile datasets while securing persistent keys, alongside configuring maxmemory-reserved to maintain platform stability.