The data eviction policy of a database controls what happens when new data exceeds the memory size of a database. Typically, such situations require evicting (or deleting) data previously added to the database.

To control this behavior, edit database details to change the Data eviction policy setting at the database level.

Available policies

For each database, you can choose from these data eviction policies:

Available policiesDescription
allkeys-lruKeeps most recently used keys; removes least recently used (LRU) keys
allkeys-lfuKeeps frequently used keys; removes least frequently used (LFU) keys
allkeys-randomRandomly removes keys
volatile-lruRemoves least recently used keys with expire field set to true (Default)
volatile-lfuRemoves least frequently used keys with expire field set to true
volatile-randomRandomly removes keys with expire field set to true
volatile-ttlRemoves keys with expire field set to true and the shortest remaining time-to-live (TTL) value
no evictionNew values aren’t saved when memory limit is reached

When a database uses replication, this applies to the primary database

Prevent data eviction

Redis Cloud supports Auto Tiering to prevent data eviction but maintain high performance.

Auto Tiering can extend your database across RAM and Flash Memory and intelligently manage “hot” (active) data in RAM and “cold” (less active) data in Flash memory (SSD).