# Valkey

> Managed Valkey for caching, sessions, rate limiting, and ephemeral state. Speaks the Redis protocol.

Valkey is Watasu's managed in-memory data service. It speaks the Redis protocol, so any Redis client library works against it without changes.

Use Valkey for fast, ephemeral state. Use [PostgreSQL](https://docs.watasu.io/addons/postgresql.md) when the data must be your long-term system of record.

## When to reach for Valkey

* caching computed values or query results
* session storage
* rate limiting and throttling
* ephemeral coordination (locks, leader election with TTL)
* queue acceleration

## Create

```bash
watasu addons:create valkey --app my-app
```

Pass a plan to pick a tier:

```bash
watasu addons:create valkey:premium-0 --app my-app
```

`hobby-0` is a non-persistent 25 MiB cache at €1/month. The active Premium plans range from `premium-0` (50 MiB, €5/month) to `premium-14` (100 GiB, €1,100/month). Every Premium plan includes AOF persistence, one managed HA standby, and automatic failover. The plan numbers are not consecutive; use the catalog table to select a supported size.

**Storage backend:** Valkey uses **network-attached storage** for persistence. Premium adds a managed standby and automatic failover. It does not promise three data replicas or local NVMe.

See [Add-on Plans](https://docs.watasu.io/reference/addon-plans.md) for the full catalog.

## Connect from your app

After attachment, your app gets:

| Variable    | Purpose                       |
| ----------- | ----------------------------- |
| `REDIS_URL` | Redis-protocol connection URL |

The variable name keeps the Redis prefix on purpose so existing libraries and frameworks "just work."

## Open an interactive session

```bash
watasu valkey:cli --app my-app
```

The legacy `redis:cli` alias still works for muscle memory.

## Backups

Premium plans support manual and scheduled backups. Hobby 0 is non-persistent and has no backup contract.

### Capture

```bash
watasu addons:backups:capture my-cache
```

### List

```bash
watasu addons:backups my-cache
```

### Restore

Restores create a replacement add-on, then you promote it. Restore from a managed backup or from a local `.rdb` file:

```bash
watasu addons:restore my-cache ./backup.rdb --name my-cache-restored
watasu addons:promote my-cache-restored
```

For the full restore workflow, see [Backups and Restores](https://docs.watasu.io/workflows/backups-and-restores.md).

## Tips

* Treat Valkey contents as expendable unless you've explicitly chosen a persistent plan with backups.
* Set TTLs on everything you can — unbounded keyspaces are how Valkey instances run out of memory at the worst possible moment.
* For pub/sub or fan-out patterns at scale, [Redpanda](https://docs.watasu.io/addons/redpanda.md) is a better fit.

[View this page on the web](https://docs.watasu.io/addons/valkey/)
