Skip to main content

Eviction

Upstash, by default, will reject writes when the max data size limit has been reached. If you use your database as a cache, you can enable eviction to let old data to be removed when max size limit is reached.

  • You can enable eviction by checking Eviction checkbox while creating a new database:

  • Or for an existing database by clicking Enable in Configuration/Eviction box in the database details page:

Upstash currently uses a single eviction algorithm, called optimistic-volatile, which is a combination of volatile-random and allkeys-random eviction policies available in the original Redis.

Initially, keys with expire field (keys marked with a TTL) will be sampled randomly for eviction. In the absence of volatile keys or if selected volatile keys are not enough, then some additional non-volatile keys will be chosen randomly for eviction. We plan to implement more eviction policies in the upcoming releases.