zlacker

[return to "Show HN: Hatchet – Open-source distributed task queue"]
1. kcorbi+Nd[view] [source] 2024-03-08 18:13:21
>>abelan+(OP)
I love your vision and am excited to see the execution! I've been looking for exactly this product (postgres-backed task queue with workers in multiple languages and decent built-in observability) for like... 3 years. Every 6 months I'll check in and see if someone has built it yet, evaluate the alternatives, and come away disappointed.

One important feature request that probably would block our adoption: one reason why I prefer a postgres-backed queue over eg. Redis is just to simplify our infra by having fewer servers and technologies in the stack. Adding in RabbitMQ is definitely an extra dependency I'd really like to avoid.

(Currently we've settled on graphile-worker which is fine for what it does, but leaves a lot of boxes unchecked.)

◧◩
2. abelan+9g[view] [source] 2024-03-08 18:23:12
>>kcorbi+Nd
Thank you, appreciate the kind words! What boxes are you looking to check?

Yes, I'm not a fan of the RabbitMQ dependency either - see here for the reasoning: >>39643940 .

It would take some work to replace this with listen/notify in Postgres, less work to replace this with an in-memory component, but we can't provide the same guarantees in that case.

◧◩◪
3. jagged+Ce1[view] [source] 2024-03-08 23:41:37
>>abelan+9g
I come to this only as an interested observer, but my experience with listen/notify is that it outperforms rabbitmq/kafka in small to medium operations and has always pleasantly surprised me. You might find out it's a little easier than you think to slim your dependency stack down.
◧◩◪◨
4. hosh+sb2[view] [source] 2024-03-09 13:45:57
>>jagged+Ce1
How do you handle things when no listeners are available to be notified?
◧◩◪◨⬒
5. abelan+1K2[view] [source] 2024-03-09 18:23:42
>>hosh+sb2
Presumably there'd be a messages table that you listen/notify on, and you'd replay messages that weren't consumed when a listener rejoins. But yeah, this is the overhead I was referencing.
◧◩◪◨⬒⬓
6. hosh+fj3[view] [source] 2024-03-10 00:49:06
>>abelan+1K2
With the way LISTEN/NOTIFY works, Postgres doesn't keep a record of messages that are not sent. So you cannot replay this. Unless you know something about postgresql that I don't know about.
◧◩◪◨⬒⬓⬔
7. yencab+Lj3[view] [source] 2024-03-10 00:57:05
>>hosh+fj3
You insert work-to-be-performed into a table, and use NOTIFY only to wake up consumers that there is more work to be had. Consumers that weren't there at the time of NOTIFY can look at the rows in the table at startup.
◧◩◪◨⬒⬓⬔⧯
8. hosh+us3[view] [source] 2024-03-10 03:12:21
>>yencab+Lj3
I see. So the notify is just to say there is work to be performed, but there is no payload that includes the job. The consumer still has to make a query. If there isn’t enough work, the queries should come back empty. This saves from having to poll, but not a true push system.
◧◩◪◨⬒⬓⬔⧯▣
9. jagged+wE3[view] [source] 2024-03-10 06:36:24
>>hosh+us3
as far as I can tell NOTIFY is fanout, in the sense that it will send a message to all the LISTENing connections, so it wouldn't make sense in that context anyway. It's not one-to-one, it's about making sure that jobs get picked up in a timely fashion. If you're doing something fancier with event sourcing or equivalent, you can send events via NOTIFY, and have clients decide what to do with those events then.

Quoth the manual: "The NOTIFY command sends a notification event together with an optional “payload” string to each client application that has previously executed LISTEN channel for the specified channel name in the current database. Notifications are visible to all users."

[go to top]