Migrating production infrastructure? Get up to ₹10,000 in migration credits. Apply now
voroaDocs
Compute

Background jobs with a queue on Voroa Key Value

Run a job queue on Voroa: a Key Value database holds the jobs, a background worker runs them. BullMQ and RQ examples, retries, sizing and honest durability.

To run background jobs on Voroa, create a Key Value database with Keep everything as its memory policy, add its URL to both your web service and a background worker, then use a queue library such as BullMQ (Node.js) or RQ (Python): the web service adds jobs, and the worker runs and retries them.

What a queue is for

Some work is too slow or too fragile to do while a user waits: sending an email, resizing an image, building a PDF, calling a payment provider. A queue lets your app hand that work off. Your web service puts a job on the queue and answers the user straight away; a background worker picks the job up and runs it. If the job fails, the worker tries again instead of the user seeing an error.

How a job queue works on Voroa: your web service adds a job, a Key Value database holds it in line, a background worker picks it up and runs it, and a failed job is retried

On Voroa a queue is two things you already have:

  • a Key Value database, which holds the jobs, and
  • a background worker, which runs them.

Key Value is Redis-compatible, so the standard queue libraries work with it unchanged - for example BullMQ for Node.js and RQ or Celery for Python. There is no separate queue product to learn and no separate price: you pay for the Key Value database and the worker.

Set it up

  1. Create a Key Value database. From your dashboard choose New, then Key Value. Under When memory is full, keep Keep everything (the default). A queue must never drop a job to make room; with this setting a full database refuses new jobs instead, and your app sees an error it can act on. Do not choose a “Drop” option for a queue.
  2. Copy the connection URL. It is shown once when the database is created (and again after a password rotation). Use the internal URL - your services reach it over your private network.
  3. Add it to both services. On your web service and on your worker, add an environment variable, for example KV_URL, holding that URL. See environment variables.
  4. Deploy a worker. Choose New, then Background Worker, and point it at the code that processes jobs. See deploy a background worker.

Example: Node.js with BullMQ

The web service adds a job:

js
import { Queue } from 'bullmq';
import IORedis from 'ioredis';

const connection = new IORedis(process.env.KV_URL, { maxRetriesPerRequest: null });
const emails = new Queue('emails', { connection });

await emails.add('welcome', { to: '[email protected]' }, {
  attempts: 5,                                   // retry a failing job up to 5 times
  backoff: { type: 'exponential', delay: 5000 }, // wait longer between each try
  removeOnComplete: 1000,                        // keep only the last 1,000 finished jobs
});

The worker (start command node worker.js) runs it:

js
import { Worker } from 'bullmq';
import IORedis from 'ioredis';

const connection = new IORedis(process.env.KV_URL, { maxRetriesPerRequest: null });

new Worker('emails', async (job) => {
  await sendEmail(job.data.to); // your own code
}, { connection, concurrency: 5 });

Example: Python with RQ

python
# web service
import os
from redis import Redis
from rq import Queue, Retry

q = Queue("emails", connection=Redis.from_url(os.environ["KV_URL"]))
q.enqueue("tasks.send_welcome", "[email protected]", retry=Retry(max=5, interval=[10, 30, 60]))

The worker (start command python worker.py) runs it. tasks.py holds send_welcome:

python
# worker.py
import os
from redis import Redis
from rq import Worker

Worker(["emails"], connection=Redis.from_url(os.environ["KV_URL"])).work()

Durability, honestly

Voroa saves your Key Value data to disk periodically and takes a nightly backup, so a restart does not bring your queue back empty. A hard crash can still lose jobs added since the last save. Two habits make that safe:

  • Make every job safe to run twice. A job may be retried, or re-added after a crash. Check before you act - for example, mark an email as sent in your Postgres database and skip it if it already is.
  • Keep the record of truth in a database. If losing a job would lose money or an order, write the order to Postgres first and let the job only do the follow-up work.

Size it

A queue uses memory for every job waiting, plus every finished or failed job your library keeps. Roughly: jobs waiting at the busiest moment, times the size of one job’s data, plus the history you keep. Keep job data small (store an ID, not a whole file), and limit the history - removeOnComplete and removeOnFail in BullMQ, result_ttl and failure_ttl in RQ.

We email the account owner when a Key Value database set to Keep everything reaches 90 percent of its memory, and when it starts refusing writes. If that happens, move to a larger size from the database’s plan page, or add more workers so jobs leave the queue faster. See Voroa Key Value for sizes and limits.

Frequently asked questions

Can I use BullMQ or Celery on Voroa?

Yes. Any Redis-compatible queue library works with Voroa Key Value, including BullMQ, RQ and Celery. Run the consumer as a background worker.

Which memory policy should a queue use?

Keep everything, the default. A full database then refuses new jobs with an error your app can handle, instead of silently dropping queued jobs.

Can I lose jobs on Voroa Key Value?

A hard crash can lose jobs added since the last save to disk. Make every job safe to run twice, and keep the record of truth in a database.

What happens when the queue fills up memory?

We email the account owner at 90% of memory and when it starts refusing writes. Move to a larger size, or add workers so jobs leave the queue faster.

Last updated November 17, 2026