article says he also uses "order by" clause, but I am wondering if it will severely limit throughput since all messages will need to be sorted on each lookup, but this probably can be solved by introducing index.
It seems strictly worse to use ORDER BY in this case, since if you're using SKIP LOCKED you should be doing parallel processing anyway, and if you're doing parallel processing, ordering is already going out the window.
Yes, but if you're going through the queue with multiple workers in parallel, you lose ordering guarantees anyway.
Depends on how many consumers you have. If you need order guarantees, then something like the outbox pattern is probably a better fit.
Nothing about the outbox pattern guarantees ordering.
If you use Postgres logical replication, that is not true.
article says he also uses "order by" clause, but I am wondering if it will severely limit throughput since all messages will need to be sorted on each lookup, but this probably can be solved by introducing index.
It seems strictly worse to use ORDER BY in this case, since if you're using SKIP LOCKED you should be doing parallel processing anyway, and if you're doing parallel processing, ordering is already going out the window.
Parallel or not, the order is of importance in any queue system.
19 replies →