Managed Valkey
Private Redis-compatible caches, bound to apps.
What it is
A Valkey cache — open-source and Redis-compatible — on a machine of its own in your region, reachable only inside your network. Bind it to an app and the app gets REDIS_URL with the cache's private address. Find it under Caches in the console.
Concepts
| Term | Meaning |
|---|---|
| Cache | One Valkey server on one machine, identified by the name you give it. |
| Node type | The machine it runs on, named like compute instance types (performance-2, performance-4, …). Valkey may use about 75 % of its memory for data. |
| Network | The private network the cache joins: your default network unless you choose another. Deployed apps run in the default network. |
| Private address | The cache's address inside its network: port 6380 with TLS (the default), 6379 for a plaintext cache. It is reserved before the machine is created and is the only address clients use. |
| TLS | On by default: the cache listens on no plaintext port at all, and replication and failover traffic between its nodes is encrypted too (see Encryption in transit). |
| Backup | An encrypted copy of the data in object storage, outside the cache's machines: one a day, kept 7 days, plus the ones you take (see Backups and restore). |
| Password | Generated at creation and filed in Secrets as VALKEY_<NAME>_PASSWORD. Clients sign in as the user default. |
| Eviction policy | What Valkey does when memory is full (see Reference). |
| Activity | The event stream on the cache page: every provisioning step, and what the machine reported. |
| Encryption | The data volume (append-only file and snapshots) is LUKS2, AES-256-XTS, with its own key (see below). |
Valkey keeps its data on a volume of its own. On every cache created since disk encryption existed that volume is encrypted with LUKS2 and a key for that volume alone, held by the control plane under the platform key (Key custody). The machine gets the key at boot, only while the volume is attached to it and only from its own address; it is never written to the machine's disk. A detached volume is unreadable, and deleting the cache deletes the key. A cache that reboots while the control plane is unreachable waits for it before Valkey starts. A cache created before encryption keeps an unencrypted volume: create a new cache, bind your apps to it, and delete the old one.
To use one of your KMS keys instead of the platform key, choose it under Encryption key when you create the cache (or pass "kmsKeyId"; you need kms:Encrypt on it). Disabling that key stops the cache from opening its volume at its next boot; deleting it makes the data unreadable for good. POST /cache/api/clusters/{id}/rotate-storage-key (cache:RotateCacheStorageKey) gives the volume a new key: the node swaps it in within five minutes while Valkey keeps running.
How to
Create a cache
Caches → Create cache, or:
POST /cache/api/clusters
{
"identifier": "sessions",
"nodeType": "performance-2",
"evictionPolicy": "allkeys-lru"
}Add "vpcId" to place it in a network other than the default one, "tls": false for a plaintext cache on port 6379, and "snapshotId" to start it with a backup's data. The response carries the cache in status creating. It becomes available when the machine reports that Valkey answers, usually within three minutes. If the node type is out of stock in the region, provisioning fails with a message naming what is in stock; delete the cache and create it with another type.
Connect from an app
On the app's page, Configuration → Cache → choose the cache → Bind & redeploy, or:
PUT /deploy/api/apps/{id}/cache
{ "cacheClusterId": "ewc-0123456789ab", "redeploy": true }Every service that runs the app's own image gets:
| Variable | Value |
|---|---|
REDIS_URL |
rediss://default:<password>@<private address>:6380 (TLS), or redis://…:6379 for a plaintext cache |
VALKEY_URL |
the same URL |
rediss:// means TLS. The cache's certificate is signed by the platform CA, which every app container already trusts (NODE_EXTRA_CA_CERTS and the system store point at it), so node-redis, ioredis, redis-py and go-redis connect without any setting.
Set "envPrefix": "SESSIONS_" to get SESSIONS_REDIS_URL instead, and bind more than one cache. The variables are computed at every rollout, so a rotated password reaches the app with its next deployment. Binding is refused when one of the app's machines is not in the cache's network. Unbind with DELETE /deploy/api/apps/{id}/cache?envPrefix=.
Binding needs deploy:ManageCacheBinding on the app and cache:ModifyCacheCluster on the cache.
Connection details on a binding in the app's Cache panel shows the host and port, and Reveal value shows the full REDIS_URL (needs secrets:GetSecretValue on the cache's password secret; the read is recorded). GET /deploy/api/apps/{id}/connections returns the same without the password.
Connect from an instance
Launch the instance in the cache's network, download the CA bundle (Connection → Download the CA bundle, or GET /cache/api/ca-bundle), then:
valkey-cli -h <private address> -p 6380 --tls --cacert dcloud-ca.pem -a '<password>'
# a plaintext cache:
valkey-cli -h <private address> -p 6379 -a '<password>'Caches → cache → Connection shows the address and the URL, and Reveal password shows the password to anyone holding secrets:GetSecretValue on its secret. Revealing it is recorded in the audit log.
Change the eviction policy
Caches → cache → Overview → Eviction policy, or:
PATCH /cache/api/clusters/{id}
{ "evictionPolicy": "allkeys-lfu" }The machine applies it within a minute, without a restart.
Rotate the password
Caches → cache → Connection → Rotate password, or:
POST /cache/api/clusters/{id}/password/rotate
{ "redeployApps": true }A new password is filed in Secrets as the next version. The machine takes it within a minute; from then on new connections with the old password are refused and connections already open stay open. With redeployApps (the default), every bound app is redeployed once the machine runs the new password.
Make a cache highly available
Choose Primary + 1 replica or Primary + 2 replicas under Availability when you create the cache, or pass "replicas": 1 (or 2):
POST /cache/api/clusters
{ "identifier": "sessions", "nodeType": "performance-2", "replicas": 1 }What you get:
- A primary and its replicas, each on a different physical host. Each node has its own encrypted volume. The replicas copy every write from the primary as it happens.
- Automatic failover. A Sentinel runs on every node; with one replica, a third small machine (the witness) runs one more, so there are always three votes. When two Sentinels agree the primary has stopped answering for 5 seconds, they promote a replica.
- One address that follows the primary. The cache's private address belongs to a private load balancer in your network. It sends connections on port
6380(6379for a plaintext cache) only to the node that is the primary and that its own Sentinel calls the primary, so an old primary that comes back never takes writes. The balancer passes TLS through untouched: it ends on the node.REDIS_URLis unchanged; after a failover, clients reconnect to the same address. On installations that have switched to it, the balancer is adedicatedload balancer on your VPC's own pair of load balancer machines (see Load balancing → Thededicatedtype):REDIS_URLthen names it, the name answers one address per machine, andREDIS_ADDRESSESlists both for clients that take a list; connections to a primary that stops being one are closed so clients reconnect. - Replica reads on port
6381of the same address (6382for a plaintext cache;REDIS_READ_URL), spread over the replicas that are in sync. - Sentinel for clients that speak it: the nodes' addresses on port
26379, master namedcloud(REDIS_SENTINELS,REDIS_SENTINEL_MASTER). Sentinels use the cache's password, and on a TLS cache they speak TLS too (turn on your client's Sentinel TLS option).
Overview → Nodes shows each node, whether it is the primary or a replica, how far each replica is behind, and the last failover. Every step of a failover (a Sentinel noticing, the vote, the promotion, the old primary rejoining as a replica) appears in Activity.
What a failover looks like, measured: we cut the power of a primary while a client wrote to the cache as fast as it could. Writes failed for 11 seconds, then went on at the same address; none of the roughly 98 000 acknowledged writes was lost. When the old primary came back, it rejoined as a replica on its own. Your client sees connection errors for those seconds, so let it reconnect and retry. Most Redis clients do that by default.
Replication is asynchronous. A write the primary acknowledged in the moment before it failed may not have reached a replica yet and is then lost (none was in our test, but it can happen under heavy load). For a write that must survive a failover, follow it with WAIT 1 100: it returns once a replica has the write.
A cache keeps the number of replicas it was created with; to change it, create a new cache (on your organization's own hosts it can change in place, see below). Each data node is billed as a node-hour; the witness and the load balancer are not billed.
Encryption in transit
New caches are TLS only. Valkey listens on port 6380 with TLS and on no plaintext port, so a client inside the network cannot skip TLS. On a cache with replicas, replication and the Sentinels speak TLS too. The certificate is issued by the platform CA (the same CA as managed Postgres) for the cache's address and every node's address, and is valid for two years (tlsCertNotAfter on the cache). Clients authenticate with the password; they present no certificate.
Choose Plaintext under Encryption in transit (or "tls": false) only for a client that cannot speak TLS. A cache keeps the choice it was created with; caches made before TLS existed stay plaintext.
Backups and restore
Every cache is backed up once a day. On a cache with replicas a replica in sync takes the backup, so the primary keeps serving undisturbed; the primary takes it only when no replica did within three minutes. The node reads a point-in-time RDB snapshot over the replication protocol, encrypts it with a key made for that backup alone (AES-256), and uploads it straight to object storage; the control plane never sees the data. Daily backups are kept for 7 days and are deleted with the cache.
Take one now with Caches → cache → Backups → Back up now, or:
POST /cache/api/clusters/{id}/snapshotsIt is pending until a node takes it up (within a minute), running while it is read and uploaded, then available with its key count, size and SHA-256. Backups you take are kept until you delete them (DELETE /cache/api/snapshots/{snapshotId}), also after the cache itself is deleted: Caches → Backups lists every backup of the organization, those of deleted caches marked, with Restore to new cache and Delete. List them with GET /cache/api/snapshots (all) or ?cacheId=… (one cache).
Restore makes a new cache from a backup; the cache it was taken from is never overwritten. Backups → Restore to new cache, or create a cache with "snapshotId":
POST /cache/api/clusters
{ "identifier": "sessions-restored", "nodeType": "performance-2", "snapshotId": "ecs-0123456789ab" }Before Valkey first starts, the new cache's first primary downloads the backup, checks its SHA-256, decrypts it and loads it; replicas then copy it from the primary. If any of that fails, Valkey does not start and the cache ends failed (the reason is in Activity), rather than coming up empty. Restoring needs cache:CreateCacheCluster on the backup as well as on the new cache. Choose a node type at least as large as the original: a backup bigger than the new cache's memory loads, but writes are then refused or evicted.
Permissions: cache:DescribeCacheSnapshots, cache:CreateCacheSnapshot, cache:DeleteCacheSnapshot.
When the node type is sold out
The provider sells from live stock per zone. A cache's zones are fixed (primary in de1a, replicas and the witness in de1b), so its fallback is a type, not a zone:
{ "capacityFallback": { "otherZones": false, "equivalentTypes": true }, "onStockOut": "wait", "capacityMaxWaitHours": 24 }equivalentTypes buys an equivalent type (same CPU architecture, same class or better, at least the vCPUs and memory, at most 1.25× the price plus 5 cents); requestedNodeType keeps what you asked for and nodeType is what is billed. onStockOut: "wait" keeps the cache waiting-for-capacity, with nothing built or billed, until the type is back or capacityMaxWaitHours (default 24) passes. otherZones: true is refused for now. The API default is to fail at once; the console defaults to waiting.
Reboot a cache
Caches → cache → Overview → Reboot, or POST /cache/api/clusters/{id}/reboot. Data survives: it is written to the cache's own volume. The status is rebooting until the machine reports again.
With replicas, a reboot restarts one node: the primary, unless you name another with { "nodeId": "<id>" }. Rebooting the primary is a failover test: a replica takes over and the cache stays available.
Delete a cache
Caches → cache → Danger zone → Delete cache, or DELETE /cache/api/clusters/{id}. The machine, its data volume, its daily backups and its password are removed; backups you took are kept until you delete them. Deleting is refused while an app is bound to the cache; unbind the app first.
With a final backup (the Take a final backup box, on by default; ?finalSnapshot=true in the API): a backup is taken first, counted and kept like one you took by hand (until you delete it, under Caches → Backups). The delete waits for it, usually under a minute; if it fails, nothing is deleted and the cache is available again, with the reason in Activity. The dialog says what keeping it costs, from the size of the newest backup and the backup rate per GiB-month.
Run outside Germany (Helsinki, fi1)
Caches are in Germany (de1) unless your organization decides otherwise. After an administrator turns on Allow EU locations outside Germany (Settings → Data location), choose region fi1 in the create form, or send "regionId": "fi1" (header X-EWS-Region: fi1, CLI --region fi1). The machines, their disks and the balancer are in Helsinki, Finland; the network must be one in fi1 too. Backups are stored in Germany (encrypted, in the platform's object storage). With replicas, the nodes are on separate hosts in the one Helsinki zone: a host failure is survived, the loss of the site is not. Without the setting the create answers 403.
On your organization's own hosts
When an operator runs your organization on hosts of your own (an office rack), a cache is the
same API, CLI, MCP, Terraform resource and console form, built on those hosts: machines of the
site's sizes (GET /cache/api/node-types lists them with the operator's price), each with its
own data disk, in your network — on the site that network is isolated from every other, so your instances in
it reach the cache and nothing else does. Each machine's other network connection (the
site's, for pulling Valkey and reporting to Deutsche Cloud) admits nothing but the operator's break-glass
SSH. Readiness, the password in Secrets, TLS, eviction, reboot and delete work as described
above. What differs there:
- The address is a virtual IP (
addressKind: "virtual-ip"). It is reserved in your network like any other address, and no machine owns it:keepalivedon the data nodes puts it on the node that is the primary. A node may hold it only when Valkey there says it is the primary, its own Sentinel agrees, and it can reach a majority of the cache's Sentinels — so a primary cut off from the others lets go of the address instead of serving beside the new one. Moving it needs nothing from Deutsche Cloud: a failover works with the control plane down. Measured on a rack: a powered-off primary was replaced in about 12.5 seconds (with the control plane stopped too), with no acknowledged write lost. A primary cut off from the other nodes let go of the address within 2 seconds. The writes it acknowledged in those seconds were not on a replica yet and were lost (27 in our test): useWAIT 1 100for a write that must survive. - Replicas can change on a live cache:
PATCH /cache/api/clusters/{id}with{"replicas": 1}(or2), and back with{"replicas": 0}(Terraform: changereplicas; console: Overview → Replicas). The URL never changes and the cache keeps serving; it ismodifyingmeanwhile. Going up, the new nodes start as replicas of the primary and count toward the majority only once they are in sync. Going down, the primary is kept and the others stop counting before their machines are deleted. From 1 to 2 replicas (or back), go through 0. - No replica read port: a virtual IP has one holder, so there is no port that spreads reads
over the replicas (
replicaPort: null,replicaPortNotesays why). Read from a replica through Sentinel: bound apps getREDIS_SENTINELSandREDIS_SENTINEL_MASTER(noREDIS_READ_URL). - The data disk is encrypted at rest (LUKS2, AES-256-XTS, one key per data disk), under
the platform key or your KMS key (
kmsKeyId), as in the platform's own regions. What differs is how the key reaches the node: never over the network. When a node boots it asks Deutsche Cloud to unlock its disk; Deutsche Cloud checks with the site's hypervisor that this disk is attached to exactly that running machine, then hands the key to that machine through the hypervisor's guest channel, on the input of the unlock command (never on a command line, never in a file). Every unlock, refused ones included, is in the cache's activity feed.POST /cache/api/clusters/{id}/rotate-storage-keyreplaces the key within five minutes, Valkey keeps running. Caches made on own hosts before this (storageEncrypted: false) stay unencrypted; encrypting one means a new cache and moving the data. - What that protects against, and what not. It protects disks, disk images and backups
taken off the rack (stolen, returned, discarded or copied), and a node's token that leaked:
whoever sends the request, the key only goes to the machine that holds the disk. It does
not protect against whoever has root on the rack's host or the site's hypervisor
credential: they can read the key on its way into the machine and in the machine's memory.
Where the rack is not yours, that is the site operator. Two more things to know:
- A rack that comes back changed stays locked. Before every unlock Deutsche Cloud checks that the
site's host is the one confirmed for it (certificate, name, hardware serials); if another
host answers, or the rack comes back after being unreachable longer than the site's
threshold (6 hours by default), the platform stops unlocking disks there until the
operator confirms the site, and tells you on the cache which of your nodes keep their
disks open because they are running. The operator can also suspend it by hand
(
dcloud operator providers set-key-release). Not caught: the whole rack taken intact and back online within the threshold, until the operator suspends it. - A node that restarts while Deutsche Cloud cannot reach the rack stays locked (Valkey does not start on it) until Deutsche Cloud can again; it then opens on its own. A failover needs nothing from Deutsche Cloud, but a whole-rack restart during a Deutsche Cloud outage leaves the cache down until Deutsche Cloud is back.
- The machines' memory is never written out by the site: stateful snapshots and live migration are off for them.
- A rack that comes back changed stays locked. Before every unlock Deutsche Cloud checks that the
site's host is the one confirmed for it (certificate, name, hardware serials); if another
host answers, or the rack comes back after being unreachable longer than the site's
threshold (6 hours by default), the platform stops unlocking disks there until the
operator confirms the site, and tells you on the cache which of your nodes keep their
disks open because they are running. The operator can also suspend it by hand
(
- Restoring from a backup and
capacityFallback(a site has no stock-outs) are refused with 400. - One site: all nodes are on the one rack, on separate machines; a node is survived, the loss of the site is not.
- Source filtering: every network interface of your machines there drops packets whose
source address or MAC is not the machine's own, so no machine can pose as another (or as the
cache) on your site network or in your network. The one exception is each data node's network
interface, which must send from the cache's virtual IP when it holds it; its site interface
is filtered. The platform sets this and keeps it set; Overview → Nodes (API:
nodes[].sourceFilter) shows it per interface, with the reason for the exception. - An app moved here from a cache with replicas in the platform's own regions loses
REDIS_READ_URL: it is absent, not pointed somewhere else, so a client that requires it fails at start rather than reading from the primary unnoticed. - Price: what the operator set for a cache node of that size (
cache-own.<site>.<size>.hour, monthly / 730, capped at the monthly price) per data node, not the machine price; the witness is not billed. Without a price the hours are counted and not billed.
Reference
Eviction policies
| Policy | When memory is full |
|---|---|
noeviction |
Writes are refused; nothing is dropped. The default. |
allkeys-lru |
The least recently used key is dropped. Use for a pure cache. |
allkeys-lfu |
The least frequently used key is dropped. |
volatile-lru |
The least recently used key with an expiry is dropped. |
volatile-lfu |
The least frequently used key with an expiry is dropped. |
volatile-ttl |
The key with an expiry closest to expiring is dropped. |
Machine
| Item | Value |
|---|---|
| Engine | Valkey 8.1, the official image |
| Port | 6379, on the private address only |
| Public address | Used for outbound traffic only; no inbound port is open to clients |
| Persistence | Append-only file (everysec) plus snapshots, on a volume of its own |
maxmemory |
75 % of the machine's memory |
| Reports | Every minute: health, memory used, the memory limit and the key count |
Statuses
| Status | Meaning |
|---|---|
creating |
The machine is being built, or has not reported a healthy Valkey yet. |
available |
Valkey answers on the private address. |
rebooting |
A reboot was requested and the machine has not reported since. |
modifying |
Replicas are being added or removed (own hosts); the cache serves. |
deleting |
The machine and its volume are being removed. |
failed |
Provisioning failed; the reason is on the Overview and in Activity. |
Billing
One node-hour per hour the machine exists, at the node type's price (cache.<node type>.hour). A cache with replicas is billed one node-hour per data node.
What is not supported
- Changing the number of replicas of an existing cache, except on your organization's own hosts (through 0 there).
- Turning TLS on or off for an existing cache (create a new one, from a backup to keep the data).
- Restoring a backup into the cache it came from (restore makes a new cache), or downloading a backup.
- Point-in-time recovery between backups.
- Changing the node type of an existing cache.
- Cluster mode (sharding).
- Access from outside the cache's network.
- Users other than
default.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Binding answers "… is not in it" | One of the app's machines is outside the cache's network. | Create the cache in the default network, where apps run. |
NOAUTH or WRONGPASS after a rotation |
The app still holds the previous password. | Redeploy the app. |
OOM command not allowed when used memory > 'maxmemory' |
noeviction and memory is full. |
Delete keys, set expiries, choose an evicting policy, or create a larger cache. |
Stuck in creating, then failed after 15 minutes |
The machine never reported a healthy Valkey. | Read Activity for the machine's last message, delete the cache and create it again. |