Que
worker
Our great sponsors
Que | worker | |
---|---|---|
10 | 19 | |
2,284 | 1,641 | |
0.3% | 3.1% | |
6.0 | 9.7 | |
23 days ago | 14 days ago | |
Ruby | TypeScript | |
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.
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.
worker
-
Postgres as Queue
Big fan of Graphile Worker to handle this job. https://github.com/graphile/worker
- GitHub - graphile/worker: High performance Node.js/PostgreSQL job queue (also suitable for getting jobs generated by PostgreSQL triggers/functions out into a different work queue)
- High performance Node.js/PostgreSQL job queue
-
Choose Postgres Queue Technology
I do enjoy using https://github.com/graphile/worker for my postgresql queuing needs. Very scalable, the next release 0.14 even more so, and easy to use.
-
PGMQ: Simple Message Queues Built on Postgres
On the same subject (job queue based on PostgreSQL), I'm successfully using the https://github.com/graphile/worker/ (NodeJS) project in production.
Jobs are written in Javascript.
-
How Trigger.dev makes serverless background jobs possible
Postgres is used both as a store of state for Runs/Tasks and for the Job queue (we use Graphile Worker).
-
Intro to PostGraphile V5 (Part 2): Plugins and Presets
Having now built V5's unified plugins and presets system, I'm extremely pleased with it! I'm so happy, in fact, that I'm looking forward to integrating it with Graphile's other tools such as Graphile Worker (our Postgres-backed job queue) and Graphile Migrate (a lightweight SQL-based migration framework that focuses on DX) once V5 is out and stable.
-
SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
Another good library for this is Graphile Worker:
https://github.com/graphile/worker
Uses both listen notify and advisory locks so it is using all the right features. And you can enqueue a job from sql and plpgsql triggers. Nice!
Worker is in Node js.
https://github.com/graphile/worker
- whats the difference bewteen SQL Qeues and server queues ?
-
How to schedule tasks in a Node.js app 🕙
See also graphile-worker: https://github.com/graphile/worker (lower latency than pg-boss because it uses LISTEN/NOTIFY)
What are some alternatives?
Sidekiq - Simple, efficient background processing for Ruby
pg-boss - Queueing jobs in Node.js using PostgreSQL like a boss
good_job - Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
dramatiq - A fast and reliable background task processing library for Python 3.
Delayed::Job - Database based asynchronous priority queue system -- Extracted from Shopify
Resque - Resque is a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.
start - Kyoto starter project
Karafka - Ruby and Rails efficient multithreaded Kafka processing framework
r2dbc-postgresql - Postgresql R2DBC Driver
Shoryuken - A super efficient Amazon SQS thread based message processor for Ruby
BeanstalkD - Beanstalk is a simple, fast work queue.