upstash
Upstash
Upstash is a serverless data platform offering Redis, QStash (message queue), and Vector database with per-request pricing optimized for edge and serverless environments.
Documentation
Key Capabilities
- QStash: Built-in serverless message queue and scheduler — handles push delivery, retries, dead-letter queues, cron schedules, and URL groups without any additional infrastructure. Not a Redis feature; a separate product.
- Auto-pipelining:
@upstash/redisautomatically batches concurrent commands into a single HTTP request — no manual pipeline setup needed. - Hash field expiration: Redis supports per-field TTL via
HEXPIRE/HPEXPIRE— granular expiration below key level without external workarounds. - Vector hybrid search: Vector database supports combining dense and sparse embeddings in a single index for improved relevance — no separate sparse index needed.
- QStash flow control: Built-in rate-limiting primitives per consumer endpoint — throttle delivery without a separate rate-limit layer.
Best Practices
- Use REST/HTTP SDK, not TCP connections, in serverless and edge runtimes. Traditional Redis TCP clients exhaust connection limits fast in stateless environments.
@upstash/redisuses HTTP and is the correct default; rawioredisornode-rediswill cause connection quota errors under load. - Use deduplication keys in QStash to prevent duplicate enqueuing. QStash retries on failure by default (at-least-once delivery). A deduplication key (
Upstash-Deduplication-Id) prevents the same message from being enqueued more than once within a ~2-hour window — it does not prevent redelivery. Your handler must still be idempotent to handle retries safely. - Acknowledge Redis Streams messages with XACK or the PEL will grow unbounded. Consumer groups accumulate pending entries for unacknowledged messages. In serverless functions that may crash silently, missed
XACKcalls causeERR XReadGroup is cancellederrors and stale pending entries. - Enable eviction in the Upstash console before hitting capacity. The default behavior triggers
ERR DB capacity quota exceededrather than silently evicting old keys. Upstash uses its own proprietary eviction algorithm — it is not configurable via RedisCONFIG SET maxmemory-policy. Enable eviction as a binary toggle in the database settings before going to production. - Rotate signing keys and tokens on a schedule, not reactively. Upstash token rotation is a manual operation with no automatic expiry. Plan key rotation in CI/CD pipelines; do not wait for a breach to rotate.
More from mikkelkrogsholm/dev-skills
shadcn-ui
shadcn/ui — copy-owned React component library built on Radix UI and Tailwind CSS. Use when building with shadcn/ui or asking about its components, CLI, theming, configuration, or integration with Next.js, Vite, Remix, or other frameworks. Fetch live documentation for up-to-date details.
10zod
Zod — TypeScript-first schema validation with static type inference. Use when building with Zod or asking about schema definitions, type inference, parsing, transformations, refinements, coercion, error handling, or integration with forms, APIs, or tRPC. Fetch live documentation for up-to-date details.
10playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
5hono
Hono — ultrafast, multi-runtime web framework built on Web Standards. Use when building with Hono or asking about its APIs, configuration, patterns, or integration. Fetch live documentation for up-to-date details.
5motion
Motion (formerly Framer Motion) — React and JavaScript animation library. Use when animating with Motion or Framer Motion: page transitions, hover/tap/drag gestures, scroll-triggered animations, exit animations, layout animations, spring physics, variants, AnimatePresence, useAnimate, useMotionValue, or migrating from framer-motion to the motion package. Fetch live documentation for up-to-date details.
4tanstack-router
TanStack Router — fully type-safe router for React with file-based routing, search params validation, loaders, and built-in caching. Use when building with TanStack Router or asking about its route configuration, file-based routing, type-safe links, search params, loaders, or navigation patterns. Fetch live documentation for up-to-date details.
4