Redis
Add a Redis database for caching and queues.
npx extraorbital add redisREST and TCP access the same data.
- 01 / Run the commandGet the service
- 02 / Read your .envUse its credentials
- 03 / Connect your appCall the SDK or API
Limits
| Limit | Free · Prototype | Paid |
|---|---|---|
| Databases | 5 | No plan count cap |
| Storage | 256 MB | Usage billed |
| Requests | 500K commands / mo | Usage billed |
| Bandwidth | 10 GB / mo | Included |
| Backups | None | Charged as storage |
| Inactive resource | 30 days after last use | Persistent |
Free allowances are shared across the account. Provider limits still apply on paid plans.
Use it
REST example:
import { Redis } from "@upstash/redis";
const redis = Redis.fromEnv(); // reads UPSTASH_REDIS_REST_URL and _TOKEN
await redis.set("session:brave-fox", { step: 3 }, { ex: 3600 });
const session = await redis.get("session:brave-fox");TCP example:
import { createClient } from "redis";
const redis = createClient({ url: process.env.REDIS_URL });
await redis.connect();
await redis.lPush("jobs", JSON.stringify({ id: 1 }));Environment variables
The CLI writes these to .env or an existing .env.local.
| Variable | Purpose |
|---|---|
UPSTASH_REDIS_REST_URL | HTTP endpoint |
UPSTASH_REDIS_REST_TOKEN | Private token for REST requests |
REDIS_URL | TLS connection string for a Redis client |
Specifics
Options
npx extraorbital add redis [--slug <name>] [--region <region>]| Flag | Default | Description |
|---|---|---|
--slug | default | A second, fully separate database in the same project |
--region | us-east-1 | One of us-east-1, eu-central-1, ap-southeast-1 |
Connection choice
Use REST in serverless and edge runtimes. Use TCP with a standard Redis client. Both access the same database.
Pricing
| Usage | Paid rate |
|---|---|
| Storage | $0.25 / GB-mo |
| Requests | $0.20 / 100K |
| Bandwidth | Included |
See pricing for team subscription fees, allowances, and billing terms. Plans and billing ↗