pg-boss
Que
pg-boss | Que | |
---|---|---|
12 | 10 | |
1,638 | 2,287 | |
- | 0.2% | |
4.4 | 5.6 | |
29 days ago | 5 days ago | |
JavaScript | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pg-boss
-
Choose Postgres Queue Technology
For running queues on Postgres with Node.js backend(s), I highly recommend https://github.com/timgit/pg-boss. I'm sure it has it scale limits. But if you're one of the 90% of the apps that never needs any kind of scale that a modern server can't easily handle then it's fantastic. You get transactional queueing of jobs, and it automatically handles syncing across multiple job processing servers using Postgres locks.
-
Build Your Own Personal Twitter Agent π§ π¦β with LangChain
Jobs use pg-boss, a postgres extension, to queue and run tasks under the hood.
-
SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
If you don't want to roll your own, look into https://github.com/timgit/pg-boss
- How/do you handle queue type workflows?
-
Which tool/library well adopted to use Postgres as a message broker?
I saw this https://github.com/timgit/pg-boss but it's more for jobs than for message with multiple consumers (having their own progress offset).
-
How to schedule tasks in a Node.js app π
The best I've used till now. Has all kind of features and really great when you have a postgres dB in your stack. https://github.com/timgit/pg-boss
-
Cluster friendly task scheduler for NodeJS
Check out these; - https://github.com/mitranim/posterus - https://github.com/timgit/pg-boss - https://github.com/FirebaseExtended/firebase-queue - https://www.npmjs.com/package/rabbit-queue
-
You don't need distributed systems.
You can use the simplest option than implement a new service. Keep in mind that every running system can be a job scheduler, you can just use nodejs worker threads, Redis, or even your DB as a job scheduler, check PGBoss for example.
-
Launch HN: Convoy (YC W22) β Open-source cloud-native webhooks service
Both! For context, we're currently using https://github.com/timgit/pg-boss as a task queue on top of postgres and it works great. No need to complicate things with Redis. I believe it's quite straightforward to implement a task queue on top of postgres using the SKIP LOCKED functionality.
- Devious SQL: Message Queuing Using Native PostgreSQL
Que
-
Choose Postgres Queue Technology
> Can you define "low throughput"?
<1000 messages per minute
Not saying SKIP LOCKED can't work with that many. But you'll probably want to do something better.
FWIW, Que uses advisory locks [1]
[1] https://github.com/que-rb/que
-
Introducing tobox: a transactional outbox framework
Probably worth mentioning that aside from delayed_job there are at least two more modern alternatives backed by the DB: Que and good_job.
-
Sidekiq jobs in ActiveRecord transactions
Good article. Sidekiq is a good, well respected too. However if you are starting out I would recommend not using it, and instead choosing a DB based queue system. We have great success with que, but there are others like good_job.
-
SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
(not sure why this comment was dead, I vouched for it)
There are a lot of ways to implement a queue in an RDBMS and a lot of those ways are naive to locking behavior. That said, with PostgreSQL specifically, there are some techniques that result in an efficient queue without locking problems. The article doesn't really talk about their implementation so we can't know what they did, but one open source example is Que[1]. Que uses a combination of advisory locking rather than row-level locks and notification channels to great effect, as you can read in the README.
[1]: https://github.com/que-rb/que
-
Delayed Job vs. Sidekiq: Which Is Better?
https://github.com/que-rb/que
This one seems to be the most performant. By a lot too, from my understanding (haven't ran any benchmark myself, but the readme shows some good postgres knowledge)
-
Sidekiq VS Que - a user suggested alternative
2 projects | 3 Feb 2022
Que seems like a good alternative if one doesn't want to use Reids. However, given that most apps need Redis (and have it within their infrastructure) nowadays, I still think that Sidekiq is the better option in the generic case.
-
Devious SQL: Message Queuing Using Native PostgreSQL
Implementations that use advisory locks like https://github.com/que-rb/que are much more efficient (atleast when I last tested) and will easily reach 10k job/s on even very modest hardware.
There is a Go port of Que but you can also easily port it to any language you like. I have a currently non-OSS implementation in Rust that I might OSS someday when I have time to clean it up.
-
Postgres is a great pub/sub and job server
Itβs also possible to use advisory locks to implement a job queue in Postgres. See e.g. Que[1]. Note there are a fair number of corner cases, so studying Que is wise if trying to implement something like this, as well as some (a bit older) elaboration[2].
We implemented a similar design to Que for a specific use case in our application that has a known low volume of jobs and for a variety of reasons benefits from this design over other solutions.
[1]: https://github.com/que-rb/que
-
Ruby Schedulers: Whenever vs Sidekiq Cron vs Sidekiq Scheduler
Do also take into consideration que-scheduler (disclaimer, am author). It is built on top of the robust que async job system.
What are some alternatives?
worker - High performance Node.js/PostgreSQL job queue (also suitable for getting jobs generated by PostgreSQL triggers/functions out into a different work queue)
Sidekiq - Simple, efficient background processing for Ruby
celery - Distributed Task Queue (development branch)
good_job - Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
django-postgres-queue - A task queue for django
Delayed::Job - Database based asynchronous priority queue system -- Extracted from Shopify
RabbitMQ - Open source RabbitMQ: core server and tier 1 (built-in) plugins
Resque - Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.
Redis - Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
Karafka - Ruby and Rails efficient multithreaded Kafka processing framework
kue - Kue is a priority job queue backed by redis, built for node.js.
Shoryuken - A super efficient Amazon SQS thread based message processor for Ruby