Key-value store
Fast counters, short-lived caches and locks for each app.
Built on Valkey
Plans: Starter and up
What you get
- A key-value store for each app
- Works with any Redis client
- Counters, short-lived caches and locks
- An instance of its own, not shared with other apps
- Memory set by the plan
- An empty store for each preview
How it works
Add kv: true to the app's whisk.yaml and the app receives WHISK_KV_URL, an ordinary Redis address. The store is Valkey, the open-source key-value store that grew out of Redis. It speaks the Redis protocol, so any Redis client works without changes.
Each app gets its own instance on its own private network. No other app can reach it, read its keys or push its keys out when memory fills. When the store is full, the least recently used keys are removed first, as a cache should.
The store is not durable and is not backed up. It empties when the app sleeps, so keep anything that must last in the app's Postgres database. The key-value store is on Starter and higher plans, not on the free app.
Example
A freight forwarder's quoting app keeps carrier rate lookups in the store for a few minutes, so repeat quotes are fast. It also holds a short lock while a booking is confirmed, so two staff cannot book the same container.
For your coding agent
kv: true
Connect with the client the app already uses, such as createClient({ url: process.env.WHISK_KV_URL }). The settings it receives are in the environment reference.