A job queue built in Node.js on top of PostgreSQL for reliable background processing and asynchronous execution.
pg-boss is a job queue library built in Node.js on top of PostgreSQL, designed to provide background processing and reliable asynchronous execution for Node.js applications. It leverages PostgreSQL's SKIP LOCKED feature to ensure exactly-once job delivery and atomic commits, minimizing the need for additional message broker infrastructure. It is ideal for teams already using PostgreSQL who want to simplify their architecture by avoiding extra systems.
Node.js developers and teams already using PostgreSQL who need a durable, atomic job queue for background processing without introducing a separate message broker. It is especially suited for those familiar with relational database semantics and operations like SQL, querying, and backups.
Developers choose pg-boss because it integrates seamlessly with PostgreSQL, leveraging its robust features for reliability and exactly-once delivery, reducing infrastructure complexity. Its unique selling points include transactional job creation within existing database transactions, SQL support for non-Node.js runtimes, and multi-master compatibility for environments like Kubernetes ReplicaSets.
Queueing jobs in Postgres from Node.js like a boss
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages PostgreSQL's SKIP LOCKED feature to ensure jobs are processed reliably without duplicates, providing atomic commits as highlighted in the README for guaranteed execution.
Allows jobs to be created within existing database transactions, ensuring data consistency with application logic, a key feature for reliable background processing.
Built-in support for cron expressions enables recurring job scheduling without external tools, simplifying periodic tasks in PostgreSQL-based environments.
Includes priority queues, dead letter queues, and automatic retries with exponential backoff, offering robust job handling for complex workflows.
Provides SQL access for non-Node.js runtimes and works in multi-master setups like Kubernetes, increasing flexibility for polyglot and distributed systems.
The library is deeply integrated with PostgreSQL, making it unsuitable for teams using other databases or wanting a vendor-agnostic solution, as admitted in the README's focus on PostgreSQL users.
For extremely high-volume job processing, PostgreSQL might not scale as efficiently as dedicated message brokers, leading to latency issues under heavy loads.
Requires managing PostgreSQL database versions, separate packages for dashboard and proxy, and adherence to specific Node.js requirements, adding complexity to deployment.