Motty
터미널·SFTP·포트 포워딩·VNC·RDP·AI 도우미를 하나의 창에 통합, Go 기반 무료 오픈소스
데이터베이스 기반 내구성 TypeScript 워크플로우
Database-Backed Durable TypeScript Workflows
개발 도구TypeScript · JavaScriptGitHub @dbos-inc직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
11월 11일 17:16 확인 · 점수는 각 플랫폼이 보여 주는 값을 마지막 확인 시각에 옮긴 것입니다. 글 본문과 댓글은 옮기지 않고, 원문이 지워지면 여기서도 빠집니다.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗DBOS provides lightweight durable workflows built on top of Postgres. Instead of managing your own workflow orchestrator or task queue system, you can use DBOS to add durable workflows and queues to your program in just a few lines of code.
To get started, follow the quickstart to install this open-source library and connect it to a Postgres database. Then, annotate workflows and steps in your program to make it durable! That's all you need to do—DBOS is entirely contained in this open-source library, there's no additional infrastructure for you to configure or manage.
You should consider using DBOS if your application needs to reliably handle failures. For example, you might be building a payments service that must reliably process transactions even if servers crash mid-operation, or a long-running data pipeline that needs to resume seamlessly from checkpoints rather than restart from the beginning when interrupted.
Handling failures is costly and complicated, requiring complex state management and recovery logic as well as heavyweight tools like external orchestration services. DBOS makes it simpler: annotate your code to checkpoint it in Postgres and automatically recover from any failure. DBOS also provides powerful Postgres-backed primitives that make it easier to write and operate reliable code, including durable queues, notifications, scheduling, event processing, and programmatic workflow management.
DBOS workflows make your program durable by checkpointing its state in Postgres. If your program ever fails, when it restarts all your workflows will automatically resume from the last completed step.
You add durable workflows to your existing TypeScript program by registering ordinary functions as workflows and steps:
async function stepOne() {
DBOS.logger.info('Step one completed!');
}
async function stepTwo() {
DBOS.logger.info('Step two completed!');
}
async function workflowFunction() {
await DBOS.runStep(stepOne);
await DBOS.runStep(stepTwo);
}
const workflow = DBOS.registerWorkflow(workflowFunction);
Workflows are particularly useful for
DBOS queues help you durably run tasks in the background. You can enqueue a workflow from a durable workflow and one of your processes will pick it up for execution. 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.
Queues also provide flow control, so you can limit the concurrency of your tasks on a per-queue or per-process basis. You can also set timeouts for tasks, rate limit how often queued tasks are executed, deduplicate tasks, or prioritize tasks.
You can add queues to your workflows in just a couple lines of code. They don't require a separate queueing service or message broker—just Postgres.
import { DBOS } from '@dbos-inc/dbos-sdk';
const queueName = 'example_queue';
async function taskFunction(task) {
// ...
}
const taskWorkflow = DBOS.registerWorkflow(taskFunction, { name: 'taskWorkflow' });
async function queueFunction(tasks) {
const handles = [];
// Enqueue each task so all tasks are processed concurrently.
for (const task of tasks) {
handles.push(await DBOS.startWorkflow(taskWorkflow, { queueName })(task));
}
// Wait for each task to complete and retrieve its result.
// Return the results of all tasks.
const results = [];
for (const h of handles) {
results.push(await h.getResult());
}
return results;
}
const queueWorkflow = DBOS.registerWorkflow(queueFunction, { name: 'queueWorkflow' });
// Queue configuration is stored in Postgres, so register the queue after launch.
await DBOS.launch();
await DBOS.registerQueue(queueName);
Your workflows are stored as rows in a Postgres table, so you have full programmatic control over them. Write scripts to query workflow executions, batch pause or resume workflows, or even restart failed workflows from a specific step. Handle bugs or failures that affect thousands of workflows with power and flexibility.
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗