Upstash — Serverless Redis, Kafka & QStash

You are an expert in Upstash, the serverless data platform for Redis, Kafka, and QStash. You help developers add caching, rate limiting, session storage, message queuing, and scheduled jobs to serverless and edge applications — with HTTP-based APIs that work on Vercel Edge, Cloudflare Workers, and AWS Lambda without persistent connections.

25 stars

Best use case

Upstash — Serverless Redis, Kafka & QStash is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

You are an expert in Upstash, the serverless data platform for Redis, Kafka, and QStash. You help developers add caching, rate limiting, session storage, message queuing, and scheduled jobs to serverless and edge applications — with HTTP-based APIs that work on Vercel Edge, Cloudflare Workers, and AWS Lambda without persistent connections.

Teams using Upstash — Serverless Redis, Kafka & QStash should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/upstash/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/TerminalSkills/skills/upstash/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/upstash/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Upstash — Serverless Redis, Kafka & QStash Compares

Feature / AgentUpstash — Serverless Redis, Kafka & QStashStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

You are an expert in Upstash, the serverless data platform for Redis, Kafka, and QStash. You help developers add caching, rate limiting, session storage, message queuing, and scheduled jobs to serverless and edge applications — with HTTP-based APIs that work on Vercel Edge, Cloudflare Workers, and AWS Lambda without persistent connections.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Upstash — Serverless Redis, Kafka & QStash

You are an expert in Upstash, the serverless data platform for Redis, Kafka, and QStash. You help developers add caching, rate limiting, session storage, message queuing, and scheduled jobs to serverless and edge applications — with HTTP-based APIs that work on Vercel Edge, Cloudflare Workers, and AWS Lambda without persistent connections.

## Core Capabilities

### Serverless Redis

```typescript
import { Redis } from "@upstash/redis";

const redis = Redis.fromEnv();            // Uses UPSTASH_REDIS_REST_URL + TOKEN

// Caching
async function getCachedUser(userId: string): Promise<User> {
  const cached = await redis.get<User>(`user:${userId}`);
  if (cached) return cached;

  const user = await db.users.findById(userId);
  await redis.set(`user:${userId}`, user, { ex: 3600 });  // 1 hour TTL
  return user;
}

// Rate limiting
import { Ratelimit } from "@upstash/ratelimit";

const ratelimit = new Ratelimit({
  redis,
  limiter: Ratelimit.slidingWindow(10, "10 s"),  // 10 requests per 10 seconds
  analytics: true,
});

// In API route / middleware
const { success, limit, remaining, reset } = await ratelimit.limit(userId);
if (!success) {
  return new Response("Too Many Requests", {
    status: 429,
    headers: {
      "X-RateLimit-Limit": limit.toString(),
      "X-RateLimit-Remaining": remaining.toString(),
      "X-RateLimit-Reset": reset.toString(),
    },
  });
}

// Session storage
await redis.hset(`session:${sessionId}`, { userId: "42", role: "admin", cart: JSON.stringify(items) });
const session = await redis.hgetall(`session:${sessionId}`);
await redis.expire(`session:${sessionId}`, 86400);  // 24h TTL
```

### QStash (Serverless Message Queue)

```typescript
import { Client } from "@upstash/qstash";

const qstash = new Client({ token: process.env.QSTASH_TOKEN! });

// Publish message to endpoint
await qstash.publishJSON({
  url: "https://myapp.vercel.app/api/process-order",
  body: { orderId: "ord-123", action: "fulfill" },
  retries: 3,
  delay: "30s",                           // Delay delivery by 30s
});

// Schedule recurring
await qstash.publishJSON({
  url: "https://myapp.vercel.app/api/daily-report",
  cron: "0 9 * * *",                     // Daily at 9 AM
});

// Batch
await qstash.batchJSON([
  { url: "https://myapp.vercel.app/api/send-email", body: { to: "user1@example.com" } },
  { url: "https://myapp.vercel.app/api/send-email", body: { to: "user2@example.com" } },
]);

// Callback URL (webhook when processing completes)
await qstash.publishJSON({
  url: "https://myapp.vercel.app/api/long-task",
  body: { taskId: "task-1" },
  callback: "https://myapp.vercel.app/api/task-complete",
  failureCallback: "https://myapp.vercel.app/api/task-failed",
});
```

### Upstash Workflow

```typescript
import { serve } from "@upstash/workflow/nextjs";

export const { POST } = serve(async (context) => {
  const { orderId } = context.requestPayload;

  // Step 1 (durable)
  const order = await context.run("fetch-order", async () => {
    return await db.orders.findById(orderId);
  });

  // Step 2
  await context.run("charge-payment", async () => {
    await stripe.charges.create({ amount: order.total * 100, customer: order.customerId });
  });

  // Sleep (durable)
  await context.sleep("wait-for-fulfillment", 60 * 60);  // 1 hour

  // Step 3
  await context.run("send-shipping-notification", async () => {
    await resend.emails.send({ to: order.email, subject: "Order Shipped" });
  });
});
```

## Installation

```bash
npm install @upstash/redis @upstash/ratelimit @upstash/qstash
```

## Best Practices

1. **HTTP-based** — Upstash Redis uses HTTP, not TCP; works on edge/serverless without connection pooling
2. **Rate limiting** — Use `@upstash/ratelimit` with sliding window; built for API protection on edge
3. **QStash for async** — Use QStash instead of SQS/BullMQ on serverless; delivers to any HTTP endpoint
4. **Edge-compatible** — All Upstash SDKs work on Vercel Edge, CF Workers, Deno Deploy; no Node.js APIs needed
5. **TTL on everything** — Set expiration on cache keys; prevent stale data and control costs
6. **Pipeline for batch** — Use `redis.pipeline()` for multiple operations; single HTTP round-trip
7. **Workflow for durable** — Use Upstash Workflow for multi-step processes; survives serverless timeouts
8. **Free tier** — 10K commands/day free; great for prototyping and small projects

Related Skills

upstash-redis-kv

25
from ComeOnOliver/skillshub

Read and write to Upstash Redis-compatible key-value store via REST API. Use when there is a need to save or retrieve key-value data, use Redis features (caching, counters, lists, sets, hashes, sorted sets, etc.) for the current interaction, or when the user explicitly asks to use Upstash or Redis.

upstash-qstash

25
from ComeOnOliver/skillshub

Upstash QStash expert for serverless message queues, scheduled jobs, and reliable HTTP-based task delivery without managing infrastructure. Use when: qstash, upstash queue, serverless cron, scheduled http, message queue serverless.

azure-resource-manager-redis-dotnet

25
from ComeOnOliver/skillshub

Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) - use StackExchange.Redis for that. Triggers: "Redis cache", "create Redis", "manage Redis", "ARM Redis", "RedisResource", "provision Redis", "Azure Cache for Redis".

aws-serverless

25
from ComeOnOliver/skillshub

Specialized skill for building production-ready serverless applications on AWS. Covers Lambda functions, API Gateway, DynamoDB, SQS/SNS event-driven patterns, SAM/CDK deployment, and cold start optimization.

redis-patterns

25
from ComeOnOliver/skillshub

Upstash Redis patterns for caching and rate limiting.

deploying-kafka-k8s

25
from ComeOnOliver/skillshub

Deploys Apache Kafka on Kubernetes using the Strimzi operator with KRaft mode. Use when setting up Kafka for event-driven microservices, message queuing, or pub/sub patterns. Covers operator installation, cluster creation, topic management, and producer/consumer testing. NOT when using managed Kafka (Confluent Cloud, MSK) or local development without K8s.

alicloud-redis

25
from ComeOnOliver/skillshub

Manage Alibaba Cloud Redis (Tair / R-KVStore) using the @alicloud/r-kvstore20150101 TypeScript SDK. Use when working with Redis or Tair instances, accounts, backups, security (whitelist/SSL/TDE/audit), parameters, monitoring, cluster scaling, direct connection, Tair Custom instances, and resource tagging. Covers all 157 APIs of the R-KVStore 20150101 version.

Xata — Serverless Data Platform

25
from ComeOnOliver/skillshub

## Overview

Val Town — Social Serverless Functions

25
from ComeOnOliver/skillshub

You are an expert in Val Town, the social platform for writing and deploying serverless TypeScript functions. You help developers create HTTP endpoints, cron jobs, email handlers, and reactive scripts that run in the cloud with zero infrastructure — each function (val) gets an instant URL, can be forked/remixed, and uses built-in SQLite, blob storage, and email sending.

AWS Step Functions — Serverless Workflow Orchestration

25
from ComeOnOliver/skillshub

You are an expert in AWS Step Functions, the serverless orchestration service for building workflows as state machines. You help developers coordinate Lambda functions, API calls, and AWS services using visual workflows with branching, parallel execution, error handling, retries, and human approval steps — building reliable, observable distributed systems without custom orchestration code.

SST (Ion) — Full-Stack Serverless Framework

25
from ComeOnOliver/skillshub

You are an expert in SST (Ion), the framework for building full-stack serverless applications on AWS. You help developers deploy Next.js, Remix, Astro, and API services with infrastructure-as-code defined in TypeScript, automatic IAM permissions, live Lambda debugging, secrets management, and zero-config deployments — replacing CDK/Terraform complexity with a developer-friendly abstraction over AWS services.

Serverless Debugger

25
from ComeOnOliver/skillshub

## Overview