Skip to main content
A Redis store is one Valkey 9 server. Valkey speaks the Redis protocol, so Redis clients work with it. Create the store on the Storage page and connect it to your project as described in Storage. Your Ktor servers then get its connection details as env vars.

Sizes

You pick the memory. The store also gets a disk twice that size for its data file, and 0.25 vCPU. Only the disk is billed. The data limit is a little below the memory: Valkey keeps an eighth of it, at least 64 MB, free for buffers and for rewriting its data file. On the free plan, a Redis store has 256 MB memory.

When the store is full

The store doesn’t evict keys to make room. Once the data reaches the limit, commands that add data fail with an out-of-memory error. Reads and deletes keep working.
  • Give cache entries an expiry, for example with SETEX or EXPIRE.
  • Resize the store if it needs more room.

Persistence

Valkey writes every change to an append-only file on disk and flushes it once a second. When the store restarts, for a resize or new credentials, it loads its data from that file. If it crashes, the last second of writes can be lost. There are no backups of Redis stores and no restore. Keep data you can’t rebuild in Postgres.

Env vars

A connected project gets these runtime env vars, with the connection’s prefix in front if it has one: The connection is a plain redis:// connection without TLS, as the user default.
Only the apps of connected projects can reach the store. You can’t connect to it from your own machine. For local development, run Redis or Valkey on your machine and fall back to it when the env vars are missing.

Connect from Ktor

This example uses Lettuce (io.lettuce:lettuce-core) in your server module:
If you connected the store with a prefix, read the prefixed name, for example CACHE_REDIS_URL.

Resize

Open the store’s Settings tab and click Resize. See Resize a store for the steps.
  • Valkey restarts once with the new memory and disk, then loads its data from disk.
  • Connections drop briefly while it restarts. Your apps have to reconnect.
  • The store can’t shrink again.

What is turned off

Modules and the DEBUG command are turned off, and protected settings can’t be changed with CONFIG SET.