Multithreaded, Postgres-based, Active Job backend for Ruby on Rails
open sourceMITself-hostablefree
GoodJob is an Active Job backend for Rails that stores jobs in the app's own Postgres database, using session-level advisory locks for run-once safety and LISTEN/NOTIFY to cut queueing latency. It runs multithreaded on Concurrent::Ruby, either inside an existing web process or as a separate good_job start CLI process. It includes cron-like recurring jobs, batches, concurrency and throttling controls, bulk enqueue and a web dashboard mounted as a Rails engine. Inspired by Delayed::Job and Que, it targets apps that enqueue a million jobs a day and more.
Problems it solves
- background jobs in Rails without running Redis
- use the Postgres database we already have as the queue for Active Job
- jobs that are enqueued in the same database transaction as the record they process
- run background jobs inside the web server process so I don't pay for a separate worker dyno
- retry failed jobs with backoff and see them in a dashboard
- cron-style recurring jobs in Rails without a crontab on the server
- only let one job per customer run at a time to avoid race conditions
- throttle jobs that call a rate-limited third-party API to 100 per hour
- run a callback once a whole group of jobs has finished
- jobs should start within milliseconds of being enqueued without hammering the database with polling
- a job queue that still works behind PgBouncer in transaction mode
- keep finished and discarded jobs around for a couple of weeks so I can see what ran
- move off Delayed Job to something multithreaded but still database-backed
Features
- Active Job queues, delays, priorities, timeouts and retries
- Postgres advisory locks for run-once safety
- LISTEN/NOTIFY for low latency
- run async in the web process or as a separate CLI process
- cron-style recurring jobs
- batches with callbacks
- concurrency limits and enqueue/perform throttles
- bulk enqueue
- web dashboard (Rails engine) with live polling
- pausing jobs
View 3 more
- SELECT FOR UPDATE SKIP LOCKED mode for PgBouncer transaction mode
- CLI HTTP health check probes
- preserved job records with cleanup
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
Alternatives
The same job
These do what GoodJob does.
- River Fast and reliable background jobs
- Solid Queue Database-backed Active Job backend
- Resque A Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later
- Sidekiq Simple, efficient background processing for Ruby
- Hatchet An orchestration engine for background tasks, AI agents, and durable workflows
- Faktory Language-agnostic background job server
