Redis easy
If the Redis memory limit is reached, what specific behavior is exhibited by the `allkeys-lru` eviction policy?
- A It immediately stops accepting new write requests to prevent any data loss in existing records.
- B It removes Least Recently Used (LRU) keys across the entire dataset to free up memory slots.
- C It deletes keys in alphabetical order starting from the 'A' namespace until the limit is satisfied.
- D It triggers a critical system bypass that allows Redis to utilize the operating system's swap file.
Answer: B. It removes Least Recently Used (LRU) keys across the entire dataset to free up memory slots.
This makes Redis behave like an intelligent cache. It assumes that keys not touched in a long time are 'Cold' and less valuable than 'Hot' keys being updated/read frequently, ensuring the most active data stays in RAM.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the defining characteristic of a Redis 'Set' data type compared to a standard Redis 'List'?
- In the context of Redis messaging, what is the functional definition of the 'Pub/Sub' feature?
- How does the Redis background snapshotting process (`BGSAVE`) leverage the operating system's `fork()` mechanism to minimize memory overhead?
- Why does Redis proactively disconnect a Pub/Sub client that exhibits high 'output buffer' usage relative to its ingestion rate?
- How does a 'Sorted Set' (ZSET) manage its internal membership and ordering differently from a plain Set?
- Which basic Redis command is used to store or update a simple String value associated with a specific key?