News for hackers. Stuff that matters.
Re:Multi-Tenant Queues in Postgres by phibz on Thursday April 18, 2024 @08:52PM (#40082353)
Why not something like Kafka or Redis?
Re:Multi-Tenant Queues in Postgres by dewey on Thursday April 18, 2024 @11:24PM (#40083173)
Also most of the times you already have a database so why not use that instead of adding another service to the pile.
Re:Multi-Tenant Queues in Postgres by hipadev23 on Thursday April 18, 2024 @10:08PM (#40082794)
Because that’s sane, easy, and boring.
Re:Multi-Tenant Queues in Postgres by teraflop on Friday April 19, 2024 @01:15AM (#40083631)
The most straightforward reason is that if you need a transactional database anyway, then moving the queue into the DB allows you to atomically en/dequeue messages at the same time as making other updates. Which can massively simplify your architecture because it eliminates an enormous category of possible failure modes. (Or it can massively improve your system correctness, if you didn't realize those failure modes were possible.)
Re:Multi-Tenant Queues in Postgres by klysm on Friday April 19, 2024 @04:40AM (#40084562)
Using Kafka as a work queue is widely documented as a mistake. Using a single database results in a lot of operational simplicity and you get to skip a lot of distributed systems when all your state is in a single system
Re:Multi-Tenant Queues in Postgres by victor106 on Friday April 19, 2024 @12:34PM (#40088856)
> Using Kafka as a work queue is widely documented as a mistake

Could not find any good sources on this. Can you please provide any references?

Re:Multi-Tenant Queues in Postgres by klysm on Friday April 19, 2024 @01:35PM (#40089707)
don’t have any off the top of my head sorry, I could be making it up but I’m pretty sure I remember reading that from several sources. Iirc it has to do with the fact that there isn’t really single message acknowledging?
Re:Multi-Tenant Queues in Postgres by perfectspiral on Saturday April 20, 2024 @12:11PM (#40098397)
This is a proposal to extend Kafka to (better) handle queueing use cases: https://cwiki.apache.org/confluence/display/KAFKA/KIP-932%3A...

"For example, a queue is perfect for a situation in which messages are independent work items that can be processed concurrently by a pool of applications, and individually retried or acknowledged as processing completes. This is much easier to achieve using a queue rather than a partitioned topic with a consumer group."