← Back to home

Queuebase vs QStash

Overview

Queuebase is a purpose-built background job processing system for Next.js. It provides a tRPC-style, fully type-safe TypeScript API with Zod validation, a local dev server, and a callback model where jobs run on your infrastructure.

QStash is a general-purpose HTTP messaging and scheduling service from Upstash. It acts as a reliable middleman for HTTP requests — you send a message to QStash with a destination URL, and QStash guarantees delivery with retries, scheduling, and dead letter queues.

These tools solve overlapping but distinct problems. Queuebase is a job processing framework — it gives you abstractions (routers, jobs, typed inputs, handlers) to define and execute background work. QStash is a message delivery service — it ensures an HTTP request reaches its destination reliably. You can build a job queue on top of QStash, but you bring your own abstractions.

Architecture Comparison

Queuebase

  1. You define jobs with typed schemas using job() and group them into a router with createJobRouter()
  2. You call jobClient.sendEmail.enqueue({ to: "...", subject: "..." }) from your app code
  3. The SDK POSTs to the Queuebase API (local CLI dev server, or hosted API)
  4. Queuebase stores the job and a worker polls for pending jobs
  5. The worker POSTs to your app’s callback URL (/api/queuebase)
  6. Your handler executes the job and returns the result

QStash

  1. You send an HTTP request to https://qstash.upstash.io/v2/publish/... with a destination URL and payload
  2. QStash durably stores the message
  3. QStash delivers the message to your destination via HTTP POST
  4. If delivery fails, QStash retries with configurable backoff
  5. After exhausting retries, the message goes to a Dead Letter Queue
QueuebaseQStash
ModelJob queue with typed routerHTTP message delivery service
Job awarenessYes — tracks status, attempts, resultsNo — tracks message delivery only
Local devBuilt-in CLI dev serverRequires tunneling (ngrok) or Upstash Workflow dev server

Developer Experience

Queuebase

// Define your job router
import { createJobRouter, job } from "@queuebase/nextjs";
import { z } from "zod";

export const jobs = createJobRouter({
  sendEmail: job({
    input: z.object({
      to: z.string().email(),
      subject: z.string(),
      body: z.string(),
    }),
    handler: async ({ input, jobId, attempt }) => {
      await emailService.send(input);
      return { sent: true };
    },
    defaults: { retries: 3, backoff: "exponential" },
  }),
});

// Enqueue — fully type-safe
await jobClient.sendEmail.enqueue({
  to: "user@example.com",
  subject: "Welcome",
  body: "Hello!",
});

QStash

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

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

// Publish — generic JSON, no type checking
await qstash.publishJSON({
  url: "https://my-app.com/api/send-email",
  body: { to: "user@example.com", subject: "Welcome", body: "Hello!" },
  retries: 3,
});
QueuebaseQStash
Type safetyEnd-to-end (Zod schemas, inferred types)None built-in (generic JSON)
Input validationAutomatic at enqueue timeManual (bring your own)
Handler contextjobId, attempt, maxAttempts, typed inputRaw Request object
Status trackingBuilt-inVia callbacks/DLQ (delivery-level only)
BoilerplateLow — define router, create handlerMedium — separate publish/receive, manual validation

Feature Comparison

FeatureQueuebaseQStash
RetriesYes (per-job, exponential/linear backoff)Yes (configurable, per-message)
Delayed executionYesYes (Upstash-Delay header)
Cron schedulingComing soonYes (cron expressions)
Dead Letter QueueNot yetYes
FIFO queuesNot yetYes
Fan-out (URL Groups)NoYes
DeduplicationNot yetYes (content-based)
Signature verificationYesYes
Job status trackingYesNo (message delivery status only)
Typed input/outputYes (Zod + TypeScript)No
DashboardYes (built-in web UI)Yes (Upstash console)
Local dev serverYes (queuebase dev)Partial (requires public URL for core QStash)
Multi-language SDKsTypeScript onlyTypeScript, Python, Go
Framework supportNext.js (more planned)Framework-agnostic
Workflow orchestrationNoYes (Upstash Workflow)
Open sourceNoSDK is open source; service is proprietary

Pricing Comparison

QueuebaseQStash
Free tier10,000 jobs/month, 5 concurrent, 7 days retention500 messages/day (~15,000/month)
Paid entryPaid plans available$1 per 100K messages (Pay As You Go)
Pro~$40/month + usage

Queuebase’s monthly cap is more forgiving for bursty workloads than QStash’s daily cap of 500 messages on the free tier.

When to Choose QStash

  • You need a general-purpose HTTP relay, not specifically a job queue — reliable webhook delivery, fan-out, third-party API triggering
  • You want cron-based scheduling — QStash has mature cron support today
  • You work across multiple languages or frameworks — QStash is framework-agnostic with SDKs in TypeScript, Python, and Go
  • You want the Upstash ecosystem — unified billing with Upstash Redis
  • You need FIFO ordering, deduplication, or fan-out — QStash has these features today
  • You need workflow orchestration — Upstash Workflow supports multi-step, long-running tasks
  • You prefer to own your abstractions — QStash is a low-level primitive you can build on

When to Choose Queuebase

  • You want a job queue, not a message bus — Queuebase gives you jobs with status tracking, typed inputs, retry policies, and handler context out of the box
  • Type safety matters — Zod validation at enqueue time with full TypeScript inference from definition through execution
  • You’re building a Next.js app and want the fastest path to background jobs
  • You want a local dev experiencequeuebase dev with no tunneling, no external dependencies
  • You want job-level observability — individual job status tracking, attempt counts, results, and errors
  • You want a managed service with a generous free tier — start processing jobs without infrastructure setup

Summary

QStash is a reliable HTTP delivery layer — it excels at getting messages from A to B with retries, scheduling, and fan-out. It is framework-agnostic, part of the Upstash platform, and has more features today (cron, DLQ, FIFO, deduplication, workflows).

Queuebase is a job processing framework that trades QStash’s generality for a tighter developer experience: type-safe job definitions, automatic input validation, job status tracking, and zero-config local development. If you want background jobs that feel like defining tRPC procedures, Queuebase removes the boilerplate you’d build yourself on top of QStash.