You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get started, follow the [quickstart](https://docs.dbos.dev/quickstart) to install this open-source library and connect it to a Postgres database.
266
+
Then, check out the [programming guide](https://docs.dbos.dev/python/programming-guide) to learn how to build with durable workflows and queues.
265
267
266
-
A workflow can be any function with the following signature:
267
-
```golang
268
-
typeGenericWorkflowFunc[P any, R any] func(ctx context.Context, input P) (R, error)
269
-
```
268
+
## Documentation
270
269
271
-
To register a workflow call `dbos.RegisterWorkflow(dbosCtx, workflow)` after having initialized a DBOS Context. Workflows can only be registered before DBOS is launched.
270
+
[https://docs.dbos.dev](https://docs.dbos.dev)
272
271
272
+
## Examples
273
273
274
-
Workflows can run steps, which can be any function with the following signature:
To run a step within a workflow, use `RunAsStep`. Importantly, you must pass to `RunAsStep` the context received in the workflow function (see examples above.)
276
+
## DBOS vs. Other Systems
280
277
281
-
The input and output of workflows and steps are memoized in your Postgres database for workflow recovery. Under the hood, DBOS uses the [encoding/gob](https://pkg.go.dev/encoding/gob) package for serialization (this means that only exported fields will be memoized and types without exported fields will generate an error.)
278
+
<details><summary><strong>DBOS vs. Temporal</strong></summary>
282
279
283
-
##Getting started
280
+
####
284
281
285
-
Install the DBOS Transact package in your program:
282
+
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.
286
283
287
-
```shell
288
-
go get github.com/dbos-inc/dbos-transact-golang
289
-
```
284
+
You can add DBOS to your program by installing this open-source library, connecting it to Postgres, and annotating workflows and steps.
285
+
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.
286
+
[This blog post](https://www.dbos.dev/blog/durable-execution-coding-comparison) makes the comparison in more detail.
290
287
291
-
You can store and export a Postgres connection string in the `DBOS_SYSTEM_DATABASE_URL` environment variable for DBOS to manage your workflows state. By default, DBOS will use `postgres://postgres:${PGPASSWORD}@localhost:5432/dbos?sslmode=disable`.
288
+
**When to use DBOS:** You need to add durable workflows to your applications with minimal rearchitecting, or you are using Postgres.
292
289
290
+
**When to use Temporal:** You don't want to add Postgres to your stack, or you need a language DBOS doesn't support yet.
293
291
294
-
## ⭐️ Like this project?
292
+
</details>
293
+
294
+
<details><summary><strong>DBOS vs. Airflow</strong></summary>
295
+
296
+
####
297
+
298
+
DBOS and Airflow both provide workflow abstractions.
299
+
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.
300
+
Airflow is designed for batch operations and does not provide good performance for streaming or real-time use cases.
301
+
DBOS is general-purpose, but is often used for data pipelines, allowing developers to write workflows as code and requiring no infrastructure except Postgres.
302
+
303
+
**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).
295
304
305
+
**When to use Airflow:** You need Airflow's ecosystem of connectors.
306
+
307
+
</details>
308
+
309
+
<details><summary><strong>DBOS vs. Celery/BullMQ</strong></summary>
310
+
311
+
####
312
+
313
+
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.
314
+
However, DBOS queues are **durable and Postgres-backed** and integrate with durable workflows.
315
+
For example, in DBOS you can write a durable workflow that enqueues a thousand tasks and waits for their results.
316
+
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.
317
+
By contrast, Celery/BullMQ are Redis-backed and don't provide workflows, so they provide fewer guarantees but better performance.
318
+
319
+
**When to use DBOS:** You need the reliability of enqueueing tasks from durable workflows.
320
+
321
+
**When to use Celery/BullMQ**: You don't need durability, or you need very high throughput beyond what your Postgres server can support.
322
+
</details>
323
+
324
+
## ⭐️ Like this project?
296
325
[Star it on GitHub](https://github.com/dbos-inc/dbos-transact-golang)
0 commit comments