Database / ValKey Interview questions
List the eviction policies supported by Valkey?
When memory usage hits the configured maxmemory limit, the maxmemory-policy directive decides what Valkey does next.
noeviction- reject further writes with an error, evict nothing.allkeys-lru- evict the least recently used key across the whole keyspace.volatile-lru- evict the least recently used key, but only among keys with a TTL.allkeys-lfu- evict the least frequently used key across the whole keyspace.volatile-lfu- evict the least frequently used key among keys with a TTL.allkeys-random- evict a random key.volatile-random- evict a random key among keys with a TTL.volatile-ttl- evict the key with the nearest expiration time.
More Related questions...