# Redis

A managed Redis for your apps: a cache, a job queue, sessions, rate limits.

## What you get

Each Redis is [Valkey 8](https://valkey.io), the open-source Redis, protocol-compatible with Redis clients and libraries. One size: **256 MB of memory** and **1 GB of storage**. It runs in its own microVM, reachable only by the apps you attach it to. There is no public address and no TLS: traffic never leaves Deplane's private network.

```sh
$ deplane redis create cache
$ deplane redis attach cache --app my-app
```

Attaching gives the app `REDIS_URL`, for example `redis://default:PASSWORD@kv--cache:6379/0`, and rolls out a new release with it. The password is 32 random characters; Deplane shows it nowhere else. An app has one Redis, a Redis may serve several of your apps (and their workers and cron jobs), and an app may have both a database and a Redis. Pull request previews do not get the Redis.

In the dashboard, open **Databases** and find **Redis**.

A [template](templates.md) that needs a Redis creates and attaches one for you, named after the app (`APP-redis`).

## Persistence

Data is kept on disk two ways: every write is logged and flushed to disk once a second (append-only file), and Redis also writes a snapshot every hour that something changed (every 5 minutes when busy). After a restart you lose at most the last second of writes.

## Memory: cache or queue

Redis keeps everything in memory, up to 200 MB of data. When it is full, writes are refused with an `OOM` error and nothing is evicted, which is what a job queue needs: no job is ever silently dropped.

To use it as a cache, give keys an expiry (`SET key value EX 3600`), so old entries go away by themselves. Setting the eviction policy yourself is not supported.

## Backups and restore

Every Redis is backed up every night, at a time of its own between 01:00 and 05:00 UTC, as a fresh snapshot, encrypted, with an off-site copy. Back it up now with `deplane redis backup NAME` (once an hour) and list backups with `deplane redis backups NAME`. Backups are kept for the backup window: 3 days, or your plan's backup retention if that is shorter. The newest backup that worked is kept longer, until a newer one works.

`deplane redis restore NAME BACKUP-ID` replaces the Redis's data with a backup. The Redis stops while the restore runs (usually a minute or two) and starts again by itself; data written since the backup is lost. If a restore fails once it has started replacing the data, the Redis starts empty: restore again or contact support. There is no point-in-time restore.

## Limits

- One size: 256 MB memory (200 MB of data), 1 GB storage. It counts 256 MB against your plan's memory, not as an instance.
- Redis per team: your plan's (Beta: 1). See [limit_redis](errors.md#limit_redis).
- Modules, clustering, replicas and TLS are not available.
- If every Redis slot on the platform is in use, creating one is refused with [no_redis_space](errors.md#no_redis_space); we are alerted and add room.
- An [AI tool](mcp.md) can list, create, attach, detach and back up a Redis. Destroying or restoring one, and setting `REDIS_URL` by hand ([mcp_redis_url](errors.md#mcp_redis_url)), are for people only.

## Destroy

`deplane redis destroy NAME` removes `REDIS_URL` from its apps and deletes the Redis and its data. It asks for your passkey. Its backups are kept for the backup window (3 days at most), then deleted.
