Services
Redis
A Redis 7 instance per project for caching, queues, sessions and rate limiting.
Deploy
Click Deploy on the Redis card. You get one value, REDIS_URL. When TLS is on it starts with rediss:// (two s), otherwise redis://.
- Your app signs in as the
defaultuser, which can run every command except admin ones such asCONFIG,ACL,SHUTDOWN,MONITORandREPLICAOF. - Data is persisted with an append-only file, so keys survive restarts.
- Memory is capped at 32 MB on Free and 256 MB on Pro, with the
noevictionpolicy. A full Redis refuses writes instead of silently dropping data, which keeps queued jobs safe.
Connect
import Redis from "ioredis";
export const redis = new Redis(process.env.REDIS_URL!);
await redis.set("greeting", "hello", "EX", 60);
console.log(await redis.get("greeting"));redis-cli -u "$REDIS_URL" pingimport os, redis
r = redis.from_url(os.environ["REDIS_URL"])
r.set("greeting", "hello", ex=60)Common patterns
async function cached<T>(key: string, ttlSec: number, load: () => Promise<T>): Promise<T> {
const hit = await redis.get(key);
if (hit) return JSON.parse(hit);
const value = await load();
await redis.set(key, JSON.stringify(value), "EX", ttlSec);
return value;
}async function allow(userId: string, limit = 20, windowSec = 60) {
const key = `rate:${userId}`;
const count = await redis.incr(key);
if (count === 1) await redis.expire(key, windowSec);
return count <= limit;
}Because memory is capped and nothing is evicted, always give cache keys an expiry (EX). BullMQ and other queue libraries work too.
For BullMQ with ioredis, create the connection with maxRetriesPerRequest: null.
Manage
- Reset password changes it live. Apps still using the old one are disconnected until you update
REDIS_URL. - The nightly check records memory use for the Usage page.
- Delete removes the instance and its data.
Use with AI
Ask an agent to add caching, queues or rate limiting backed by your project's Redis.
- 1
Open a terminal in your app's folder and start Claude Code.
claude
- 2
Paste the prompt below and press Enter. Approve the file edits and commands it asks about.
- 3
Optional: save a short note about CloudHike.dev in CLAUDE.md so every session knows about it.
Read https://cloudhike.dev/docs/md/redis, then add Redis to this app using my CloudHike.dev Redis service. - REDIS_URL is in my env file (if not, follow https://cloudhike.dev/prompt.md to download it). - Use ioredis (or this language's standard client) from server code only, with one shared connection. - Add [caching / a job queue / rate limiting] for [describe the feature]. - Memory is small and nothing is evicted, so give every cache key an expiry.
Replace the placeholders in <angle brackets> before sending. Always review what the agent changes.
