Live data from Hacker News

I solved a distributed queue problem after 15 years

dbos.dev

11–20 of 45 posts

Re: I solved a distributed queue problem after 15 years

#11

Regarding the "Durable Queueing Tradeoffs", doesn't Kafka prove you can be both durable and highly performant?

Kafka is a wonderful technology that punts on the most difficult part of distributed stream processing and makes it the consumer's problem.

What's the most difficult part of distributed stream processing?

Re: I solved a distributed queue problem after 15 years

#12

While this does talk about durable queues , this post really hinges on a pivot to evangelizing durable workflows . It makes it sound like they're synonymous, when they're very much not. Specifically, this sentence bringing up workflows for the first time (emphasis mine): > "Durable queues were rare when I was at Reddit, but they’re more and more popular now. Essentially, they work by combining task queues with durabl…

> I think the biggest in the online space is probably Temporal (the one I'm currently using at $DAYJOB), but there's others as well.

The reason none of the others were mentioned is because they all work very differently than DBOS. All of those others require an external durability coordinator, and require you to rewrite your application to work around how they operate.

DBOS is a library that does its durability work in process and uses the application database to store the durability state. This means the latency is much smaller, and the reliability is much higher because there aren't extra moving parts in the critical path that can go down.

Here is a page about this difference: https://docs.dbos.dev/architecture

Re: I solved a distributed queue problem after 15 years

#13

While this does talk about durable queues , this post really hinges on a pivot to evangelizing durable workflows . It makes it sound like they're synonymous, when they're very much not. Specifically, this sentence bringing up workflows for the first time (emphasis mine): > "Durable queues were rare when I was at Reddit, but they’re more and more popular now. Essentially, they work by combining task queues with durabl…

Thanks. I found that very informative!

I also now have the dreadful notion of debugging a non-deterministic deadlock or race condition in a workflow that takes a week to run!

Re: I solved a distributed queue problem after 15 years

#14

While this does talk about durable queues , this post really hinges on a pivot to evangelizing durable workflows . It makes it sound like they're synonymous, when they're very much not. Specifically, this sentence bringing up workflows for the first time (emphasis mine): > "Durable queues were rare when I was at Reddit, but they’re more and more popular now. Essentially, they work by combining task queues with durabl…

Thanks for sharing your insights! You nailed the key tradeoffs of most durable workflow systems. The callback-style programming model is exactly the pain point we aim to solve with DBOS.

Instead of forcing you into a custom async runtime, DBOS lets you keep writing normal functions (this is an example in Python):

    @DBOS.workflow()
    def do_thing(foo):
        return bar

    # You can still call the workflow function like this:
    result = do_thing(fooInput)
Under the hood, DBOS checkpoints inputs/outputs so it can recover after failure, but you don't have to restructure your code around callbacks. In Python and Java we use decorators/annotations so registration feels natural, while in Go/TypeScript there's a lightweight one-time registration step. Either way, you keep the synchronous call style you'd expect.

On top of that, DBOS also supports running workflows asynchronously or through queues, so you can start with a simple function call and later scale out to async/queued execution without changing your code. That's what the article was leading into.

Re: I solved a distributed queue problem after 15 years

#15
post #13

While this does talk about durable queues , this post really hinges on a pivot to evangelizing durable workflows . It makes it sound like they're synonymous, when they're very much not. Specifically, this sentence bringing up workflows for the first time (emphasis mine): > "Durable queues were rare when I was at Reddit, but they’re more and more popular now. Essentially, they work by combining task queues with durabl…

Thanks. I found that very informative! I also now have the dreadful notion of debugging a non-deterministic deadlock or race condition in a workflow that takes a week to run!

The good news is that with durable queues and workflows, you get all the observability you need to make debugging even long running workflows pretty straightforward!

Also, check out the sibling comment for more information about durability.

Re: I solved a distributed queue problem after 15 years

#16

There are good things about this article. It seems like a nice intro for people who have never worked on this type of system. And I'm always happy to celebrate someone's win. But I feel like it was missing an overview of what actually makes distributed queues difficult (the distributed part) and why you probably don't need them if you can survive without them.

Reading it I imagine it's roughly because they started with the problem of "we have to async writes to postgres for scale" and then solved it with "we synchronously write checkpoints with enough performance and guarantees to postgres to solve scale". The middle bit was likely quite hard.

Agreed it's missing that detail. I think it makes sense though that the durable queues shouldn't need strong consistency and transaction isolation, just durability, so the DBs can probably be sharded pretty arbitrarily, maybe operate in lower isolation modes, etc, whereas the DB they need to async writes to probably does need transaction isolation and all that. I'd appreciate if the article would confirm or deny my guess here!

Re: I solved a distributed queue problem after 15 years

#17

There are good things about this article. It seems like a nice intro for people who have never worked on this type of system. And I'm always happy to celebrate someone's win. But I feel like it was missing an overview of what actually makes distributed queues difficult (the distributed part) and why you probably don't need them if you can survive without them.

Am I missing something or did the article never address the title?

> How I solved a distributed queue problem after 15 years

Well… how? The post is a nice description of durable queues, but it never explicitly says they’re a solution to a distributed queue problem, nor does it specifically define such a problem.

Is “durable queue” a brand name of a DBOS feature? Because the post doesn’t even say “and here’s how you can use DBOS for durable queues,” nor does it compare it to Kafka or any other “durable queue” solution that’s emerged in the fifteen years since the author used RabbitMQ… (btw, isn’t RMQ a durable queue…?)

Re: I solved a distributed queue problem after 15 years

#18

Regarding the "Durable Queueing Tradeoffs", doesn't Kafka prove you can be both durable and highly performant?

Kafka is great for streaming use cases, but the big advantage of Postgres-backed queues is that they can integrate with durable workflows, providing durability guarantees for larger programs. For example, a workflow can enqueue many tasks, then wait for them to complete, with fault-tolerance guarantees both for the individual tasks and the larger workflow.

Huh? Kafka messages are durable just like Postgres commits are durable. That’s why it’s used for things like Debezium that need a durable queue of CDC messages like those from the Postgres WAL.

There’s nothing inherently different about the durability of Postgres that makes it better than Kafka for implementing durable workflows. There are many reasons it’s a better choice for building a system like DBOS to implement durable workflows – ranging from ergonomics to ecosystem compatibility. But in theory you could build the same solution on Kafka, and if the company were co-founded by the Kafka creators rather than Michael Stonebraker, maybe they would have chosen that.

Re: I solved a distributed queue problem after 15 years

#19

While this does talk about durable queues , this post really hinges on a pivot to evangelizing durable workflows . It makes it sound like they're synonymous, when they're very much not. Specifically, this sentence bringing up workflows for the first time (emphasis mine): > "Durable queues were rare when I was at Reddit, but they’re more and more popular now. Essentially, they work by combining task queues with durabl…

Any programming language with an effect system could do that as well.

More recently discussed are OCaml's effect system, or Flix programming language.

Post reply on HN