Eviction Policies

Difficulty: Intermediate

Question

What happens when Redis runs out of memory?

Answer

Redis applies an eviction policy. **LRU (Least Recently Used)** deletes the oldest data. **LFU (Least Frequently Used)** deletes the least popular data. **noeviction** returns errors on writes.

Concepts covered

LRU, LFU, TTL, Maxmemory