zlacker

[parent] [thread] 2 comments
1. sorent+(OP)[view] [source] 2023-11-20 19:26:13
> Work in a transaction has other benefits too. Postgres’ NOTIFY respects transactions, so the moment a job is ready to work a job queue can wake a worker to work it, bringing the mean delay before work happens down to the sub-millisecond level.

Oban just went the opposite way, removing the use of database triggers for insert notifications and moving them into the application layer instead[1]. The prevalence of poolers like pgbouncer, which prevent NOTIFY ever triggering, and the extra db load of trigger handling wasn't worth it.

[1]: https://github.com/sorentwo/oban/commit/7688651446a76d766f39...

replies(1): >>bgentr+Um1
2. bgentr+Um1[view] [source] 2023-11-21 02:50:53
>>sorent+(OP)
That makes a lot of sense, I've had the thought a few times that the NOTIFY overhead could get overwhelming in a high-throughput queue but haven't yet had an opportunity to verify this or experiment with a mechanism for reducing this overhead.
replies(1): >>joker6+Gn2
◧◩
3. joker6+Gn2[view] [source] [discussion] 2023-11-21 11:33:48
>>bgentr+Um1
Also pgbouncer.
[go to top]