mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .vscode | 5 years ago | |
| app | 5 years ago | |
| common | 5 years ago | |
| dtmsvr | 5 years ago | |
| examples | 5 years ago | |
| .gitignore | 5 years ago | |
| Dockerfile | 5 years ago | |
| README-en.md | 5 years ago | |
| README.md | 5 years ago | |
| compose.mysql.yml | 5 years ago | |
| conf.sample.yml | 5 years ago | |
| go.mod | 5 years ago | |
| go.sum | 5 years ago | |
| saga.go | 5 years ago | |
| tcc.go | 5 years ago | |
| xa.go | 5 years ago | |
README.md
轻量级分布式事务管理服务
DTM 是一款跨语言的分布式事务管理方案,在各类微服务架构中,提供高性能和简单易用的分布式事务服务。
特色
跨语言
语言无关,任何语言实现了http方式的服务,都可以接入DTM,用来管理分布式事务
多种分布式事务协议支持
支持XA,TCC,SAGA
高可用
基于数据库实现,易集群化,已水平扩展
快速开始
dtm依赖于mysql
使用已有的mysql:
cp conf.sample.yml conf.yml # 修改conf.yml
或者通过docker安装mysql
docker-compose up -f compose.mysql.yml
启动并运行saga示例
go run app/main.go
开始使用
安装
go get github.com/yedf/dtm
使用
gid := common.GenGid()
req := &gin.H{"amount": 30}
saga := dtm.SagaNew(DtmServer, gid).
Add(startBusi+"/TransOut", startBusi+"/TransOutCompensate", req).
Add(startBusi+"/TransIn", startBusi+"/TransInCompensate", req)
err := saga.Commit()
完整示例
交流群
请加 yedf2008 好友或者扫码加好友,验证回复 dtm 按照指引进群
