kvbox.cloud
Guides

Managed Redis

A Redis kvbox runs for you, served by Valkey. Give it a name; link a box to it or open it to the internet.

A managed Redis is one kvbox creates and runs. You give it a name and get back a password and a connection string. There is no box to look after: no size to pick, nothing to install, and it never shows in kvbox ls.

The server is Valkey 9, the open-source continuation of Redis. It speaks the Redis protocol, so redis-cli and every Redis client library work with it unchanged.

kvbox redis create cache                 # Valkey 9, 5 GB of storage, password generated
kvbox redis ls                           # your Redis databases
kvbox redis info cache                   # status, clients, memory and storage used, how to connect
kvbox redis password cache               # the password, and the strings with it filled in

create prints the password and the connection string. Only the name is needed; the rest has defaults you can change:

OptionDefault
--password <password>generated
--storage <GB>5
--near <box>any host; with it, the host of that box (a link from it then stays on that host's bridge)
--location <country or region>your default location; with it, only hosts inside it

There is one login: the user default with the password. A Redis and a box of the same account cannot share a name.

Who can reach it

Nobody, until you say so. There are two ways in.

A box of yours, privately. Link it, and inside that box the server is <name>.<account>.kvbox:6379 (your username, or the org's slug for an org's Redis):

kvbox redis create cache --near api      # on the same server as box api
kvbox redis link cache api               # api may reach it
kvbox exec api -- redis-cli -u "redis://default:<password>@cache.<account>.kvbox:6379" ping
kvbox redis unlink cache api

A link works wherever the two are. On the same server it is the shortest path, so make the Redis next to the box (--near api) or a new box next to it (kvbox new worker --near cache) when you can; on two servers the connection goes through the encrypted tunnel between them. The private connection is plain redis://: on one server it never leaves it, between two it travels encrypted. A box has no redis-cli until you install it (sudo apt-get install -y redis-tools); your app's Redis library needs nothing.

The internet. Open it, and it gets an address on its host:

kvbox redis public cache on              # rediss://default:****@<host>:<port>
kvbox redis public cache off

The address is its own for its whole life: turning it off and on, stopping and starting it, all keep the same host and port. The public address is TLS only, which is what the second s in rediss:// says; a plain redis:// connection to it fails. The certificate is the server's own and self-signed, so a client has to be told not to verify it: redis-cli --tls --insecure -u "rediss://…", rejectUnauthorized: false in ioredis and node-redis, ssl_cert_reqs=None in redis-py. Anyone with the address and the password gets in; keep the password long (the generated one is).

Password

kvbox redis password cache shows it to anyone who can see the Redis. kvbox redis password cache --reset generates a new one. New connections need it at once; connections already open stay open until they close.

Memory

A Redis keeps all its data in memory. Yours has about 1.5 GB for it (three quarters of the 2 GB its machine has). kvbox redis info cache shows how much is used.

When the memory is full, writes are refused with an error and reads keep working. Nothing is ever deleted to make room: it is a database, not a cache that forgets. If you use it as a cache, give your keys an expiry (SET key value EX 3600). There is one size for now.

Storage

Every write is also appended to a file on its storage and synced to disk once a second, so the data is still there after a restart; a crash can lose the last second. kvbox redis info cache shows what is used of the storage and warns when it is nearly full.

kvbox redis grow cache 5                 # to 5 GB

Storage only grows. Growing restarts a running Redis once, a few seconds without connections. The file is tidied up by itself as it gets long, and until then it holds up to about twice the data, with the old and the new copy both on the storage while it is tidied: the storage needs about three times what the memory holds. The default 5 GB is that for a full memory; grow it only if info warns.

Stop, start, delete

kvbox redis stop cache                   # the data stays; only the storage is charged
kvbox redis start cache                  # the same addresses and the same data as before
kvbox redis rm cache                     # asks first; the data goes with it (its backups stay)

Backups

kvbox redis backup create cache          # start a backup; it runs in the background (--wait stays)
kvbox redis backup ls cache              # its backups, newest first; `ls` alone lists every Redis's
kvbox redis backup restore cache <id>    # the data becomes the backup's; asks first
kvbox redis backup rm cache <id>         # delete a backup for good; asks first
kvbox redis backup schedule cache --off  # no nightly backup (--at <hour> UTC, --on; alone: shows when)
kvbox redis create cache --from-backup <id> # a new Redis on a backup's data, a removed one's too

A backup is the storage at one instant, taken while it runs, encrypted and kept off its host: the same backups as a volume's. Valkey loads its append-only file from it as after a restart. restore throws away what was written since and restarts it on the backup's data; the address, links and password stay. 2 backups in any 24 hours.

Each database is also backed up on its own every night, from the moment it is created, at an hour picked for it between 00:00 and 05:00 UTC. kvbox redis backup schedule cache shows when (and how the last one went), --at 3 moves it to 03:00 UTC, --off stops it and --on starts it again. A nightly backup does not count toward the 2 a day you may take yourself; backup ls shows it as by schedule. It is skipped while the account may not spend (out of credit or suspended), and one that fails is tried again within the hour for a few hours. A stopped database is backed up too. Every backup is kept 30 days.

A backup outlives its Redis: after kvbox redis rm, kvbox redis backup ls still lists it, and kvbox redis create <name> --from-backup <id> makes a new Redis on its data with a new password and at least the backup's storage. A backup of a Redis that still exists is put back with restore instead. An org's backup makes a Redis in that org: add --org <org> to create.

Price

It costs what runs it plus its storage, by the hour: about $7.30 a month with 5 GB, and $0.06 a month for each further GB. Stopped, only the storage is charged ($1.30 a month for 5 GB). create and info print the estimate for yours. In kvbox usage it is two lines: the Redis under its name, and its storage as a volume named redis- and six characters.

Orgs

A Redis belongs to you or to an org, like a box: --org <slug> on any command. Members see an org's Redis databases and their passwords and may stop and start them; changing or deleting one is for whoever created it and for the org's admins.

Not yet

A schedule is daily only. A backup cannot yet be copied into a second Redis while its own still exists. There is one size, one user and no settings to tune: no choice of memory, no cache mode that drops old keys when full, no replicas.

On this page