Skip to content
extraorbital
Documentation ExtraOrbital
Browse documentation

Data & storage

Redis

Add a Redis database for caching and queues.

Run in your project folder
npx extraorbital add redis

REST and TCP access the same data.

  1. 01 / Run the commandGet the service
  2. 02 / Read your .envUse its credentials
  3. 03 / Connect your appCall the SDK or API

Limits

LimitFree · PrototypePaid
Databases5No plan count cap
Storage256 MBUsage billed
Requests500K commands / moUsage billed
Bandwidth10 GB / moIncluded
BackupsNoneCharged as storage
Inactive resource30 days after last usePersistent

Free allowances are shared across the account. Provider limits still apply on paid plans.

Use it

REST example:

cache.ts
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:

queue-worker.ts
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.

VariablePurpose
UPSTASH_REDIS_REST_URLHTTP endpoint
UPSTASH_REDIS_REST_TOKENPrivate token for REST requests
REDIS_URLTLS connection string for a Redis client

Specifics

Options

Terminal
npx extraorbital add redis [--slug <name>] [--region <region>]
FlagDefaultDescription
--slugdefaultA second, fully separate database in the same project
--regionus-east-1One 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

UsagePaid rate
Storage$0.25 / GB-mo
Requests$0.20 / 100K
BandwidthIncluded

See pricing for team subscription fees, allowances, and billing terms. Plans and billing ↗