What's new

Choose what your Valkey keeps

A Valkey or a Redis® now has a usage: Durable for jobs you must keep, Snapshots for data whose latest writes you can lose, and Cache for data your app rebuilds.

Your queue, your sessions and your page cache do not need the same care. A job you lose is work that never happens, while a cached page comes back on the next request. Until now, unless your team had early access, each Valkey and Redis® you created wrote each change to disk, even one that only held a cache. Now you choose its Usage when you create it.

Add Valkey dialog with the name pages and the Cache usage chosen.Add Valkey dialog with the name pages and the Cache usage chosen.
The hint under Usage says what the chosen usage keeps.

Three usages

  • Durable writes each change to disk every second, so a crash loses at most the last second. Choose it for queues, jobs or sessions you must keep. Every Valkey and Redis® you already run keeps its usage and runs as it did: one created before you could choose is Durable.
  • Snapshots saves all its data every five minutes while it takes writes, and when it stops. It writes less to disk than Durable. A crash loses the writes since the last completed save began: up to about five minutes plus the time of two saves, so long saves widen that window. Choose it for rate limits, counters or other data whose latest writes you can lose.
  • Cache keeps nothing on disk and starts empty after each restart. Once its memory is full, it drops the keys your application reads least instead of refusing writes. Choose it for cached pages or query results.

Choose Add resource, select Valkey or Redis®, then pick the usage. You cannot change it later: for another usage, create another service. The service's page shows its usage under Lifecycle.

See Choose the usage of a Redis® or a Valkey for the details.

Know what Snapshots can lose

A restart, a new size or a deployment saves a Snapshots service before it stops it. Tenkai gives that save 10 seconds. A large dataset that takes longer to save loses the writes since the last save, as a crash does. Keep Durable for data you cannot afford to lose.

Backups follow the usage

A Durable or a Snapshots service has the same daily and on-demand backups as before, and a restore brings it back with its usage. A new service from a backup, from the backup's menu or from Initial data in the add dialog, keeps the usage of the one it comes from. A Cache has nothing to back up, so its Backups tab says so, and Hako stops suggesting one for it.

See Back up and restore a database for how backups work.