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
guidal db create cache --engine redisRedis instances are managed with the same db commands as Postgres.
guidal db list
guidal db get cacheConnect a service
guidal db link cache --service apiThis injects the connection URL as an environment variable. Detach with guidal db unlink cache --service api.
Connect from your machine
guidal db proxy cacheThen point redis-cli at the local end of the tunnel:
redis-cli -h localhost -p 6379Clear it
guidal db flush cacheThis 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
guidal db metrics cacheMemory 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
| Plan | Max Redis instances |
|---|---|
| Starter | 1 |
| Pro | 3 |
| Team | 10 |
Delete
guidal db delete cache