Soru

Zorluk: OrtaImplement Azure Cache for Redis Configuration and Data Patterns

A company implements an auditing application that processes financial messages. The application uses an Azure Cache for Redis instance to store temporary transaction states. It is critical that no cached transaction states are evicted under memory pressure, as this would cause auditing mismatches. Instead, if the cache memory limit is reached, the application must receive errors so it can temporarily throttle ingestion. Which eviction policy should you configure for the Azure Cache for Redis instance?

  1. A
    volatile-lru
  2. B
    allkeys-lru
  3. noevictionCevap
  4. D
    volatile-ttl

Cevap

noeviction
The correct policy is noeviction because it is the only policy that does not automatically delete keys when the cache fills up. Instead, it returns an out-of-memory (OOM) error on write operations, which allows the application to detect the limit and throttle message ingestion.

Adım Adım Çözüm

1
Determine the application's tolerance for data eviction.
The application requires that no cached transaction states be lost or evicted under memory pressure.
Evicting data would cause auditing mismatches and break core business logic.
2
Determine the expected application behavior when the cache limit is reached.
The application must receive errors so it can throttle ingestion.
Throttling requires a clear error signal from the database/cache layer when it cannot accept more writes.
3
Select the Redis maxmemory-policy that prevents eviction and returns out-of-memory errors.
The noeviction policy matches this behavior exactly.
Unlike other policies, noeviction returns an error on write commands rather than silently reclaiming space by deleting keys.

Anahtar Kavram

Azure Cache for Redis Eviction Policies
Bu soruyu puanla