git404hub

what is dtm fr?

dtm-labs/dtm — explained in plain English

Analysis updated 2026-06-24

10,873GoAudience · developerComplexity · 4/5LicenseSetup · hard

tl;dr

DTM is an open-source Go framework for managing distributed transactions across multiple services or databases, ensuring operations either all succeed or all roll back, with SDKs for Go, Java, Python, Node.js, PHP, and C#.

vibe map

mindmap
  root((DTM))
    What it does
      Distributed transactions
      Multi-service coordination
      Automatic rollback
    Patterns
      SAGA
      TCC
      XA two-phase commit
      Workflow
    Language SDKs
      Go
      Java
      Python
      Node.js
    Databases
      MySQL
      PostgreSQL
      Redis
    Audience
      Backend developers
      Microservice teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Implement a reliable bank-transfer flow across two microservices so money is never lost or double-debited even if one service crashes mid-transfer.

VIBE 2

Add SAGA-pattern rollback to a multi-step order checkout that touches an inventory service, a payment service, and a shipping service.

VIBE 3

Replace a fragile Outbox pattern implementation with DTM's two-phase message approach for reliable event publishing after a database write.

VIBE 4

Coordinate a TCC transaction across a Go and a Java microservice without rewriting either service in the same language.

what's the stack?

GoMySQLPostgreSQLRedisMongoDB

how it stacks up fr

dtm-labs/dtmhashicorp/terraform-provider-awscontainers/skopeo
Stars10,87310,87410,859
LanguageGoGoGo
Setup difficultyhardmoderatemoderate
Complexity4/53/53/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · hard time til it works · 1h+

Requires running the DTM server separately plus configuring a supported database (MySQL, PostgreSQL, Redis, or MongoDB) before microservices can join transactions.

Open source under a permissive license, use freely in commercial and personal projects.

in plain english

DTM is a framework for managing distributed transactions, which are operations that span multiple separate services or databases and need to either all succeed or all be undone together. In a typical modern application, different parts of the system run as independent services. When a user action touches several of those services (for example, deducting money from one account and crediting another), keeping all of them in sync when something goes wrong is genuinely hard. DTM exists to solve that problem. The framework supports several well-established patterns for handling this coordination. SAGA breaks the overall transaction into a series of steps, each with a corresponding undo step if something fails. TCC (Try, Confirm, Cancel) reserves resources first before committing. XA is a classic two-phase commit standard supported by many databases. The Workflow pattern lets developers write the coordination logic in code that looks mostly like normal sequential code. There is also a two-phase message pattern described as a cleaner alternative to the traditional Outbox pattern, which is a technique for reliably publishing events when a database write happens. DTM works across multiple languages. SDKs exist for Go, Java, PHP, C#, Python, and Node.js, so teams are not locked into any single technology. On the database side it supports MySQL, MariaDB, PostgreSQL, Redis, and MongoDB. It is built in Go and can scale horizontally for high-traffic situations. Real-world users listed in the README include Tencent and Bytedance, both large technology companies, suggesting the project has been tested in demanding environments. The quick-start example in the README shows a bank transfer scenario: money moves out of one account and into another across two separate microservices, with automatic rollback if the transfer-in step fails. The project is open source and available under a permissive license.

prompts (copy fr)

prompt 1
Show me how to set up DTM with Go and implement a SAGA transaction that debits one account and credits another, with automatic rollback if the credit fails.
prompt 2
How do I integrate the DTM Java SDK into a Spring Boot microservice to participate in a distributed transaction managed by the DTM server?
prompt 3
Walk me through the DTM two-phase message pattern as a replacement for the Outbox pattern when publishing events after a MySQL write.
prompt 4
How do I deploy the DTM server and connect it to PostgreSQL so my microservices can use it for XA transactions?
prompt 5
What's the difference between DTM's SAGA, TCC, and Workflow patterns, and which one should I use for an e-commerce checkout flow?

Frequently asked questions

what is dtm fr?

DTM is an open-source Go framework for managing distributed transactions across multiple services or databases, ensuring operations either all succeed or all roll back, with SDKs for Go, Java, Python, Node.js, PHP, and C#.

What language is dtm written in?

Mainly Go. The stack also includes Go, MySQL, PostgreSQL.

What license does dtm use?

Open source under a permissive license, use freely in commercial and personal projects.

How hard is dtm to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is dtm for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.