Recipes — Valkey & Kvrocks
Both speak the Redis (RESP) protocol, so every Redis client and library works unchanged — these are doze’s cheap, open-source ways to run “Redis” locally. (Valkey is the Linux-Foundation fork that kept Redis open source after its 2024 relicense; Kvrocks is an Apache project with the same API on disk. The full story is in The engines.) The difference is where the data lives:
- Valkey — in-memory, like Redis. Fast, volatile. Use it as a cache.
- Kvrocks — RocksDB-backed (on disk). Redis API, durable storage, lower RAM. Use it as a persistent KV store that survives reaps and restarts.
A cache (Valkey)
Section titled “A cache (Valkey)”valkey "cache" { version = 9 # newest 9.x; or pin "9.1.0" maxmemory = "256mb" # optional cap password = "cache" # optional}The URL is stable — redis://127.0.0.1:6379 (add :cache@ for the password), and
connecting cold-boots the instance:
redis-cli -u redis://127.0.0.1:6379 ping # -> PONGredis-cli -u redis://127.0.0.1:6379 set greeting helloredis-cli -u redis://127.0.0.1:6379 get greetingA durable KV store (Kvrocks)
Section titled “A durable KV store (Kvrocks)”kvrocks "store" { version = 2 password = "store" # optional}Identical client experience, but writes persist to disk — stop touching it, let it reap, reconnect later, and your keys are still there.
Connecting clients & GUIs
Section titled “Connecting clients & GUIs”Find the address and point any redis tool at it (RedisInsight, TablePlus, redis-cli):
doze status# NAME ENGINE STATE … ENDPOINT# cache valkey idle 127.0.0.1:6433redis-cli -h 127.0.0.1 -p 6433If you set a password, pass it with -a (or it’s already in REDIS_URL):
redis-cli -h 127.0.0.1 -p 6433 -a cacheCache + durable store together
Section titled “Cache + durable store together”valkey "cache" { version = 9 maxmemory = "128mb"}kvrocks "store" { version = 2}Each has its own stable URL — they differ only by the explicit port you declared:
redis-cli -u redis://127.0.0.1:6379 set session:42 active # cacheredis-cli -u redis://127.0.0.1:6380 set user:42 "{...}" # storeA process block that depends on both gets each one injected under its own
env_var.
Common tasks
Section titled “Common tasks”redis-cli -u redis://127.0.0.1:6379 flushall # wipe everythingredis-cli -u redis://127.0.0.1:6379 info keyspace # how many keysredis-cli -u redis://127.0.0.1:6379 monitor # watch commands livedoze sleep cache # put it to sleep now- Valkey is a drop-in Redis fork — your
ioredis/redis-py/go-rediscode needs no changes; just point it at the stableredis://127.0.0.1:<port>. - Pick by durability: ephemeral cache →
valkey; data you don’t want to lose on a reap →kvrocks. maxmemory(Valkey) caps memory; pair it with an eviction policy from your client if you want LRU behavior.- Reaping is by connection count — a client that keeps a connection open keeps the instance awake.