All Projects → timgit → Pg Boss

timgit / Pg Boss

Licence: mit
Queueing jobs in Node.js using PostgreSQL like a boss

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pg Boss

Toro
Multithreaded message processing on Postgres
Stars: ✭ 39 (-92.57%)
Mutual labels:  postgresql, postgres, queue
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (-28.95%)
Mutual labels:  postgresql, postgres
Bull
Bull module for Nest framework (node.js) 🐮
Stars: ✭ 356 (-32.19%)
Mutual labels:  job, queue
Sqlboiler
Generate a Go ORM tailored to your database schema.
Stars: ✭ 4,497 (+756.57%)
Mutual labels:  postgresql, postgres
Epgsql
Erlang PostgreSQL client library.
Stars: ✭ 336 (-36%)
Mutual labels:  postgresql, postgres
Postgres
PostgreSQL driver for Deno
Stars: ✭ 352 (-32.95%)
Mutual labels:  postgresql, postgres
Deno Nessie
A modular Deno library for PostgreSQL, MySQL, MariaDB and SQLite migrations
Stars: ✭ 381 (-27.43%)
Mutual labels:  postgresql, postgres
Graphql Starter
💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, and Material UI.
Stars: ✭ 3,377 (+543.24%)
Mutual labels:  postgresql, postgres
Check postgres
Nagios check_postgres plugin for checking status of PostgreSQL databases
Stars: ✭ 438 (-16.57%)
Mutual labels:  postgresql, postgres
Zapatos
Zero-abstraction Postgres for TypeScript: a non-ORM database library
Stars: ✭ 448 (-14.67%)
Mutual labels:  postgresql, postgres
Citus
Distributed PostgreSQL as an extension
Stars: ✭ 5,580 (+962.86%)
Mutual labels:  postgresql, postgres
Zombodb
Making Postgres and Elasticsearch work together like it's 2021
Stars: ✭ 3,781 (+620.19%)
Mutual labels:  postgresql, postgres
Wal E
Continuous Archiving for Postgres
Stars: ✭ 3,313 (+531.05%)
Mutual labels:  postgresql, postgres
Libpqxx
The official C++ client API for PostgreSQL.
Stars: ✭ 492 (-6.29%)
Mutual labels:  postgresql, postgres
Ansible Role Postgresql
Ansible Role - PostgreSQL
Stars: ✭ 310 (-40.95%)
Mutual labels:  postgresql, postgres
Sqlx
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.
Stars: ✭ 5,039 (+859.81%)
Mutual labels:  postgresql, postgres
Compose Postgres
Postgresql & pgadmin4 powered by compose
Stars: ✭ 477 (-9.14%)
Mutual labels:  postgresql, postgres
Loukoum
A simple SQL Query Builder
Stars: ✭ 305 (-41.9%)
Mutual labels:  postgresql, postgres
Yiigo
🔥 Go 轻量级开发通用库 🚀🚀🚀
Stars: ✭ 304 (-42.1%)
Mutual labels:  postgresql, postgres
With advisory lock
Advisory locking for ActiveRecord
Stars: ✭ 409 (-22.1%)
Mutual labels:  postgresql, postgres

Queueing jobs in Node.js using PostgreSQL like a boss.

PostgreSql Version npm version Build Status Coverage Status

async function readme() {
  const PgBoss = require('pg-boss');
  const boss = new PgBoss('postgres://user:[email protected]/database');

  boss.on('error', error => console.error(error));

  await boss.start();

  const queue = 'some-queue';

  let jobId = await boss.publish(queue, { param1: 'foo' })

  console.log(`created job in queue ${queue}: ${jobId}`);

  await boss.subscribe(queue, someAsyncJobHandler);
}

async function someAsyncJobHandler(job) {
  console.log(`job ${job.id} received with data:`);
  console.log(JSON.stringify(job.data));

  await doSomethingAsyncWithThis(job.data);
}

pg-boss is a job queue built in Node.js on top of PostgreSQL in order to provide background processing and reliable asynchronous execution to Node.js applications.

pg-boss relies on SKIP LOCKED, a feature introduced in PostgreSQL 9.5 written specifically for message queues, in order to resolve record locking challenges inherent with relational databases. This brings the safety of guaranteed atomic commits of a relational database to your asynchronous job processing.

This will likely cater the most to teams already familiar with the simplicity of relational database semantics and operations (SQL, querying, and backups). It will be especially useful to those already relying on PostgreSQL that want to limit how many systems are required to monitor and support in their architecture.

Features

  • Backpressure-compatible subscriptions for monitoring queues on an interval (with configurable concurrency)
  • Distributed cron-based job scheduling with database clock synchronization
  • Job deferral, retries (with exponential backoff), throttling, rate limiting, debouncing
  • Job completion subscriptions for orchestrations/sagas
  • Direct publish, fetch and completion APIs for custom integrations
  • Batching API for chunked job fetching
  • Direct table access for bulk loads via COPY or INSERT
  • Multi-master compatible when running multiple instances (for example, in a Kubernetes ReplicaSet)
  • Automatic provisioning of required storage into a dedicated schema
  • Automatic maintenance operations to manage table growth

Requirements

  • Node 10 or higher
  • PostgreSQL 9.5 or higher

Installation

# npm
npm install pg-boss

# yarn
yarn add pg-boss

Documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].