worker
walex
Our great sponsors
worker | walex | |
---|---|---|
19 | 17 | |
1,633 | 250 | |
2.4% | - | |
9.7 | 9.1 | |
6 days ago | 7 days ago | |
TypeScript | Elixir | |
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.
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.
walex
-
The Guide to PostgreSQL Data Change Tracking
Great post, I really like the approach of adding additional context for WAL CDC.
I use both the trigger + audit table in my sass (for user-facing activity feeds) and subscribe to CDC WAL changes for dealing with callback -like logic (i.e., send registration email, clear cache).
I'm not a fan of pg_notify due to requirement of adding triggers (performance penalty) and the 8k character limit per column (you will lose data is it will splice off anything larger than that).
Application-level tracking or callbacks makes the stack dependent on the application for data integrity, I'd rather the database be the source of truth on all things data.
I'm the maintainer of an open-source CDC library for PostgreSQL called WalEx. It's lighter weight and much simpler to operate than Debezium:
https://github.com/cpursley/walex
For something turn-key, Bemi looks like a really good option!
The WAL CDC approach: https://github.com/cpursley/walex?tab=readme-ov-file#publica...
CREATE PUBLICATION news_item FOR TABLE news WHERE (topic IS "AAPL");
-
Elixir Nitpicks
What do you mean testing with processes?
I won't suggest these are the best written tests, but I test various processes, supervisors, etc like this:
https://github.com/cpursley/walex/blob/master/test/walex/sup...
-
PostgreSQL Is Enough
WalEx instead of pub/sub (listen/subscribe): https://github.com/cpursley/walex
Supavisor connection pooler: https://github.com/supabase/supavisor
Yep, I should add that. One of the libraries in my list is WalEx: https://github.com/cpursley/walex/issues
It subscribes to the Postgres WAL and let you do the same sort of thing you can do with listen/notify, but without the drawbacks like need for triggers or character limits.
You don’t send the entire WAL, just what you subscribe to - and you can even filter via SQL: https://github.com/cpursley/walex?tab=readme-ov-file#publica...
-
A Technical Dive into PostgreSQL's replication mechanisms
Good stuff, I'm a little obsessed with the Postgres replication and WAL.
If you're an Elixir user, you might find my library for subscribing to Postgres WAL events useful: https://github.com/cpursley/walex
It's a lot easier to operate than the typical debezium setup (which is what I think Airbyte uses behind the scenes).
-
Fly Postgres, Managed by Supabase
What we do is much if the business logic in Postgres. But then there’s all the other stuff like external integrations, etc.
We handled that by having an Even system built on the Postgres WAL that we use like a callback system.
I put together a little library in Elixir (that originally started out as forked Supabase realtime) for this:
https://github.com/cpursley/walex
Recently added the ability to configure WalEx to forward events to webhooks or EventRelay (so you don’t need to know Elixir).
-
All the ways to capture changes in Postgres
If you're using Elixir, check out https://github.com/cpursley/walex
I've actually been thinking about turning this idea into a product where you can just point it at your postgres database and select the tables you want to listen to (with filters, like you describe). And have that forwarded to a webhook (with possibility of other protocols).
I'd love to hear folks thoughts on that (and if it would be something people would pay for).
What are some alternatives?
pg-boss - Queueing jobs in Node.js using PostgreSQL like a boss
dramatiq - A fast and reliable background task processing library for Python 3.
good_job - Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
start - Kyoto starter project
PolarDB-for-PostgreSQL - A cloud-native database based on PostgreSQL developed by Alibaba Cloud.
r2dbc-postgresql - Postgresql R2DBC Driver
neon - Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, branching, and bottomless storage.
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.
realtime - Broadcast, Presence, and Postgres Changes via WebSockets
BeanstalkD - Beanstalk is a simple, fast work queue.
libcluster - Automatic cluster formation/healing for Elixir applications
helm-charts - neondatabase helm charts