Re:Show HN: An SQS Alternative on Postgres
by philefstat on Thursday May 09, 2024 @11:31AM
(#40309265)
have also used/introduced this to several places I've worked and it's been great each time. My only qualm is it's not particularly easy to modify the exponential back off timing without hacky solutions. Have you ever found a good way to do that?
Re:Show HN: An SQS Alternative on Postgres
by valenterry on Thursday May 09, 2024 @03:15PM
(#40311903)
Is there something like that in the jvm world?
Re:Show HN: An SQS Alternative on Postgres
by RedShift1 on Thursday May 09, 2024 @03:19PM
(#40311948)
You don't need anything specific. SELECT ... FROM queue FOR UPDATE SKIP LOCKED is the secret sauce.
Re:Show HN: An SQS Alternative on Postgres
by valenterry on Thursday May 09, 2024 @03:52PM
(#40312289)
Would be nice to get some goodies for free, like overview, pausing, state, statistics etc. :-)
Re:Show HN: An SQS Alternative on Postgres
by chuckhend on Thursday May 09, 2024 @07:15PM
(#40313872)
This is exactly how pgmq is implemented, + the usage of VT.
https://www.jobrunr.io//en/ seems to be popular at the moment.
Re:Show HN: An SQS Alternative on Postgres
by valenterry on Friday May 10, 2024 @03:07AM
(#40316155)
That looks pretty good! Too bad that the OSS version limits the number of jobs quite a bit.
Re:Show HN: An SQS Alternative on Postgres
by brycelarkin on Friday May 10, 2024 @02:01AM
(#40315847)
Do you add jobs inside a transaction? Or with a root connection? There doesn't seem to be an out of the box way to add jobs in a transaction.
Re:Show HN: An SQS Alternative on Postgres
by philefstat on Friday May 10, 2024 @12:21PM
(#40320763)
yes you can add jobs with sql in a transaction, e.g.
SELECT graphile_worker.add_job( 'send_email', json_build_object( 'to', '[email protected]', 'subject', 'graphile-worker test' ) );
(can also use the PERFORM statement instead of SELECT)
The behavior of this library is a bit different and in some ways a bit lower level. If you are using something like this, expect to get very intimate with it as you scale- a lot of times your custom workload would really benefit from a custom index and it's handy to understand how the underlying system works.
[1] https://worker.graphile.org/