←back to thread

77 points KraftyOne | 4 comments | | HN request time: 0.845s | source

Hi HN - Peter from DBOS here with my co-founder Qian (qianl_cs)

Today we want to share our TypeScript library for lightweight durable execution. We’ve been working on it since last year and recently released v2.0 with a ton of new features and major API overhaul.

https://github.com/dbos-inc/dbos-transact-ts

Durable execution means persisting the execution state of your program while it runs, so if it is ever interrupted or crashes, it automatically resumes from where it left off.

Durable execution is useful for a lot of things:

- Orchestrating long-running or business-critical workflows so they seamlessly recover from any failure.

- Running reliable background jobs with no timeouts.

- Processing incoming events (e.g. from Kafka) exactly once

- Running a fault-tolerant distributed task queue

- Running a reliable cron scheduler

- Operating an AI agent, or anything that connects to an unreliable or non-deterministic API.

What’s unique about DBOS’s take on durable execution (compared to, say, Temporal) is that it’s implemented in a lightweight library that’s totally backed by Postgres. All you have to do to use DBOS is “npm install” it and annotate your program with decorators. The decorators store your program’s execution state in Postgres as it runs and recover it if it crashes. There are no other dependencies you have to manage, no separate workflow server–just your program and Postgres.

One big advantage of this approach is that you can add DBOS to ANY TypeScript application–it’s just a library. For example, you can use DBOS to add reliable background jobs or cron scheduling or queues to your Next.js app with no external dependencies except Postgres.

Also, because it’s all in Postgres, you get all the tooling you’re familiar with: backups, GUIs, CLI tools–it all just works.

Want to try DBOS out? Initialize a starter app with:

    npx @dbos-inc/create -t dbos-node-starter
Then build and start your app with:

    npm install
    npm run build
    npm run start
Also check out the docs: https://docs.dbos.dev/

We'd love to hear what you think! We’ll be in the comments for the rest of the day to answer any questions you may have.

Show context
qianli_cs ◴[] No.42728285[source]
Hello! I'm a co-founder at DBOS here and I'm happy to answer any questions :)
replies(8): >>42728445 #>>42728591 #>>42728634 #>>42728855 #>>42729596 #>>42729833 #>>42730392 #>>42762495 #
1. gbuk2013 ◴[] No.42728634[source]
FYI the “Build Crashproof Apps” button in your docs doesn’t do anything.
replies(1): >>42728751 #
2. qianli_cs ◴[] No.42728751[source]
You'll need to click either the Python or TypeScript icon. We support both languages and will add more icons there.
replies(1): >>42734091 #
3. gbuk2013 ◴[] No.42734091[source]
Thanks the icons work!

I was originally looking at the docs to see if there was any information on multi-instance (horizontally scaled) apps. Is this supported? If so, how does that work?

replies(1): >>42734463 #
4. qianli_cs ◴[] No.42734463{3}[source]
Yeah, DBOS Cloud automatically (horizontally) scales your apps. For self-hosting, you can spin up multiple instances and connect them to the same Postgres database. For fan-out patterns, you may leverage DBOS Queues. This works because DBOS uses Postgres for coordination, rate limiting, and concurrency control. For example, you can enqueue tasks that are processed by multiple instances; DBOS makes sure that each task is dequeued by one instance.

Docs for Queues and Parallelism: https://docs.dbos.dev/typescript/tutorials/queue-tutorial