good_job
worker
Our great sponsors
good_job | worker | |
---|---|---|
35 | 19 | |
2,418 | 1,625 | |
- | 5.5% | |
9.3 | 9.7 | |
3 days ago | 4 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.
good_job
-
Tuning Rails application structure
Once we are done with default gems, should we look into something we usually use? That's jwt because we need session tokens for our API. Next comes our one and only sidekiq. For a long period of time it was the best in town solution for background jobs. Now we could also consider solid_queue or good_job. In development and testing groups we need rspec-rails, factory_bot_rails and ffaker. Dealing with money? Start doing it properly from the beginning! Do not forget to install money-rails. Once everything is added to the Gemfile do not forget to trigger bundle install.
-
Postgres as Queue
In the world of Ruby, GoodJob [0] has been doing a _good job_ so far.
-
Choose Postgres Queue Technology
For Rails apps, you can do this using the ActiveJob interface via
https://github.com/bensheldon/good_job
Had it in production for about a quarter and itโs worked well.
-
Pg_later: Asynchronous Queries for Postgres
Idk about pgagent but any table is a resilient queue with the multiple locks available in pg along with some SELECT pg_advisory_lock or SELECT FOR UPDATE queries, and/or LISTEN/NOTIFY.
Several bg job libs are built around native locking functionality
> Relies upon Postgres integrity, session-level Advisory Locks to provide run-once safety and stay within the limits of schema.rb, and LISTEN/NOTIFY to reduce queuing latency.
https://github.com/bensheldon/good_job
> |> lock("FOR UPDATE SKIP LOCKED")
https://github.com/sorentwo/oban/blob/8acfe4dcfb3e55bbf233aa...
-
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.
-
Mike Perham of Sidekiq: โIf you build something valuable, charge money for it.โ
Sidekiq Pro is great, we're paying for it! 10k a year I think.
But for people who are interested in alternatives, I'd also suggest Good Job (runs on Postgresql).
-
SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
I'm the GoodJob author. Here's the class that is responsible for implementing Postgres's LISTEN/NOTIFY functionality in GoodJob:
https://github.com/bensheldon/good_job/blob/10e9d9b714a668dc...
That's heavily inspired by Rail's Action Cable (websockets) Adapter for Postgres, which is a bit simpler and easier to understand:
https://github.com/rails/rails/blob/be287ac0d5000e667510faba...
Briefly, it spins up a background thread with a dedicated database connection and doings a blocking Postgres LISTEN query returns results, and then it forwards the result to other subscribing objects.
-
Watching for changes to DB by another app
In this case I would try to set up tcn (a Postgres extension) and a trigger that inserts a job in a goodjob jobs table. https://github.com/bensheldon/good_job is like sidekiq but uses Postgres as a queue.
-
How do you schedule jobs far out in advanced?
Check out https://github.com/bensheldon/good_job
worker
-
Postgres as Queue
Big fan of Graphile Worker to handle this job. https://github.com/graphile/worker
-
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.
-
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 is your development stack for 2023?
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)
-
Devious SQL: Message Queuing Using Native PostgreSQL
We're currently keeping it as simple as possible. We just use a table and this query that runs every second: `DELETE FROM job_queue RETURNING type, info;`. Works great and reliably so far. I think our current volume is on the order of 100-1000 req/sec.
We'll likely switch to graphile-worker when we need more performance, but we're all about avoiding premature optimization. That library has been benchmarked to handle 10k req/sec: https://github.com/graphile/worker#performance
-
Postgres is a great pub/sub and job server
Anybody using graphile-worker[1] in production/heavy load? It looks awesome, and I coded up some simple prototype tasks (email, sms, etc), but question how it truly scales. They claim horizontal scaling is trivial.
> it achieves an average latency from triggering a job in one process to executing it in another of under 3ms, and a 12-core database server can process around 10,000 jobs per second.
What are some alternatives?
pg-boss - Queueing jobs in Node.js using PostgreSQL like a boss
Sidekiq - Simple, efficient background processing for Ruby
sidekiq-throttled - Concurrency and rate-limit throttling for Sidekiq
Que - A Ruby job queue that uses PostgreSQL's advisory locks for speed and reliability.
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.
dramatiq - A fast and reliable background task processing library for Python 3.
Sidekiq::Undertaker - Sidekiq::Undertaker allows exploring, reviving or burying dead jobs.
sidekiq_alive - Liveness probe for Sidekiq in Kubernetes deployments
Karafka - Ruby and Rails efficient Kafka processing framework
Sneakers - A fast background processing framework for Ruby and RabbitMQ