On this page
Key Value (Redis-compatible)
Key Value is a managed, Redis-compatible store (Valkey) that lives inside your workspace. AI apps use it for queues, caches and rate limits. An instance is private and protected by a password, and it keeps its data on a disk.
What you get#
- An instance named
cacheis reached atkv-cache:6379from the services and cron jobs of the same workspace, and from nowhere else. It has no public address. - Every connection needs the password. The connection URL is
redis://:<password>@kv-<name>:6379(no user name), which every Redis client accepts. - Persistence yes, backups no. Data is written to an append-only file on a disk, flushed every second, so a restart, a resize or a move to another machine loses at most the last second or two. Nothing is backed up and nothing can be restored: deleting an instance deletes its data. Keep your source of truth in a database (Databases).
- One instance runs as one copy, with no failover: if its machine is replaced it restarts elsewhere, and the data follows it.
- There is no TLS inside the workspace, no password rotation and no public address.
Sizes#
| Size | Memory | Data it holds | Disk | List price (disk included) |
|---|---|---|---|---|
256mb | 256 MB | up to 192 MB | 1 GB | $10 a month |
1gb | 1 GB | up to 768 MB | 2 GB | $20 a month |
4gb | 4 GB | up to 3 GB | 8 GB | $70 a month |
The server holds up to 75% of its memory as data; the rest is for the server itself. The disk is included in the price. Prices are list prices: Kilby is free during the beta and nothing is billed today.
When memory is full, the eviction policy decides what happens:
| Policy | What it does | For |
|---|---|---|
allkeys-lru (the default) | Removes the keys used least recently to make room. | A cache. |
noeviction | Refuses writes until there is room. | A queue. |
Create one#
- Dashboard: New, then Key Value, or /dashboard/key-values/new. Choose a name (3 to 30 characters: lowercase letters, digits and hyphens, starting with a letter, not changeable later), a size and an eviction policy. It is ready in about a minute.
- Command line:
kilby kv create cache --plan 1gb,kilby kv create jobs --eviction noeviction,kilby kv info cache --connection. - API:
POST /api/v1/key-valueswithname,planandeviction_policy.
A workspace can have up to 3 instances. An instance counts toward the workspace's CPU, memory and disk limits like a database does (Limits and quotas). A service cannot have a name that starts with kv-, because that is where instances live.
Connect a service#
On the instance's page, Connect a service sets REDIS_URL (or another name you type) as an ordinary environment variable of the service you pick and starts a new deploy of it. The password is shown on the page to roles that may see secrets. The page also has a redis-cli example.
Connecting is the same as adding the variable by hand (Environment variables and secrets), so the URL is stored encrypted like any other variable. To share one URL between several services, put it in an environment group.
Change or delete#
- Size and eviction can be changed on the instance's page. The instance restarts (a few seconds of dropped connections, the data is kept) and its status says "Updating". A bigger size grows the disk. A smaller size keeps the disk it has, because a disk cannot shrink: make sure the data fits before choosing a smaller size.
- Delete asks you to type the name. It deletes the instance and its data for good, and there is no backup to restore.
Who can do what#
| Action | Permission |
|---|---|
| See instances and their status | view |
| Create, resize and delete | deploy (Developer, Admin, Owner) |
| See the password and the connection URL, and connect a service | secrets (Developer, Admin, Owner) |
GET /api/v1/key-values/<id>/connection returns the URL with the password and needs secrets; a Viewer key gets 403.
Events#
Two webhook events exist for Key Value: key_value.available (an instance finished starting, or recovered) and key_value.failed (it stopped being healthy). They are webhook events only: they are not in the email settings. See Webhooks and notifications.
Related#
- Databases: managed Postgres, which is backed up.
- Templates: the Valkey template runs Valkey as a service you manage yourself.
- Environment variables and secrets: where
REDIS_URLgoes. - Limits and quotas: how instances count against the workspace.