Live data from Hacker News

Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

github.com

71–80 of 140 posts

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#71
post #28

Cool, congrats on releasing. Have you seen graphile worker? Wondering how this compares or if you're building for different use-cases.

I haven’t used Graphile Worker since I’m not familiar with JavaScript. PgQueuer is tailored for Python with PostgreSQL environments. I’d be interested to hear about Graphile Worker’s features and how they might inspire improvements to PgQueuer.

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#72
post #69

Good Job does the same for Rails https://github.com/bensheldon/good_job

There’s also the new built in SolidQueue. https://github.com/rails/solid_queue/

https://dev.37signals.com/introducing-solid-queue/

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#73
post #70

Earlier quoted context omitted.

> It's simple and atomic and almost certainly incorrect, gotta read at least https://www.pgcon.org/2016/schedule/attachments/414_queues-p... which discusses FOR UPDATE SKIP LOCKED

that's a nice read, but does it also apply to MySQL (InnoDB)?

I've done this with mysql. Never do one at a time if you have jobs per minute over 30. It won't scale. Instead have the job dispatcher reserve 100 at a time and then fire that off to a subprocess which will subsequently fire off a process for each job. A three layer approach makes it much easier to build out multiserver. Or if you don't want the headache just use SQS which is pretty much free under 1 million jobs.

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#74
post #70

Earlier quoted context omitted.

that's a nice read, but does it also apply to MySQL (InnoDB)?

I've done this with mysql. Never do one at a time if you have jobs per minute over 30. It won't scale. Instead have the job dispatcher reserve 100 at a time and then fire that off to a subprocess which will subsequently fire off a process for each job. A three layer approach makes it much easier to build out multiserver. Or if you don't want the headache just use SQS which is pretty much free under 1 million jobs.

Yeah it's very basic and limited.

However if I am about to use DB as a job queue for budget reasons, I'd make sure the job doesn't get too complicated.

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#75
post #74

Earlier quoted context omitted.

I've done this with mysql. Never do one at a time if you have jobs per minute over 30. It won't scale. Instead have the job dispatcher reserve 100 at a time and then fire that off to a subprocess which will subsequently fire off a process for each job. A three layer approach makes it much easier to build out multiserver. Or if you don't want the headache just use SQS which is pretty much free under 1 million jobs.

Yeah it's very basic and limited. However if I am about to use DB as a job queue for budget reasons, I'd make sure the job doesn't get too complicated.

For me it was a lot of small jobs.

I was able to get it up to 3500 jobs an hour and likely could have gone far past that but the load on the MySQL server was not reasonable

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#76
The Symfony framework (PHP) provides a similar feature, which also relies on LISTEN/NOTIFY and FOR UPDATE SKIP LOCKED: https://symfony.com/doc/current/messenger.html#doctrine-tran...

It also supports many other backends including AMQP, Beanstalkd, Redis and various cloud services.

This component, called Messenger, can be installed as a standalone library in any PHP project.

(Disclaimer: I’m the author of the PostgreSQL transport for Symfony Messenger).

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#79
post #32

You might also want to look at River ( https://github.com/riverqueue/river ) for inspiration as they support scheduled jobs, etc. From an end-user perspective, they also have a UI which is nice to have for debugging.

Also wanted to say I thought this problem has already been solved by River.

Although seems like OP references a Python library rather than standalone server, so would probably be useful to Python devs.

Re: Show HN: PgQueuer – Transform PostgreSQL into a Job Queue

#80

There is also Procrastinate: https://procrastinate.readthedocs.io/en/stable/index.html Procrastinate also uses PostgreSQL's LISTEN/NOTIFY (but can optionally be turned off and use polling). It also supports many features (and more are planned), like sync and async jobs (it uses asyncio under the hood), periodic tasks, retries, task locks, priorities, job cancellation/aborting, Django integration (optional). DISCLAIME…

it should be the opposite of procastination, but good naming anyway.
Post reply on HN