Managed Redis
Managed Redis on Lizard is a Redis server for caching, queues, rate limiting and pub/sub. New instances run Redis 8 by default. Add one with lizard add redis; your services read REDIS_PRIVATE_URL or REDIS_URL through a reference such as ${{redis.REDIS_PRIVATE_URL}}. It has no eviction policy and no append-only file, so keep only data you can rebuild in it. For an overview and prices, see the Managed Redis page.
Provision
lizard add redisThe first Redis addon is named redis, so ${{redis.REDIS_URL}} works immediately.
Environment variables
| Variable | Description |
|---|---|
REDIS_URL | Full connection string over the public endpoint (redis://…) |
REDIS_PRIVATE_URL | Connection string over the project’s private network (<name>.lizard.internal:6379) |
Both strings use the form redis://default:<password>@<host>:<port>. The private one works only from services in the same project; see private networking.
Connect a service
lizard secrets set REDIS_URL='${{redis.REDIS_PRIVATE_URL}}' --service api
lizard redeploy --service apiThe reference resolves at deploy time; consumers pick up the addon’s current values on their next deploy. Use REDIS_URL for clients outside the project. Every service in the project also gets the addon’s public REDIS_URL at the lowest precedence; an explicit reference overrides it.
Does Managed Redis keep data?
Managed Redis can lose recent writes. It has no eviction policy and no append-only file. If it runs out of memory, the instance restarts and may lose those writes. Use it for data you can rebuild, and keep data you cannot lose in Managed Postgres.
Common uses
- Cache: store computed results keyed by request.
- Queue / worker: pair Redis with a worker-mode service that consumes jobs. Run a queue consumer walks through the redis-worker example.
- Rate limiting / sessions: fast shared state across replicas.
# A worker that drains a Redis queue
lizard add -r your-org/worker -n jobs --no-deploy
lizard service set jobs --set containerPort=0
lizard secrets set REDIS_URL='${{redis.REDIS_PRIVATE_URL}}' --service jobs
lizard redeploy --service jobsBrowse keys
Open the Redis browser in the dashboard (lizard open) to inspect keys and values. For local access with the addon’s connection values:
lizard run --service redis -- sh -c 'exec redis-cli -u "$REDIS_URL"'Grow storage
lizard scale --service redis --storage 4096See also
- Managed Addons: naming, references, and the dashboard browsers.
- Background Workers: pairing Redis with a queue-consuming worker.
lizard run --service redis starts the command on your machine with the addon’s public connection values. Install redis-cli locally.
Updated