본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #4342

dbos-golang

하는 일

이 가이드는 DBOS라는 기술을 사용해 안정적이고 장애에 강한 Go 프로그램을 만드는 방법을 설명합니다. 코드를 '워크플로'와 '단계'라는 부분으로 정리하는 방법을 알려 줍니다.

사용하는 경우

  • ✓기존 Go 프로젝트에 DBOS를 추가할 때.
  • ✓새 프로그램 부분(워크플로와 단계)을 만들 때.
  • ✓큐를 사용해 동시에 실행되는 작업 수를 조절할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dbos-golang/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dbos-golang/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Go 애플리케이션에서 DBOS를 어떻게 설정하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

DBOS는 코드를 '워크플로'(더 큰 과정)와 '단계'(워크플로 안의 작은 작업)로 정리합니다. 무엇인가 잘못되더라도 작업이 안정적으로 실행되도록 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

DBOS Go Best Practices

Guide for building reliable, fault-tolerant Go applications with DBOS durable workflows.

When to Use

Reference these guidelines when:

  • Adding DBOS to existing Go code
  • Creating workflows and steps
  • Using queues for concurrency control
  • Implementing workflow communication (events, messages, streams)
  • Configuring and launching DBOS applications
  • Using the DBOS Client from external applications
  • Testing DBOS applications

Rule Categories by Priority

Priority Category Impact Prefix
1 Lifecycle CRITICAL lifecycle-
2 Workflow CRITICAL workflow-
3 Step HIGH step-
4 Queue HIGH queue-
5 Communication MEDIUM comm-
6 Pattern MEDIUM pattern-
7 Testing LOW-MEDIUM test-
8 Client MEDIUM client-
9 Advanced LOW advanced-

Critical Rules

Installation

Install the DBOS Go module:

go get github.com/dbos-inc/dbos-transact-golang/dbos@latest

DBOS Configuration and Launch

A DBOS application MUST create a context, register workflows, and launch before running any workflows:

package main

import (
	"context"
	"log"
	"os"
	"time"

	"github.com/dbos-inc/dbos-transact-golang/dbos"
)

func main() {
	ctx, err := dbos.NewDBOSContext(context.Background(), dbos.Config{
		AppName:     "my-app",
		DatabaseURL: os.Getenv("DBOS_SYSTEM_DATABASE_URL"),
	})
	if err != nil {
		log.Fatal(err)
	}
	defer dbos.Shutdown(ctx, 30*time.Second)

	dbos.RegisterWorkflow(ctx, myWorkflow)

	if err := dbos.Launch(ctx); err != nil {
		log.Fatal(err)
	}
}

Workflow and Step Structure

Workflows are comprised of steps. Any function performing complex operations or accessing external services must be run as a step using dbos.RunAsStep:

func fetchData(ctx context.Context) (string, error) {
	resp, err := http.Get("https://api.example.com/data")
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	return string(body), nil
}

func myWorkflow(ctx dbos.DBOSContext, input string) (string, error) {
	result, err := dbos.RunAsStep(ctx, fetchData, dbos.WithStepName("fetchData"))
	if err != nil {
		return "", err
	}
	return result, nil
}

Key Constraints

  • Do NOT start or enqueue workflows from within steps
  • Do NOT use uncontrolled goroutines to start workflows - use dbos.RunWorkflow with queues or dbos.Go/dbos.Select for concurrent steps
  • Workflows MUST be deterministic - non-deterministic operations go in steps
  • Do NOT modify global variables from workflows or steps
  • All workflows and queues MUST be registered before calling Launch()

How to Use

Read individual rule files for detailed explanations and examples:

references/lifecycle-config.md
references/workflow-determinism.md
references/queue-concurrency.md

References

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
자주 묻는 질문

'워크플로'란 무엇인가요?

더 크고 안정적인 작업을 함께 수행하는 일련의 작업들입니다.

'단계'란 무엇인가요?

워크플로 안의 작은 작업 단위입니다. 외부와 상호작용하거나 복잡한 작업은 단계로 만들어야 합니다.

왜 DBOS를 사용하나요?

Go 프로그램을 더 견고하게 만들어, 실패가 발생해도 계속 실행되고 작업이 올바르게 완료되도록 하기 위해서입니다.

상세 정보

작성자의 원본 설명

Guide for building reliable, fault-tolerant Go applications with DBOS durable workflows. Use when adding DBOS to existing Go code, creating workflows and steps, or using queues for concurrency control.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4342
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬