zlacker

[parent] [thread] 22 comments
1. bgentr+(OP)[view] [source] 2023-11-20 17:26:05
Hi HN, I'm one of the authors of River along with Brandur. We've been working on this library for a few months and thought it was about time we get it out into the world.

Transactional job queues have been a recurring theme throughout my career as a backend and distributed systems engineer at Heroku, Opendoor, and Mux. Despite the problems with non-transactional queues being well understood I keep encountering these same problems. I wrote a bit about them here in our docs: https://riverqueue.com/docs/transactional-enqueueing

Ultimately I want to help engineers be able to focus their time on building a reliable product, not chasing down distributed systems edge cases. I think most people underestimate just how far you can get with this model—most systems will never outgrow the scaling constraints and the rest are generally better off not worrying about these problems until they truly need to.

Please check out the website and docs for more info. We have a lot more coming but first we want to iron out the API design with the community and get some feedback on what features people are most excited for. https://riverqueue.com/

replies(8): >>tombh+Am >>clover+Xn >>dangoo+Vz >>endorp+6B >>radica+ZN >>linux2+m71 >>justin+Da2 >>ThePro+pj2
2. tombh+Am[view] [source] 2023-11-20 18:44:09
>>bgentr+(OP)
At the bottom of the page on riverqueue.com it appears there's a screenshot of a UI. But I can't seem to find any docs about it. Am I missing something or is it just not available yet?
replies(2): >>mosen+rn >>bgentr+Co
◧◩
3. mosen+rn[view] [source] [discussion] 2023-11-20 18:46:54
>>tombh+Am
Looks like it’s underway:

> We're hard at work on more advanced features including a self-hosted web interface. Sign up to get updates on our progress.

4. clover+Xn[view] [source] 2023-11-20 18:48:41
>>bgentr+(OP)
So excited y'all created this. Through a few job changes I've been exposed to the most popular background job systems in Rails, Python, JS, etc, and have been shocked at how under appreciated their limitations are relative to what you get out of the box with relational systems. Often I see a lot of DIY add-ons to help close the gaps, but its a lot of work and often still missing tons of edge cases and useful functionality. I always felt going the other way, starting w/ a relational db where many of those needs are free, would make more sense for most start-ups, internal tooling, and smaller scale businesses.

Thank you for this work, I look forward to taking it for a (real) test drive!

◧◩
5. bgentr+Co[view] [source] [discussion] 2023-11-20 18:50:28
>>tombh+Am
The UI isn't quite ready for outside consumption yet but it is being worked on. I would love to hear more about what you'd like to see in it if you want to share.
replies(2): >>fithis+gC >>codege+UY
6. dangoo+Vz[view] [source] 2023-11-20 19:33:48
>>bgentr+(OP)
How do you look at models like temporal.io (service in front of DB) and go-workflows (direct to DB) in comparison? It seems like this is more a step back towards that traditional queue like asynq is, which is where the industry is leaving from to the model of temporal
replies(2): >>bgentr+BV >>ramchi+Zz1
7. endorp+6B[view] [source] 2023-11-20 19:37:49
>>bgentr+(OP)
How does this compare to https://github.com/vgarvardt/gue?
replies(2): >>gregwe+yJ >>csarva+oL
◧◩◪
8. fithis+gC[view] [source] [discussion] 2023-11-20 19:42:58
>>bgentr+Co
An Airflow for Gophers?
◧◩
9. gregwe+yJ[view] [source] [discussion] 2023-11-20 20:09:34
>>endorp+6B
Or neoq. >>38352778
◧◩
10. csarva+oL[view] [source] [discussion] 2023-11-20 20:15:00
>>endorp+6B
Not familiar with either project, but it seems gue is a fork of the authors previous project, https://github.com/bgentry/que-go
replies(1): >>bgentr+oW
11. radica+ZN[view] [source] 2023-11-20 20:25:22
>>bgentr+(OP)
I don't know why people even use libraries in those languages - assuming you stick to a database engine you understand well then the (main)-database-as-queue pattern is trivial to implement. Any time spent writing code is quickly won back by not having to debug weird edge cases, and sometimes you can highly optimize what you're doing (for example it becomes easy to migrate jobs which are data-dominated to the DB server which can cut processing time by 2-3 orders of magnitude).

It's particularly suited to use cases such background jobs, workflows or other operations which occur within your application and scales well enough for what 99.9999% of us will be doing.

replies(1): >>AtlasB+9x5
◧◩
12. bgentr+BV[view] [source] [discussion] 2023-11-20 20:56:40
>>dangoo+Vz
I don't think these approaches are necessarily mutually exclusive. There are some great things that can be layered on top of the foundation we've built, including workflows. The best part about doing this is that you can maintain full transactionality within a single primary data store and not introduce another 3rd party or external service into your availability equation.
◧◩◪
13. bgentr+oW[view] [source] [discussion] 2023-11-20 20:59:45
>>csarva+oL
Yes, there's a note in the readme to that effect although I don't think they bear much resemblance anymore. que-go was an experiment I hacked up on a plane ride 9 years ago and thought was worth sharing. I was never happy with its technical design: holding a transaction for the duration of a job severely limits available use cases and worsens bloat issues. It was also never something I intended to continue developing alongside my other priorities at the time and I should have made that clearer in the project's readme from the start.
◧◩◪
14. codege+UY[view] [source] [discussion] 2023-11-20 21:08:55
>>bgentr+Co
If you could build a UI similar to Hangire [0] or Laravel Horizon [1], that would be awesome.

[0] https://hangfire.io

[1] https://github.com/laravel/horizon

15. linux2+m71[view] [source] 2023-11-20 21:45:31
>>bgentr+(OP)
Is there a minimum version of Postgres needed to use this? I’m having trouble finding that information in the docs
◧◩
16. ramchi+Zz1[view] [source] [discussion] 2023-11-21 00:32:31
>>dangoo+Vz
Personally I've found Temporal very limited as a queue: no FIFO ordering (!), no priorities, no routing, etc. It's also very complex when you just want async jobs, and more specialized than a DB or message broker, which can be used for many other things. I think there's a place for both.
17. justin+Da2[view] [source] 2023-11-21 04:45:57
>>bgentr+(OP)
Does it do job completion notification?

Along the lines of:

    _, err := river.Execute(context.Background(), j) // Enqueue the job, and wait for completion
    if err != nil {
        log.Fatalf("Unable to execute job: %s", err)
    }
    log.Printf("Job completed")
Does that make sense?
replies(1): >>bgentr+EG3
18. ThePro+pj2[view] [source] 2023-11-21 05:56:14
>>bgentr+(OP)
Really cool. I'm working on .Net project that I've also adopted a "single dependency" stance on; that being Postgres. I'm pretty thrilled to see I'm not the only one lol!

I plan to use Orleans to handle a lot of the heavy HA/scale lifting. It can likely stand in for Redis in a lot of cache use cases(in some non-obvious ways), and am anticipating writing a Postgres stream provider for it when the time comes.. Will likely end up writing a Postres job queue as well so will definitely check out River for inspiration.

A lot of postgres drivers, including the .Net defacto Npgsql, support logical decode these days which unlocks a ton of exciting use cases and patterns via log processing.

◧◩
19. bgentr+EG3[view] [source] [discussion] 2023-11-21 15:45:27
>>justin+Da2
It sounds like you're looking to be able to find out when a job has finished working, no matter which node it was run on. No, River does not have a mechanism for that today. It's definitely something we've talked about though.
◧◩
20. AtlasB+9x5[view] [source] [discussion] 2023-11-21 23:45:33
>>radica+ZN
I thought the first rule of queues was never use a database as a queue.
replies(1): >>22c+IO5
◧◩◪
21. 22c+IO5[view] [source] [discussion] 2023-11-22 01:30:17
>>AtlasB+9x5
The "problem" is that a database as a queue doesn't infinitely scale, but nothing infinitely scales. If you're starting to reach the limits of Postgres-as-a-queue then you've either done something very wrong or very right to get to that point.

It's probably more correct to say that the engineering effort required to make a Postgres-as-a-queue scale horizontally is a lot more than the engineering effort required to make a dedicated queueing service scale horizontally. The trade-off is that you're typically going to have to start scaling horizontally much sooner with your dedicated queuing service than with a Postgres database.

The argument for Postgres-as-a-queue is that you might be able to get to market much quicker, which can be significantly more important than how well you can scale down the track.

replies(1): >>AtlasB+7p7
◧◩◪◨
22. AtlasB+7p7[view] [source] [discussion] 2023-11-22 14:19:19
>>22c+IO5
I thought Kafka could relatively infinitely scale
replies(1): >>22c+ZW7
◧◩◪◨⬒
23. 22c+ZW7[view] [source] [discussion] 2023-11-22 16:45:53
>>AtlasB+7p7
I wouldn't categorise Kafka as a database.
[go to top]