# dtm-labs/dtm

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dtm-labs-dtm).**

10,881 stars · 1,000 forks · Go · BSD-3-Clause

## Links

- GitHub: https://github.com/dtm-labs/dtm
- Homepage: http://d.dtm.pub
- awesome-repositories: https://awesome-repositories.com/repository/dtm-labs-dtm.md

## Topics

`cadence` `csharp` `database` `distributed` `distributed-transactions` `dtm` `go` `golang` `java` `microservice` `outbox` `saga` `seata` `tcc` `transaction` `transactions` `workflow-engine` `xa`

## Description

dtm is a distributed transaction framework and polyglot transaction coordinator designed to maintain data consistency across microservices. It functions as a Saga orchestration engine and a two-phase message coordinator, ensuring that multi-service operations either succeed completely or roll back to a consistent state.

The project distinguishes itself by supporting multiple consistency patterns, including Saga, TCC, XA, and outbox patterns, allowing users to select the appropriate model for their specific application requirements. It provides a polyglot integration layer via HTTP and gRPC, enabling services written in different programming languages to participate in a single coordinated workflow.

Its broader capabilities cover anomaly prevention to block stale or duplicate requests, crash-resilient recovery mechanisms to resume interrupted transactions, and cache-database synchronization to align Redis states with persistent records. It also includes high-concurrency utilities for inventory handling and cache protection.

The system is designed for horizontal scaling and requires only a database server as an external dependency, supporting backends such as MySQL, Redis, MongoDB, and Postgres.

## Tags

### Software Engineering & Architecture

- [Distributed Transaction Coordinators](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-coordinators.md) — Acts as a centralized coordinator managing the execution sequence and state of distributed operations across independent services.
- [Saga Coordinators](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-coordinators/saga-coordinators.md) — Acts as a specialized coordinator for managing distributed transactions through local events and compensating rollback operations. ([source](https://en.dtm.pub/app/order.html))
- [Compensating Action Definitions](https://awesome-repositories.com/f/software-engineering-architecture/compensating-action-definitions.md) — Allows registering specific rollback actions for each step to undo partial progress when any transaction step fails. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Rollback Workflows](https://awesome-repositories.com/f/software-engineering-architecture/distributed-consistency-models/rollback-workflows.md) — Records completed steps and executes compensating actions to restore a consistent state when a distributed operation fails. ([source](https://en.dtm.pub/app/order.html))
- [Automatic Compensation Coordination](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-coordinators/automatic-compensation-coordination.md) — Triggers automatic rollback operations for completed sub-transactions when a subsequent step in the process fails. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Two-Phase Commit Protocols](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-coordinators/two-phase-commit-protocols.md) — Guarantees atomic execution of local business operations and message submission using a prepared state and asynchronous confirmation.
- [Distributed Transaction Managers](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-managers.md) — Implements a system for managing complex distributed operations as sagas with automated compensation logic to avoid common transaction pitfalls. ([source](https://en.dtm.pub/))
- [Distributed Transaction Patterns](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-patterns.md) — Supports multiple consistency patterns including Saga, TCC, XA, and Outbox to match specific application requirements. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Operation Idempotency](https://awesome-repositories.com/f/software-engineering-architecture/idempotency-mechanisms/operation-idempotency.md) — Filters duplicate requests for the same transaction to ensure business logic executes exactly once. ([source](https://en.dtm.pub/app/order.html))
- [Request-Level Idempotency](https://awesome-repositories.com/f/software-engineering-architecture/idempotency-mechanisms/operation-idempotency/request-level-idempotency.md) — Prevents duplicate side effects by tracking request identifiers and blocking stale or repeated transactional calls.
- [Database-Backed Persistence](https://awesome-repositories.com/f/software-engineering-architecture/job-processors/database-backed-persistence.md) — Persists transaction logs and progress in external databases to ensure durability and support horizontal scalability.
- [Microservice Orchestration](https://awesome-repositories.com/f/software-engineering-architecture/microservice-orchestration.md) — Connects services written in different programming languages via HTTP or gRPC to participate in coordinated business workflows.
- [Transactional Workflow Execution](https://awesome-repositories.com/f/software-engineering-architecture/transactional-workflow-execution.md) — Runs user-defined sequences of transactional branches with individual forward and rollback logic as a single atomic unit. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Workflow Compensation Systems](https://awesome-repositories.com/f/software-engineering-architecture/workflow-compensation-systems.md) — Implements automated rollback and cleanup logic by invoking compensating actions when any step in a distributed workflow fails.
- [Distributed Transaction Anomaly Prevention](https://awesome-repositories.com/f/software-engineering-architecture/distributed-transaction-anomaly-prevention.md) — The project skips compensating operations when the corresponding forward operation was never executed to avoid unintended side effects. ([source](https://en.dtm.pub/app/order.html))
- [Message Table Elimination](https://awesome-repositories.com/f/software-engineering-architecture/message-table-elimination.md) — Eliminates the need for message queues and polling tasks by using a two-phase commit approach for eventual consistency. ([source](https://en.dtm.pub/practice/msg.html))
- [Mixed Synchronous and Asynchronous Dispatch](https://awesome-repositories.com/f/software-engineering-architecture/mixed-synchronous-and-asynchronous-dispatch.md) — Dispatches both asynchronous and synchronous downstream service calls within a single two-phase message transaction. ([source](https://en.dtm.pub/practice/msg.html))
- [Outbox Pattern Implementations](https://awesome-repositories.com/f/software-engineering-architecture/outbox-pattern-implementations.md) — Implements a reliable outbox pattern to manage event-driven communication between services. ([source](https://github.com/dtm-labs/dtm/blob/main/helper/README-cn.md))
- [Stale Request Blocking](https://awesome-repositories.com/f/software-engineering-architecture/stale-request-blocking.md) — Prevents inconsistent states by blocking late-arriving forward operations that occur after a transaction has already rolled back. ([source](https://en.dtm.pub/app/order.html))
- [Synchronous Transaction Awaiting](https://awesome-repositories.com/f/software-engineering-architecture/synchronous-transaction-awaiting.md) — Blocks the caller until all downstream services in a transaction finish to coordinate business logic requiring immediate confirmation. ([source](https://en.dtm.pub/practice/msg.html))
- [Transactional Outbox Patterns](https://awesome-repositories.com/f/software-engineering-architecture/transactional-outbox-patterns.md) — Guarantees reliable event publishing by recording messages in a local database before dispatching them to downstream services.

### Data & Databases

- [Transaction Idempotency](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/atomic-transactions/atomic-transactional-commits/transaction-idempotency.md) — Filters duplicate requests and blocks null compensation, suspension, and stale operations to maintain transactional correctness.
- [Distributed Atomic Transactions](https://awesome-repositories.com/f/data-databases/distributed-atomic-transactions.md) — Combines business logic operations with a global transaction commit to ensure both succeed or fail together. ([source](https://en.dtm.pub/app/flash.html))
- [Distributed Transaction Participants](https://awesome-repositories.com/f/data-databases/distributed-transaction-participants.md) — Connects with MySQL, Redis, MongoDB, and Postgres as active participants in a distributed transaction. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Global Transaction Session Persistence](https://awesome-repositories.com/f/data-databases/in-memory-session-stores/relational-database-session-stores/global-transaction-session-persistence.md) — Stores distributed transaction state and session information across various backends like MySQL, Redis, and MongoDB. ([source](https://github.com/dtm-labs/dtm/blob/main/helper/README-cn.md))
- [Cache Consistency Managers](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching-strategies/query-result-caching/cache-consistency-managers.md) — Manages consistency between Redis cache and database records using two-phase message transactions.
- [Strongly Consistent Cache Reads](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching-strategies/query-result-caching/cache-consistency-managers/strongly-consistent-cache-reads.md) — Routes all data reads through the cache and utilizes distributed transactions to update database and cache atomically. ([source](https://en.dtm.pub/app/cache.html))
- [Distributed Cache Synchronizers](https://awesome-repositories.com/f/data-databases/distributed-state-synchronizers/distributed-cache-synchronizers.md) — Synchronizes cached data in Redis with the final state of database records after a distributed transaction completes. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Transactional Cache Updates](https://awesome-repositories.com/f/data-databases/distributed-state-synchronizers/distributed-cache-synchronizers/transactional-cache-updates.md) — Uses a two-phase message pattern to atomically update the database and asynchronously update the cache for eventual consistency.
- [Memory-Optimized Processing](https://awesome-repositories.com/f/data-databases/high-performance-data-infrastructures/memory-optimized-processing.md) — Processes thousands of requests per second by executing inventory checks and global transactions in memory. ([source](https://en.dtm.pub/app/flash.html))
- [Inventory Caches](https://awesome-repositories.com/f/data-databases/in-memory-caches/inventory-caches.md) — Maintains precise alignment between Redis inventory and orders under extreme concurrency for flash sales. ([source](https://github.com/dtm-labs/dtm/blob/main/helper/README-cn.md))
- [Pluggable Storage Backends](https://awesome-repositories.com/f/data-databases/persistent-storage-backends/pluggable-storage-backends.md) — Supports persisting transaction progress in MySQL, Redis, BoltDB, or MongoDB to balance performance and durability. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))

### Development Tools & Productivity

- [SDK Integrations](https://awesome-repositories.com/f/development-tools-productivity/sdk-integrations.md) — Provides language-specific SDKs for heterogeneous services to participate in coordinated transactions.
- [Crash Recovery Systems](https://awesome-repositories.com/f/development-tools-productivity/crash-recovery-systems.md) — Queries the local database after a crash to determine the prepared transaction's state and resume or abort the global transaction.

### DevOps & Infrastructure

- [Automatic Completion Guarantees](https://awesome-repositories.com/f/devops-infrastructure/transaction-management/transaction-retry-logic/automatic-completion-guarantees.md) — Implements automatic retries for failed or interrupted operations after a process crash to ensure transactions reach a finished state. ([source](https://en.dtm.pub/app/order.html))
- [Crash Recovery Resumptions](https://awesome-repositories.com/f/devops-infrastructure/workflow-run-management/stateful-run-resumption/crash-recovery-resumptions.md) — Queries the local database after a restart to determine the status of pending transactions and resume execution.
- [Horizontal Scaling Strategies](https://awesome-repositories.com/f/devops-infrastructure/distributed-systems/horizontal-scaling-strategies.md) — Distributes transaction coordination across multiple nodes to ensure high availability and handle increased load. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Lean Infrastructure Dependencies](https://awesome-repositories.com/f/devops-infrastructure/lean-infrastructure-dependencies.md) — Runs with only a database server as an external dependency, removing the need for message queues.
- [Reliable Message Delivery](https://awesome-repositories.com/f/devops-infrastructure/message-queues/reliable-message-delivery.md) — Guarantees atomic delivery of events without external message queues by implementing the outbox and two-phase messaging patterns.
- [Queue-less Asynchronous Dispatch](https://awesome-repositories.com/f/devops-infrastructure/queue-management/message-queues/asynchronous-message-publishing/queue-less-asynchronous-dispatch.md) — Triggers remote service calls asynchronously without requiring dedicated message queue infrastructure. ([source](https://en.dtm.pub/practice/msg.html))
- [Sub-Transaction Branching](https://awesome-repositories.com/f/devops-infrastructure/transaction-orchestrators/sub-transaction-branching.md) — Executes each service call as an independent branch with its own forward and rollback logic via a central orchestrator.
- [Transaction State Backchecks](https://awesome-repositories.com/f/devops-infrastructure/workflow-run-management/stateful-run-resumption/crash-recovery-resumptions/transaction-state-backchecks.md) — Queries the local database after a crash to determine transaction status and resume or abort the global process. ([source](https://en.dtm.pub/practice/msg.html))

### Networking & Communication

- [gRPC Microservices Integration](https://awesome-repositories.com/f/networking-communication/grpc-microservices-integration.md) — Accepts transaction requests over HTTP and gRPC to integrate with diverse service communication patterns. ([source](https://en.dtm.pub/))
- [Multi-Protocol Transaction Orchestration](https://awesome-repositories.com/f/networking-communication/multi-protocol-transaction-orchestration.md) — Coordinates multi-service operations across TCC, SAGA, XA, and transaction message protocols to ensure data consistency. ([source](https://en.dtm.pub/))
- [Transactional Message Coordination](https://awesome-repositories.com/f/networking-communication/transactional-message-coordination.md) — Guarantees atomic execution of local database operations and remote message delivery without requiring a message queue.
- [Messaging Reliability](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/messaging-notification-systems/messaging-reliability.md) — Uses Outbox or two-phase message patterns to ensure messages reach subscribers without data loss. ([source](https://cdn.jsdelivr.net/gh/dtm-labs/dtm@main/README.md))
- [Message Delivery Guarantees](https://awesome-repositories.com/f/networking-communication/message-delivery-guarantees.md) — Guarantees eventual delivery of messages across services using a two-phase message pattern. ([source](https://github.com/dtm-labs/dtm/blob/main/helper/README-cn.md))
- [Polyglot Worker Protocols](https://awesome-repositories.com/f/networking-communication/polyglot-client-support/grpc-implementations/polyglot-worker-protocols.md) — Uses language-specific SDKs to connect heterogeneous services to the coordinator via HTTP or gRPC.

### Programming Languages & Runtimes

- [Polyglot Workflow Orchestration](https://awesome-repositories.com/f/programming-languages-runtimes/multi-language-integration/polyglot-workflow-orchestration.md) — Connects various language runtimes into a single transaction workflow to ensure consistent data processing. ([source](https://en.dtm.pub/))

### Business & Productivity Software

- [High-Concurrency Sales Systems](https://awesome-repositories.com/f/business-productivity-software/high-concurrency-sales-systems.md) — Coordinates inventory deduction and order creation to maintain eventual consistency during high-volume flash sales. ([source](https://en.dtm.pub/app/flash.html))

### System Administration & Monitoring

- [Stale Request Blocking](https://awesome-repositories.com/f/system-administration-monitoring/distributed-transaction-analysis/stale-request-blocking.md) — Detects and blocks stale or out-of-order requests that could cause inconsistent state in a distributed transaction. ([source](https://en.dtm.pub/app/order.html))
