Question

Difficulty: MediumImplement Azure Cache for Redis Configuration and Data Patterns

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.)

  1. Configure the maxmemory-policy setting to volatile-ttl.Answer
  2. Configure the maxmemory-reserved setting to allocate a buffer for replication and system overhead.Answer
  3. C
    Configure the maxmemory-policy setting to volatile-lru.
  4. D
    Configure the maxmemory-policy setting to allkeys-lru.
  5. E
    Configure 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

1
Analyze key eviction requirements based on expiration status.
Identify that critical lookup tables lack a TTL and must be preserved, whereas dynamic metadata keys have a TTL and can be evicted.
Choosing an eviction policy prefixed with 'volatile-' ensures that only keys with a TTL are targeted, leaving keys without a TTL intact.
2
Select the specific volatile eviction algorithm that aligns with the priority requirement.
Select volatile-ttl instead of volatile-lru.
The requirement specifies prioritizing the eviction of keys nearest to their expiration time (shortest remaining TTL), which is the exact behavior of volatile-ttl.
3
Address system stability and data replication memory requirements.
Identify the need to reserve memory using the maxmemory-reserved configuration setting.
Reserving a dedicated buffer ensures background operations like replication during failover and memory fragmentation do not cause the cache to experience out-of-memory (OOM) failures.

Key Concept

Selecting appropriate eviction policies (maxmemory-policy) to manage volatile datasets while securing persistent keys, alongside configuring maxmemory-reserved to maintain platform stability.
Rate this question