Skip to Content
DatabaseValkey key-value on Zenifra

How Zenifra Valkey works

This page shows how Zenifra managed Valkey is configured: what changes between the Key‑Value, Cache and Queues profiles, how much memory each plan uses, how data is written and replicated, and how the connection is protected. For day-to-day use, see Key‑Value, Cache and Queues with Valkey.

Summary

ItemHow it works
VersionValkey 9.1 (9.1.2)
ProfilesKey‑Value (db-*), Cache (cache-*) and Queues (queue-*)
Memory80% of the plan's RAM for data (maxmemory)
Full memoryKey‑Value and Queues: noeviction; Cache: allkeys-lfu
PersistenceKey‑Value and Queues: AOF on disk, with appendfsync everysec; Cache: in memory only
InstancesKey‑Value and Queues: 3 (one primary and two replicas) on the basic, premium and enterprise plans; 1 on starter. Cache: 1
Writeswith replicas, the primary only accepts writes with at least 1 connected replica
TLSalways, on every connection (valkeys://)
Userdefault, with access to keys and data commands

Version

  • Every Valkey is created and kept on version 9.1.2.
  • Version updates are handled by Zenifra.

To check your service's version:

INFO server

The valkey_version field shows the version.

Profiles

The same Valkey serves three profiles. The profile is chosen at creation and defines persistence, memory policy and replicas.

ProfilePlansDiskmaxmemory-policyAOF
Key‑Valuedb-starter, db-basic, db-premium, db-enterpriseyesnoevictionappendonly yes
Queuesqueue-starter, queue-basic, queue-premium, queue-enterpriseyesnoevictionappendonly yes
Cachecache-starter, cache-basic, cache-premium, cache-enterprisenoallkeys-lfuappendonly no

Memory and CPU per plan

maxmemory is set at creation and reapplied on every plan change. It applies to each instance.

PlanvCPURAMData (maxmemory)
db-starter0.3256 MB204 MB
cache-starter, queue-starter0.5512 MB409 MB
db-basic, cache-basic, queue-basic11 GB819 MB
db-premium, cache-premium, queue-premium22 GB1638 MB
db-enterprise, cache-enterprise, queue-enterprise88 GB6553 MB
  • maxmemory: 80% of the plan's RAM, rounded down to whole MB.
  • Key‑Value and Queues (noeviction): no key is removed to free space. When memory is full, new writes get the error OOM command not allowed when used memory > 'maxmemory', and reads keep working. Set a TTL on keys that expire and watch memory usage.
  • Cache (allkeys-lfu): when memory is full, Valkey removes the least frequently used keys, with or without a TTL, and writes keep working.

To check on your service:

INFO memory

The used_memory, maxmemory and maxmemory_policy fields show usage and the limit.

Connections

  • The connection string has the format valkeys://default:<password>@<host>:<port>/0: user default, database 0 and TLS.
  • Use a connection pool or one shared connection per process. Valkey clients send many commands over one connection, and opening a connection per request only adds latency.
  • Configure your application to reconnect on its own. Most clients do this by default.

To see how many connections are open:

INFO clients

The connected_clients field shows the total.

Persistence

  • Key‑Value and Queues write everything to the AOF (appendonly yes), on disk. The AOF is synced to disk every second (appendfsync everysec). After a restart, Valkey reloads the data from the AOF.
  • Periodic RDB snapshots are turned off (save ""): the AOF is the source of the data.
  • Each instance has its own disk, of the chosen size. The minimum is based on the plan's memory: 3 times 80% of the RAM, rounded up to whole GB, with a minimum of 1 GB.
PlanMinimum disk
db-starter1 GB
queue-starter2 GB
db-basic, queue-basic3 GB
db-premium, queue-premium5 GB
db-enterprise, queue-enterprise20 GB
  • Cache keeps data in memory only, with no disk and no AOF. After a restart, the Cache comes back empty, and your application should reload data from the source.
  • Profiles with a disk are included in automatic backups.

Replicas and high availability

Profilestarterbasic, premium, enterprise
Key‑Value1 instance3 instances: one primary and two replicas
Queues1 instance3 instances: one primary and two replicas
Cache1 instance1 instance
  • The Console connection always points to the primary. Replicas receive a continuous copy of the data, each on its own disk.
  • Instances always run on different servers, close to each other on the network, so a single server failure does not take down the primary and the replicas together.
  • min-replicas-to-write 1: with replicas, the primary only accepts writes when at least one replica is connected. With no replica connected, writes get the error NOREPLICAS, and reads keep working.
  • Each instance counts toward the plan price. For example, a Key‑Value db-basic costs 3 times the plan price, plus the additional storage of the 3 instances. See Database Plans.
  • Changing the plan in the Console accepts plans with the same number of instances: between db-basic, db-premium and db-enterprise (and the same for Queues), and between all Cache plans. To move a Key‑Value or Queue to a smaller plan, the data must fit in up to 90% of the new plan's maxmemory. See Change the plan.

Restart and recovery

  • Automatic primary failover: each instance runs a Valkey Sentinel. If the primary stops answering for 5 seconds, the Sentinels promote a replica (2 of the 3 must agree), and the Console host starts pointing to the new primary. In our tests, writes came back in about 10 seconds. The host and port do not change. It applies to services with replicas created from November 28, 2026.
  • When the former primary comes back, it joins as a replica of the new one and receives its data.
  • Copying to the replicas is asynchronous, as in any replicated Valkey: during a failover, writes from the last instant before the failure may not have reached any replica.
  • On starter and Cache, which have one instance, the primary restarts on the same host and port. On Key‑Value and Queues, it reloads the data from the AOF.
  • Replicas detect a lost connection within 10 seconds (repl-timeout 10) and get a ping from the primary every 2 seconds (repl-ping-replica-period 2), so replication resumes as soon as possible.
  • During platform maintenance, services with replicas restart one instance at a time.
  • Open connections drop during a restart. Configure your application to reconnect and retry idempotent operations.

Encryption and TLS

  • In transit: Valkey always uses TLS, including on private connections between applications. The connection string uses valkeys://. In your client, turn on the TLS option (tls, ssl or rediss/valkeys, depending on the library). See Connect to Valkey.
  • Host: each service has the host valkey-<id>.managed.zenifra.com. Always connect through it, not through the IP, so the certificate is validated by name.
  • Between the primary and the replicas: replication uses its own user, separate from the application user, with access only to replication commands.
  • At rest: Valkey disks are encrypted.

User and commands

  • The application user is default, with access to all keys and Pub/Sub channels. The password can be rotated at any time.
  • Server administration (configuration, replication, persistence and version) is handled by Zenifra. Commands in the @dangerous category and the ACL, CONFIG, MODULE, SHUTDOWN and REPLICAOF commands are refused with the NOPERM error. This includes, for example, KEYS, FLUSHALL, FLUSHDB, DEBUG and SORT.
  • INFO is allowed, so you can follow memory, connections and replication.
  • To walk through keys, use SCAN with MATCH and COUNT. To delete a group of keys, combine SCAN with UNLINK or DEL, or use a TTL.

Next steps

Last updated on

On this page