Skip to content

Redis and Valkey

Redis and Valkey are database engines like PostgreSQL, MySQL and MariaDB. Since v0.10.0 each instance is its own container of a Falak image (falak-redis 7.4 and 8, falak-valkey 8.1): its own data volume, memory limit, password and TLS certificate, on the environment’s private Docker network. Nothing is installed on the host, and any server can run one.

Everything common to database containers — networking, limits, upgrades, deletion — is on Create databases and users.

  1. On the canvas: + Create → Database.
  2. Pick Redis or Valkey, the version and a server.
  3. Name the instance (for example cache); the name is what references use. Adjust memory, eviction and persistence if the defaults don’t fit.
  4. Create. The card turns Active once the container runs.
Field Rule
Memory Default 128 MB, at least 32 MB. maxmemory is set to 80 % of it
Disk Default 2 GB
Eviction Default noeviction; see Memory and eviction
Persistence Default rdb; see Persistence

Each instance has exactly one user, default. The Databases & users tab doesn’t apply to Redis and Valkey.

Eviction decides what happens once an instance is full:

Policy Use it for
noeviction (default) Queues and anything that must never silently lose a key — writes fail instead with OOM
allkeys-lru / allkeys-lfu A pure cache: evict the least recently/frequently used key regardless of TTL
allkeys-random A cache where recency doesn’t matter
volatile-lru / volatile-lfu / volatile-random Evict only keys with a TTL set, by the same logic
volatile-ttl Evict the key closest to expiring

Change memory, eviction and persistence under Overview → Limits & settings. The config is rendered again and the container restarts.

Mode Behavior
rdb (default) Periodic point-in-time snapshots (dump.rdb)
aof Every write logged to an append-only file; less data loss after a crash than rdb
none Nothing written to disk

Reference the instance from a site’s variables:

REDIS_URL=${{ cache.REDIS_URL }}
Key Value
REDIS_URL redis://default:<password>@<host>:<port> (rediss:// when TLS is required)
REDIS_HOST, REDIS_PORT The instance’s host and port for this site
REDIS_PASSWORD The default user’s password
REDIS_CLIENT phpredis

The host and port follow the rules for every database container: falak-db-<id> and 6379 for containers of the environment on the same server, 127.0.0.1 and the host port for native sites there, and a private address for other servers — never a public one. See Remote access.

Redis can’t serve TLS and plaintext on one port. An instance listens in plaintext on the environment’s private network unless Require TLS (or public access) is on; then it is TLS-only and REDIS_URL uses rediss://.

Overview → Rotate password. The old password stays valid next to the new one for 24 hours (FALAK_DB_PASSWORD_OVERLAP_HOURS), so sites keep working until their next deploy picks up the new one.

Redis and Valkey instances are backed up like SQL databases: an RDB snapshot (BGSAVE), compressed and encrypted on the server, with schedules, restores and restore drills. A restore replaces dump.rdb while the engine is stopped (an AOF directory is moved aside). See Backups and drills. Point-in-time recovery is for SQL engines only.

  • The password is stored as a SHA-256 in the instance’s ACL file, never in plaintext, and reaches the container as a file.
  • The default user may run everything except CONFIG, DEBUG and MODULE.
  • The agent talks to the engine over a private Unix socket inside the container.
  • Out of scope for now: Redis Cluster and Sentinel, replicas, per-app ACL users and modules (RedisJSON, search).
  • A Compose stack’s redis or valkey service can become a Falak instance (see Compose apps), but the container’s data is not copied into it.
Action Permission Roles
View databases.view all
Create/delete instances, change settings, rotate password, back up databases.manage owner, admin, developer
Reveal the password databases.credentials.reveal owner, admin, developer
Restore databases.restore owner, admin