Skip to content
doze
0.2

These are the docs for doze 0.2.

What changed in each release →

Kvrocks

Run Kvrocks, the Redis protocol on disk, for keys that survive sleep and restarts without living in RAM.

On this page

Runs Kvrocks 2 · macOS and Linux · registry page ↗

Run a durable key-value store that any Redis client can use, with its data on disk instead of in memory.

Apache Kvrocks speaks the Redis protocol (RESP) and stores its data in RocksDB. It is an Apache Software Foundation project, under the Apache-2.0 licence. Pick it over Valkey when the data is large or should survive a sleep and a restart: same client code, different trade-off. Valkey is fast and in memory; Kvrocks is durable and light on RAM.

module kvrocks "store" {
version = 2
}
Terminal window
doze url store
# redis://store.shop.doze:6380/0
redis-cli -u "$(doze url store)" set user:42 '{"name":"Ada"}'

Kvrocks’s own port is 6380, so it sits beside a Valkey on 6379 without a clash. Hand it to an app by reference: REDIS_URL = module.store.url.

Writes are on disk: let it sleep, connect again later, and the keys are there. doze reset store deletes them.

module valkey "cache" {
version = 9
maxmemory = "128mb"
}
module kvrocks "store" {
version = 2
}

Each is its own server with its own address; an app reads module.cache.url and module.store.url.

A namespace is a separate keyspace with its own token. Declaring one needs a password, which is the admin’s:

module kvrocks "store" {
version = 2
password = "admin"
namespace "tenant_a" { token = "tenant-a-token" }
}

A client that authenticates with tenant-a-token sees only that namespace.

A local Apache Kvrocks server: the Redis protocol backed by RocksDB on disk. Durable and memory-frugal — a drop-in Redis API when you want persistence without holding the dataset in RAM. Supports namespaces with per-namespace tokens.

module kvrocks "store" {
version = 2
port = 6380
workers = 4
password = "admin"
settings = {
rocksdb.block_cache_size = "256"
}
namespace "tenant_a" {
token = "tenant-a-token"
}
namespace "tenant_b" {
token = "tenant-b-token"
}
}

The version = you write is the engine’s own version. Declare a series and doze pins its newest published build, or declare an exact build. Either way it is fetched, verified and pinned in doze.lock, so it never moves on its own.

version = pins (today) exact builds
2 2.16.0 20
Every exact build, per series

2: 2.16.0 · 2.15.0 · 2.14.0 · 2.13.0 · 2.12.1 · 2.12.0 · 2.11.1 · 2.11.0 · 2.10.1 · 2.10.0 · 2.9.0 · 2.8.0 · 2.7.0 · 2.6.0 · 2.5.1 · 2.5.0 · 2.4.0 · 2.3.0 · 2.2.0 · 2.1.0

Field Type Default Description
version number — Engine major to run — 2. Required.
workers number — Number of worker threads.
password string — requirepass auth password (the admin namespace); required when namespaces are declared.
settings map(string) — Arbitrary kvrocks.conf directives, applied verbatim.

Every module block also takes doze’s own fields: port, listen, sleep, after, enabled, routes, count and for_each (doze.hcl reference).

namespace "<name>" { … } — A logical namespace with its own access token.

Field Type Default Description
token string — Auth token scoped to this namespace. Required.

The releases of the module that provide this engine. doze picks the newest one that fits your doze and your version =, and pins it in doze.lock; you never write these. Older releases stay available for pinned lockfiles.

Release Engine versions Platforms
0.2.1 2 3 stable

Signed data: index.yaml ↗ · meta.yaml ↗