there seems to be a big hype to adapt pg into any infra. I love PG but this seems not be right thing.
At low-medium scale, this will be fine. Even at higher scale, so long as you monitor autovacuum performance on the queue table. At some point it may become practical to bring a dedicated queue system into the stack, sure, but this can massively simplify things when you don’t need or want the additional complexity.
Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
21–30 of 140 posts
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#22Any suggestions for something like this for dotnet?
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#23BTW: Good PostgresFM episode on implementing queues in Postgres, various caveats etc: https://www.youtube.com/watch?v=mW5z5NYpGeA .
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#24How does LISTEN/NOTIFY compare to using select for update skip locked? I thought listen/notify can lose queue items when the process crashes? Is that true? Do you need to code for those cases in some manner?
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#25there seems to be a big hype to adapt pg into any infra. I love PG but this seems not be right thing.
Never did. The production code still uses PG based queue (which has been improved since) and pg just works perfectly fine. Might still need to go with a dedicated queue service at some point but it has been perfectly fine so far.
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#26You can make anything that stores data into a job queue.
You probably need ACI and also D if you want your jobs to persist.
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#27This looks like a great task queue, I'm a massive proponent of "Postgres is all you need" [0] and doubling down on it with my project that takes it to the extreme. What I would love is a Postgres task queue that does multi-step pipelines, with fan out and accumulation. In my view a structured relational database is a particularly good backend for that as it inherently can model the structure. Is that something you ha…
I’ve always handled this with an orchestrator solution like (think Airflow and similar).
Or is this a matter of use case? Like for a real-time scenario where you need a series of things to happen (user registration, etc) maybe a queue handling this makes sense? Whereas with longer running tasks (ETL pipelines, etc) the orchestrator is beneficial?
Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#28Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#29Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue
#30there seems to be a big hype to adapt pg into any infra. I love PG but this seems not be right thing.
At low-medium scale, this will be fine. Even at higher scale, so long as you monitor autovacuum performance on the queue table. At some point it may become practical to bring a dedicated queue system into the stack, sure, but this can massively simplify things when you don’t need or want the additional complexity.
begin;
insert_row();
schedule_job_for_elasticsearch();
commit;
And it's guaranteed that both the row and job for Elasticsearch update are inserted.If you use a dedicated queue system them this becomes a lot more tricky:
begin;
insert_row();
schedule_job_for_elasticsearch();
commit; // Can fail, and then we have a ES job but no SQL row.
begin;
insert_row();
commit;
schedule_job_for_elasticsearch(); // Can fail, and then we have a SQL row and no job.
There are of course also situations where this doesn't apply, but this "insert row(s) in SQL and then queue job to do more with that" is a fairly common use case for queues, and in those cases this is a great choice.