Skip to content

Commit c8c2e99

Browse files
committed
update readme
1 parent 120b143 commit c8c2e99

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

README.md

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dbos-inc/dbos-transact-golang?sort=semver)](https://github.com/dbos-inc/dbos-transact-golang/releases)
66
[![Join Discord](https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white)](https://discord.com/invite/jsmC6pXGgX)
77
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8+
[![GitHub Stars](https://img.shields.io/github/stars/dbos-inc/dbos-transact-golang?style=social)](https://github.com/dbos-inc/dbos-transact-golang)
89

910

1011
# DBOS Transact: Lightweight Durable Workflow Orchestration with Postgres
@@ -260,38 +261,63 @@ recvResult, err := recvHandle.GetResult()
260261

261262
</details>
262263

264+
## Getting Started
263265

264-
## DBOS workflows
266+
To get started, follow the [quickstart](https://docs.dbos.dev/quickstart) to install this open-source library and connect it to a Postgres database.
267+
Then, check out the [programming guide](https://docs.dbos.dev/python/programming-guide) to learn how to build with durable workflows and queues.
265268

266-
A workflow can be any function with the following signature:
267-
```golang
268-
type GenericWorkflowFunc[P any, R any] func(ctx context.Context, input P) (R, error)
269-
```
269+
## Documentation
270270

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.
271+
[https://docs.dbos.dev](https://docs.dbos.dev)
272272

273+
## Examples
273274

274-
Workflows can run steps, which can be any function with the following signature:
275-
```golang
276-
type GenericStepFunc[R any] func(ctx context.Context) (R, error)
277-
```
275+
[https://docs.dbos.dev/examples](https://docs.dbos.dev/examples)
278276

279-
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.)
277+
## DBOS vs. Other Systems
280278

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.)
279+
<details><summary><strong>DBOS vs. Temporal</strong></summary>
282280

283-
## Getting started
281+
####
284282

285-
Install the DBOS Transact package in your program:
283+
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.
286284

287-
```shell
288-
go get github.com/dbos-inc/dbos-transact-golang
289-
```
285+
You can add DBOS to your program by installing this open-source library, connecting it to Postgres, and annotating workflows and steps.
286+
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.
287+
[This blog post](https://www.dbos.dev/blog/durable-execution-coding-comparison) makes the comparison in more detail.
290288

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`.
289+
**When to use DBOS:** You need to add durable workflows to your applications with minimal rearchitecting, or you are using Postgres.
292290

291+
**When to use Temporal:** You don't want to add Postgres to your stack, or you need a language DBOS doesn't support yet.
293292

294-
## ⭐️ Like this project?
293+
</details>
295294

296-
[Star it on GitHub](https://github.com/dbos-inc/dbos-transact-golang)
297-
[![GitHub Stars](https://img.shields.io/github/stars/dbos-inc/dbos-transact-golang?style=social)](https://github.com/dbos-inc/dbos-transact-golang)
295+
<details><summary><strong>DBOS vs. Airflow</strong></summary>
296+
297+
####
298+
299+
DBOS and Airflow both provide workflow abstractions.
300+
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.
301+
Airflow is designed for batch operations and does not provide good performance for streaming or real-time use cases.
302+
DBOS is general-purpose, but is often used for data pipelines, allowing developers to write workflows as code and requiring no infrastructure except Postgres.
303+
304+
**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).
305+
306+
**When to use Airflow:** You need Airflow's ecosystem of connectors.
307+
308+
</details>
309+
310+
<details><summary><strong>DBOS vs. Celery/BullMQ</strong></summary>
311+
312+
####
313+
314+
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.
315+
However, DBOS queues are **durable and Postgres-backed** and integrate with durable workflows.
316+
For example, in DBOS you can write a durable workflow that enqueues a thousand tasks and waits for their results.
317+
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.
318+
By contrast, Celery/BullMQ are Redis-backed and don't provide workflows, so they provide fewer guarantees but better performance.
319+
320+
**When to use DBOS:** You need the reliability of enqueueing tasks from durable workflows.
321+
322+
**When to use Celery/BullMQ**: You don't need durability, or you need very high throughput beyond what your Postgres server can support.
323+
</details>

0 commit comments

Comments
 (0)