Serverless Redis, rate limiting, QStash and durable workflows, with legacy Kafka migration topics.
Topics
26
Sections
5
Learning module
Upstash learning module
Upstash is a serverless data platform that provides Redis, vector, search, messaging (QStash) and durable workflow services over HTTP, with pay-per-request pricing and no servers to manage.
HTTP-based Redis fits serverless: no connection pools, works on the edge.
QStash is at-least-once: verify signatures and make handlers idempotent.
Workflow persists each step, so a failure retries only that step.
Pick the rate-limit algorithm and identifier for the traffic you expect.
Stateful infrastructure that does not fit serverless: Serverless functions spin up by the thousand and die within seconds; opening a TCP connection to a self-hosted Redis from each one exhausts connection limits, cold-start latency grows, and an always-on cluster is paid for even at zero traffic. There is also nowhere to run retries, delays or cron jobs. Upstash replaces the connection with a stateless HTTP request, bills per request with scale to zero, and moves background delivery and durable multi-step execution into managed services the function simply calls.
Callbacks & lifecycle
QStash callbacks
Point a message at a callback URL so the result arrives as a normal HTTP request.
Configure a callback URL for QStash delivery results.
Verify callback authenticity before trusting its status payload.
Correlate the result with the original message identifier.
QStash failure callbacks
Receive a request when every retry has been exhausted, instead of finding it in a dashboard.
Send exhausted-delivery notifications to an authorized failure endpoint.
Record the last destination error and original message reference.
Make recovery actions idempotent if callbacks are retried.
Workflow failure functions
Handle a workflow run that could not complete, in code, next to the workflow itself.
Use the Workflow failure hook for terminal run failures.
Include run and step identifiers in diagnosis.
Keep compensation safe to repeat and separately observable.
Workflow steps
context.run records each step's result, which is what makes a resumed run skip finished work.
Wrap durable units of work in named Workflow steps.
Return serializable results required by later steps.
Keep external side effects safe across execution retries.
Ratelimit results
The limit call returns remaining and reset, which is what a response header should carry.
Inspect success, remaining allowance and reset information.
Return a clear rate-limit response when permission is denied.
Complete pending analytics work using the runtime's supported lifetime mechanism.
blockUntilReady
Wait for capacity up to a deadline rather than rejecting a request immediately.
Wait only up to the configured timeout for capacity.
Handle a denied result when the waiting budget expires.