Soru

Zorluk: OrtaImplement Azure Cache for Redis Configuration and Data Patterns

An IoT monitoring solution uses Azure Cache for Redis to store two types of data:

1. The latest telemetry reading for each device, which does not have an expiration time (TTL) set.
2. Temporary event logs that are configured with a Time-to-Live (TTL) of 24 hours.

Due to a surge in device activity, the cache is approaching its maximum memory limit. You need to configure the cache eviction policy so that under memory pressure, the cache removes the least recently used temporary event logs first, while ensuring that the device telemetry readings are never evicted.

Which eviction policy should you configure?

  1. volatile-lruCevap
  2. B
    allkeys-lru
  3. C
    noeviction
  4. D
    allkeys-random

Cevap

volatile-lru
The volatile-lru policy evicts the least recently used keys among those that have an expiration (TTL) set. Since the latest telemetry readings do not have a TTL, they are completely safe from eviction, while the expiring event logs will be removed as needed under memory pressure.

Adım Adım Çözüm

1
Analyze the requirements for data retention and eviction behavior under memory pressure.
Temporary event logs have a TTL and can be evicted, while telemetry readings must never be evicted and do not have a TTL.
This establishes that we must use a volatile eviction policy (which only targets keys with an expiration set) rather than an allkeys policy.
2
Determine the specific eviction algorithm needed to remove the oldest or least recently used event logs first.
The Least Recently Used (LRU) algorithm matches the requirement of removing the least recently accessed keys first.
Combining the volatile scope with the LRU algorithm leads to the volatile-lru policy.

Anahtar Kavram

Azure Cache for Redis eviction policies control how keys are removed when the cache memory limit is reached. The volatile-lru policy targets only keys with an expiration (TTL) set, protecting keys without an expiration.
Tahmini Süre:1m 30s
Bu soruyu puanla