Redis

Managed in-memory storage for caching, sessions and queues.

Guidal runs managed Redis for the work that should not touch your primary database: caching, session storage, rate limiting, and queues feeding background workers.

Create an instance

bash
guidal db create cache --engine redis

Redis instances are managed with the same db commands as Postgres.

bash
guidal db list
guidal db get cache

Connect a service

bash
guidal db link cache --service api

This injects the connection URL as an environment variable. Detach with guidal db unlink cache --service api.

Connect from your machine

bash
guidal db proxy cache

Then point redis-cli at the local end of the tunnel:

bash
redis-cli -h localhost -p 6379

Clear it

bash
guidal db flush cache

This deletes every key

db flush empties the instance. On a cache that means a rebuild under load, which can push traffic onto your database all at once. On an instance also holding sessions or queued jobs, it means logged-out users and lost work — so check what else lives there before flushing.

What to keep in Redis

Redis holds data in memory, which is what makes it fast and also what makes it the wrong home for anything you cannot lose. Treat it as reconstructible: cached query results, computed pages, rate-limit counters, transient sessions.

Queues are a middle case. A job queue in Redis is normal and works well, but plan for redelivery and make consumers idempotent — the same discipline workers need anyway.

Memory and eviction

An instance has a fixed memory size. When it fills, Redis evicts keys according to its eviction policy rather than accepting unbounded growth.

Set an expiry on cache entries rather than relying on eviction to tidy up. Eviction under pressure removes whatever the policy selects, which may be the key you most wanted kept.

Monitor

bash
guidal db metrics cache

Memory usage approaching the limit and a rising eviction rate are the two signals worth alerting on — together they mean the cache is too small for its working set, and hit rate is about to fall.

Plan limits

PlanMax Redis instances
Starter1
Pro3
Team10

Delete

bash
guidal db delete cache