Skip to content

Commit 3e85b25

Browse files
committed
updated readme
1 parent aab454a commit 3e85b25

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,115 @@ Workflows are particularly useful for
107107

108108
</details>
109109

110+
<details><summary><strong>📒 Durable Queues</strong></summary>
111+
112+
####
113+
114+
DBOS queues help you **durably** run tasks in the background.
115+
You can enqueue a task (which can be a single step or an entire workflow) from a durable workflow and one of your processes will pick it up for execution.
116+
DBOS manages the execution of your tasks: it guarantees that tasks complete, and that their callers get their results without needing to resubmit them, even if your application is interrupted.
117+
118+
Queues also provide flow control, so you can limit the concurrency of your tasks on a per-queue or per-process basis.
119+
You can also set timeouts for tasks, rate limit how often queued tasks are executed, deduplicate tasks, or prioritize tasks.
120+
121+
You can add queues to your workflows in just a couple lines of code.
122+
They don't require a separate queueing service or message broker&mdash;just Postgres.
123+
124+
```java
125+
126+
127+
public void queuedTasks() {
128+
Queue q = new DBOS.QueueBuilder("childQ").build();
129+
130+
for (int i = 0; i < 3; i++) {
131+
132+
String wid = "child" + i;
133+
DBOSOptions options = new DBOSOptions.Builder(wid).queue(q).build();
134+
try (SetDBOSOptions o = new SetDBOSOptions(options)) {
135+
simpleService.childWorkflow(wid);
136+
}
137+
}
138+
139+
for (int i = 0 ; i < 3 ; i++) {
140+
String wid = "child"+i;
141+
WorkflowHandle h = DBOS.retrieveWorkflow(wid);
142+
System.out.println(h.getResult());
143+
}
144+
}
145+
```
146+
147+
[Read more ↗️](https://docs.dbos.dev/python/tutorials/queue-tutorial)
148+
149+
</details>
150+
151+
152+
## Getting Started
153+
154+
To get started, follow the [quickstart](https://docs.dbos.dev/quickstart) to install this open-source library and connect it to a Postgres database.
155+
Then, check out the [programming guide](https://docs.dbos.dev/python/programming-guide) to learn how to build with durable workflows and queues.
156+
157+
## Documentation
158+
159+
[https://docs.dbos.dev](https://docs.dbos.dev)
160+
161+
## Examples
162+
163+
[https://docs.dbos.dev/examples](https://docs.dbos.dev/examples)
164+
165+
## DBOS vs. Other Systems
166+
167+
<details><summary><strong>DBOS vs. Temporal</strong></summary>
168+
169+
####
170+
171+
Both DBOS and Temporal provide durable execution, but DBOS is implemented in a lightweight Postgres-backed library whereas Temporal is implemented in an externally orchestrated server.
172+
173+
You can add DBOS to your program by installing this open-source library, connecting it to Postgres, and annotating workflows and steps.
174+
By contrast, to add Temporal to your program, you must rearchitect your program to move your workflows and steps (activities) to a Temporal worker, configure a Temporal server to orchestrate those workflows, and access your workflows only through a Temporal client.
175+
[This blog post](https://www.dbos.dev/blog/durable-execution-coding-comparison) makes the comparison in more detail.
176+
177+
**When to use DBOS:** You need to add durable workflows to your applications with minimal rearchitecting, or you are using Postgres.
178+
179+
**When to use Temporal:** You don't want to add Postgres to your stack, or you need a language DBOS doesn't support yet.
180+
181+
</details>
182+
183+
<details><summary><strong>DBOS vs. Airflow</strong></summary>
184+
185+
####
186+
187+
DBOS and Airflow both provide workflow abstractions.
188+
Airflow is targeted at data science use cases, providing many out-of-the-box connectors but requiring workflows be written as explicit DAGs and externally orchestrating them from an Airflow cluster.
189+
Airflow is designed for batch operations and does not provide good performance for streaming or real-time use cases.
190+
DBOS is general-purpose, but is often used for data pipelines, allowing developers to write workflows as code and requiring no infrastructure except Postgres.
191+
192+
**When to use DBOS:** You need the flexibility of writing workflows as code, or you need higher performance than Airflow is capable of (particularly for streaming or real-time use cases).
193+
194+
**When to use Airflow:** You need Airflow's ecosystem of connectors.
195+
196+
</details>
197+
198+
<details><summary><strong>DBOS vs. Celery/BullMQ</strong></summary>
199+
200+
####
201+
202+
DBOS provides a similar queue abstraction to dedicated queueing systems like Celery or BullMQ: you can declare queues, submit tasks to them, and control their flow with concurrency limits, rate limits, timeouts, prioritization, etc.
203+
However, DBOS queues are **durable and Postgres-backed** and integrate with durable workflows.
204+
For example, in DBOS you can write a durable workflow that enqueues a thousand tasks and waits for their results.
205+
DBOS checkpoints the workflow and each of its tasks in Postgres, guaranteeing that even if failures or interruptions occur, the tasks will complete and the workflow will collect their results.
206+
By contrast, Celery/BullMQ are Redis-backed and don't provide workflows, so they provide fewer guarantees but better performance.
207+
208+
**When to use DBOS:** You need the reliability of enqueueing tasks from durable workflows.
209+
210+
**When to use Celery/BullMQ**: You don't need durability, or you need very high throughput beyond what your Postgres server can support.
211+
</details>
212+
213+
## Community
214+
215+
If you want to ask questions or hang out with the community, join us on [Discord](https://discord.gg/fMwQjeW5zg)!
216+
If you see a bug or have a feature request, don't hesitate to open an issue here on GitHub.
217+
If you're interested in contributing, check out our [contributions guide](./CONTRIBUTING.md).
218+
110219

111220

112221

0 commit comments

Comments
 (0)