pg-boss
by Tim Jones (pg-boss project) · Library · also known as pgboss
Node.js job queue that uses PostgreSQL tables and SKIP LOCKED for reliable background jobs, scheduling and retries without a separate broker
Overview
pg-boss is an MIT-licensed Node.js library, maintained by Tim Jones, that implements a job queue on top of PostgreSQL. It creates its own schema of tables and uses transactional SELECT ... FOR UPDATE SKIP LOCKED fetches so that multiple workers can claim jobs safely, and it supports delayed and scheduled jobs (cron expressions), retries with backoff, priorities, singleton and throttled jobs, batch fetching, dead-letter queues, completion events and automatic archiving and expiry of finished jobs. Because state lives in the application's existing database, jobs can be enqueued inside the same transaction as the business data they relate to.
It is a pragmatic choice for TypeScript or JavaScript services that already run PostgreSQL and do not want to operate Redis or a broker, including PM2-managed Node apps. Throughput is bounded by database polling and row contention, so very high-volume or sub-second fan-out workloads are better served by BullMQ on Redis or a dedicated message system, and the library is Node-only, with no workers in other languages.
Capabilities
- Queues stored in PostgreSQL with SKIP LOCKED job fetching
- Delayed, scheduled (cron) and recurring jobs
- Retries with backoff, priorities and dead-letter queues
- Singleton and throttled jobs
- Transactional enqueueing with application data
- Archiving and retention of completed jobs
Typical workflows
- Background email or report generation in a Node API
- Nightly scheduled maintenance tasks without a cron daemon
- Enqueue follow-up work inside the same transaction as a database write
Strengths
- No extra infrastructure beyond PostgreSQL
- Transactional consistency with application data
- MIT license
Limitations
- Node.js only
- Polling-based; throughput limited by the database
- Not suited to very high-rate or low-latency fan-out
Prerequisites
- Node.js and a PostgreSQL database
Who it is for
- Node.js and TypeScript backend developers
Alternatives & comparison
- Apache Kafka
Distributed event streaming platform with durable, partitioned, replayable logs, Kafka Connect connectors and Kafka Streams processing
Open sourceOpen source - BullMQ
Redis-backed job and message queue for Node.js (with a Python port) offering workers, flows, rate limiting, repeatable jobs and a commercial Pro tier
MixedOpen source - NATS
Lightweight Go messaging system with core pub/sub and request-reply plus JetStream persistence, key-value and object stores; a CNCF project
Open sourceOpen source - PostgreSQL
Open-source object-relational database server with a large extension ecosystem (PostGIS, pgvector, TimescaleDB) and broad SQL coverage
Open sourceOpen source - RabbitMQ
Open-source message broker in Erlang supporting AMQP 0-9-1 and 1.0, MQTT, STOMP and Streams, with routing, acknowledgements and quorum queues
Open sourceOpen source - Redis
In-memory key-value data store used as cache, message broker and database, with data structures, Pub/Sub, Streams and, since Redis 8, built-in JSON, search and time-series modules
MixedOpen source
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensepg-boss LICENSE (MIT)checked Nov 1, 2026
https://github.com/timgit/pg-boss/blob/master/LICENSE
Supports: license_spdx, source_model
- Repositorypg-boss repositorychecked Nov 1, 2026
https://github.com/timgit/pg-boss
Supports: name, summary, capabilities
Project README is the primary documentation
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Messaging & queues
Apache Kafka
Apache Software Foundation · Messaging & queues
Distributed event streaming platform with durable, partitioned, replayable logs, Kafka Connect connectors and Kafka Streams processing