+[Bytedance 字节](https://dtm.pub/other/using.html#bytedance)
-## Who's using DTM (partial)
+[Ivydad 常青藤爸爸](https://dtm.pub/other/using.html#ivydad)
-[Tencent](https://www.tencent.com/)
+[更多](https://dtm.pub/other/using.html)
-[Bytedance](https://www.bytedance.com/)
+## 特性
+* 支持多种语言:支持Go、Java、PHP、C#、Python、Nodejs 各种语言的SDK
+* 支持多种事务模式:SAGA、TCC、XA、二阶段消息(本地消息表,事务消息)
+* 支持多种数据库事务:Mysql、Redis、MongoDB、Postgres、TDSQL等
+* 支持多种存储引擎:Mysql(常用)、Redis(高性能)、MongoDB(规划中)
+* 支持多种微服务架构:[go-zero](https://github.com/zeromicro/go-zero)、go-kratos/kratos、polarismesh/polaris
+* 支持高可用,易水平扩展
-[Ivydad](https://ivydad.com)
+## 应用场景:
+DTM 可以应用于大量的场景下的数据一致性问题,以下是几个常见场景
+* [缓存管理](https://dtm.pub/app/cache.html):彻底保证缓存最终一致及强一致
+* [秒杀扣库存](https://dtm.pub/app/flash.html):极端情况下,也能保证Redis中精准的库存,和最终创建的订单完全一致,无需手动调整
+* [非单体的订单系统](https://dtm.pub/app/order.html): 大幅简化架构
+* [事件发布/订阅](https://dtm.pub/practice/msg.html):更好的发件箱模式
-## [Cook Book](https://en.dtm.pub)
+## 与Seata对比
-## Quick start
+| 特性| DTM | SEATA |备注|
+|:-----:|:----:|:----:|:----:|
+|[支持语言](https://dtm.pub/other/opensource.html#lang) |Go、c#、Java、python、php...|Java|dtm可轻松接入一门新语言|
+|[异常处理](https://dtm.pub/other/opensource.html#exception)| 子事务屏障自动处理 |手动处理 |dtm解决了幂等、悬挂、空补偿|
+|[SAGA事务](https://dtm.pub/other/opensource.html#saga) |极简易用 |复杂状态机 ||
+|[二阶段消息](https://dtm.pub/other/opensource.html#msg)|✓|✗|最简消息最终一致性架构|
+|[TCC事务](https://dtm.pub/other/opensource.html#tcc)| ✓|✓||
+|[XA事务](https://dtm.pub/other/opensource.html#xa)|✓|✓||
+|[AT事务](https://dtm.pub/other/opensource.html#at)|建议使用XA|✓|AT与XA类似,但有脏回滚|
+|[单服务多数据源](https://dtm.pub/other/opensource.html#multidb)|✓|✗||
-### run dtm
+从上面对比的各项特性来看,dtm在具备很多优势。详细的对比可以点击特性中的链接,跳到相关文档
+
+## [性能测试报告](https://dtm.pub/other/performance.html)
+
+## [教程与文档](https://dtm.pub)
+
+## [各语言客户端及示例](https://dtm.pub/ref/sdk.html#go)
+
+## 快速开始
+如果您不是Go语言,可以跳转[各语言客户端及示例](https://dtm.pub/ref/sdk.html#go),里面有相关的快速开始示例
+
+喜欢视频教程的朋友,可以访问[分布式事务教程-快速开始](https://www.bilibili.com/video/BV1fS4y1h7Tj/)
+
+### 运行dtm
``` bash
git clone https://github.com/dtm-labs/dtm && cd dtm
go run main.go
```
-### Start an example
-Suppose we want to perform an inter-bank transfer. The operations of transfer out (TransOut) and transfer in (TransIn) are coded in separate micro-services.
-
-Here is an example to illustrate a solution of dtm to this problem:
+### 启动并运行一个saga示例
+下面运行一个类似跨行转账的示例,包括两个事务分支:资金转出(TransOut)、资金转入(TransIn)。DTM保证TransIn和TransOut要么全部成功,要么全部回滚,保证最终金额的正确性。
``` bash
git clone https://github.com/dtm-labs/dtmcli-go-sample && cd dtmcli-go-sample
go run main.go
```
-## Code
+## 接入详解
-### Use
-``` go
- // business micro-service address
+### 接入代码
+``` GO
+ // 具体业务微服务地址
const qsBusi = "http://localhost:8081/api/busi_saga"
- // The address where DtmServer serves DTM, which is a url
+ req := &gin.H{"amount": 30} // 微服务的载荷
+ // DtmServer为DTM服务的地址,是一个url
DtmServer := "http://localhost:36789/api/dtmsvr"
- req := &gin.H{"amount": 30} // micro-service payload
- // DtmServer is the address of DTM micro-service
- saga := dtmcli.NewSaga(DtmServer, dtmcli.MustGenGid(DtmServer)).
- // add a TransOut subtraction,forward operation with url: qsBusi+"/TransOut", reverse compensation operation with url: qsBusi+"/TransOutCom"
- Add(qsBusi+"/TransOut", qsBusi+"/TransOutCom", req).
- // add a TransIn subtraction, forward operation with url: qsBusi+"/TransIn", reverse compensation operation with url: qsBusi+"/TransInCom"
- Add(qsBusi+"/TransIn", qsBusi+"/TransInCom", req)
- // submit the created saga transaction,dtm ensures all subtractions either complete or get revoked
- err := saga.Submit()
+ saga := dtmcli.NewSaga(DtmServer, dtmcli.MustGenGid(DtmServer)).
+ // 添加一个TransOut的子事务,正向操作为url: qsBusi+"/TransOut", 补偿操作为url: qsBusi+"/TransOutCom"
+ Add(qsBusi+"/TransOut", qsBusi+"/TransOutCom", req).
+ // 添加一个TransIn的子事务,正向操作为url: qsBusi+"/TransIn", 补偿操作为url: qsBusi+"/TransInCom"
+ Add(qsBusi+"/TransIn", qsBusi+"/TransInCom", req)
+ // 提交saga事务,dtm会完成所有的子事务/回滚所有的子事务
+ err := saga.Submit()
```
-When the above code runs, we can see in the console that services TransOut, TransIn has been called.
+成功运行后,可以看到TransOut、TransIn依次被调用,完成了整个分布式事务
-#### Timing diagram
-A timing diagram for a successfully completed SAGA transaction would be as follows:
+### 时序图
-
+上述saga分布式事务的时序图如下:
-#### Rollback upon failure
-If any forward operation fails, DTM invokes the corresponding compensating operation of each sub-transaction to roll back, after which the transaction is successfully rolled back.
+
-Let's purposely fail the forward operation of the second sub-transaction and watch what happens
+### 失败情况
+在实际的业务中,子事务可能出现失败,例如转入的子账号被冻结导致转账失败。我们对业务代码进行修改,让TransIn的正向操作失败,然后看看结果
``` go
-app.POST(qsBusiAPI+"/TransIn", func(c *gin.Context) {
- log.Printf("TransIn")
- // c.JSON(200, "")
- c.JSON(409, "") // Status 409 for Failure. Won't be retried
-})
+ app.POST(qsBusiAPI+"/TransIn", func(c *gin.Context) {
+ logger.Infof("TransIn")
+ c.JSON(409, "") // Status 409 表示失败,不再重试,直接回滚
+ })
```
-The timing diagram for the intended failure is as follows:
+再运行这个例子,整个事务最终失败,时序图如下:
+
+
+
+在转入操作失败的情况下,TransIn和TransOut的补偿操作被执行,保证了最终的余额和转账前是一样的。
-
+### 更多示例
+上述示例主要演示了分布式事务的流程,更多的内容,包括如何与实际的数据库对接,如何做补偿,如何做回滚等实际的例子,请参考[dtm-labs/dtm-examples](https://github.com/dtm-labs/dtm-examples)
-## More examples
+## 联系我们
+### 微信交流群
-The above example mainly demonstrates the flow of a distributed transaction. More on this, including practical examples of how to interface with an actual database, how to do compensation, how to do rollback, etc. please refer to [dtm-examples](https://github.com/dtm-labs/dtm-examples) for more examples.
+如果您希望更快的获得反馈,或者更多的了解其他用户在使用过程中的各种反馈,欢迎加入我们的微信交流群
-## Chat Group
+请加作者的微信 yedf2008 好友或者扫码加好友,备注 `dtm` 按照指引进群
-Join the chat via [https://discord.gg/dV9jS5Rb33](https://discord.gg/dV9jS5Rb33).
+
-## Give a star! ⭐
+欢迎使用[dtm](https://github.com/dtm-labs/dtm),或者通过dtm学习实践分布式事务相关知识,欢迎star支持我们
-If you think this project is interesting, or helpful to you, please give a star!
diff --git a/helper/README-cn.md b/helper/README-cn.md
index f7a9bfe..73c7c07 100644
--- a/helper/README-cn.md
+++ b/helper/README-cn.md
@@ -9,14 +9,7 @@
# 跨语言分布式事务管理器
-DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方式,极大的降低了分布式事务的使用门槛,改变了“能不用分布式事务就不用”的行业现状。 dtm 的应用范围非常广,可以应用于以下常见的领域:
-- [秒杀系统,保证Redis中精准的库存,和最终创建的订单完全一致,无需手动调整](https://dtm.pub/app/flash.html)
-- [保证缓存与DB的一致性](https://dtm.pub/app/cache.html)
-- [非单体的订单系统,大幅简化架构](https://dtm.pub/app/order.html)
-- 微服务架构(已原生支持[go-zero](https://github.com/zeromicro/go-zero)等框架)中跨服务更新数据保证一致性
-
-他优雅的解决了幂等、空补偿、悬挂等分布式事务难题,提供跨语言,跨存储引擎组合事务的强大功能:
-
+DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方式,极大的降低了分布式事务的使用门槛,改变了“能不用分布式事务就不用”的行业现状,优雅的解决了服务间的数据一致性问题。
## 谁在使用DTM(仅列出部分)
[Tencent 腾讯](https://dtm.pub/other/using.html#tencent)
@@ -25,27 +18,28 @@ DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方
[Ivydad 常青藤爸爸](https://dtm.pub/other/using.html#ivydad)
-## 亮点
+[更多](https://dtm.pub/other/using.html)
-* 极易上手
- - 零配置启动服务,提供非常简单的HTTP接口,极大降低上手分布式事务的难度,新手也能快速接入
-* 跨语言
- - 可适合多语言栈的公司使用。方便go、python、php、nodejs、ruby、c# 各类语言使用。
-* 使用简单
- - 开发者不再担心悬挂、空补偿、幂等各类问题,首创子事务屏障技术代为处理
-* 易部署、易扩展
- - 依赖mysql/redis,部署简单,易集群化,易水平扩展
-* 多种分布式事务协议支持
- - TCC、SAGA、XA、二阶段消息,一站式解决所有分布式事务问题
+## 特性
+* 支持多种语言:支持Go、Java、PHP、C#、Python、Nodejs 各种语言的SDK
+* 支持多种事务模式:SAGA、TCC、XA、二阶段消息(本地消息表,事务消息)
+* 支持多种数据库事务:Mysql、Redis、MongoDB、Postgres、TDSQL等
+* 支持多种存储引擎:Mysql(常用)、Redis(高性能)、MongoDB(规划中)
+* 支持多种微服务架构:[go-zero](https://github.com/zeromicro/go-zero)、go-kratos/kratos、polarismesh/polaris
+* 支持高可用,易水平扩展
-## 与其他框架对比
+## 应用场景:
+DTM 可以应用于大量的场景下的数据一致性问题,以下是几个常见场景
+* [缓存管理](https://dtm.pub/app/cache.html):彻底保证缓存最终一致及强一致
+* [秒杀扣库存](https://dtm.pub/app/flash.html):极端情况下,也能保证Redis中精准的库存,和最终创建的订单完全一致,无需手动调整
+* [非单体的订单系统](https://dtm.pub/app/order.html): 大幅简化架构
+* [事件发布/订阅](https://dtm.pub/practice/msg.html):更好的发件箱模式
-非Java语言类的,暂未看到除dtm之外的成熟框架,因此这里将DTM和Java中最成熟的Seata对比:
+## 与Seata对比
| 特性| DTM | SEATA |备注|
|:-----:|:----:|:----:|:----:|
|[支持语言](https://dtm.pub/other/opensource.html#lang) |Go、c#、Java、python、php...|Java|dtm可轻松接入一门新语言|
-|[存储引擎](https://dtm.pub/other/opensource.html#store) |支持数据库、Redis、Mongo等|数据库||
|[异常处理](https://dtm.pub/other/opensource.html#exception)| 子事务屏障自动处理 |手动处理 |dtm解决了幂等、悬挂、空补偿|
|[SAGA事务](https://dtm.pub/other/opensource.html#saga) |极简易用 |复杂状态机 ||
|[二阶段消息](https://dtm.pub/other/opensource.html#msg)|✓|✗|最简消息最终一致性架构|
@@ -53,11 +47,8 @@ DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方
|[XA事务](https://dtm.pub/other/opensource.html#xa)|✓|✓||
|[AT事务](https://dtm.pub/other/opensource.html#at)|建议使用XA|✓|AT与XA类似,但有脏回滚|
|[单服务多数据源](https://dtm.pub/other/opensource.html#multidb)|✓|✗||
-|[通信协议](https://dtm.pub/other/opensource.html#protocol)|HTTP、gRPC、go-zero|dubbo等协议|dtm对云原生更加友好|
-
-从上面对比的特性来看,dtm在许多方面都具备很大的优势。如果考虑多语言支持、多存储引擎支持,那么dtm毫无疑问是您的首选
-详细的对比可以点击特性中的链接,跳到相关文档
+从上面对比的各项特性来看,dtm在具备很多优势。详细的对比可以点击特性中的链接,跳到相关文档
## [性能测试报告](https://dtm.pub/other/performance.html)
@@ -65,12 +56,6 @@ DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方
## [各语言客户端及示例](https://dtm.pub/ref/sdk.html#go)
-## 微服务框架支持
-- [go-zero](https://github.com/zeromicro/go-zero):一开源就非常火爆的微服务框架,首家接入dtm的微服务框架。感谢go-zero作者[kevwan](https://github.com/kevwan)的大力支持
-- [kratos](https://github.com/go-kratos/kratos):这是bilibili开源的一个微服务框架。感谢[lei liu](https://github.com/Leizhengzi)的贡献
-- [polaris](https://github.com/polarismesh/polaris): 腾讯开源的注册发现组件,以及在其上构建的微服务框架。感谢腾讯同学[ychensha](https://github.com/ychensha)的PR
-- 其他:看用户需求量,择机接入,参见[微服务支持](https://dtm.pub/ref/proto.html)
-
## 快速开始
如果您不是Go语言,可以跳转[各语言客户端及示例](https://dtm.pub/ref/sdk.html#go),里面有相关的快速开始示例
@@ -137,10 +122,11 @@ go run main.go
上述示例主要演示了分布式事务的流程,更多的内容,包括如何与实际的数据库对接,如何做补偿,如何做回滚等实际的例子,请参考[dtm-labs/dtm-examples](https://github.com/dtm-labs/dtm-examples)
## 联系我们
-### 公众号
-dtm官方公众号:分布式事务,大量干货分享,以及dtm的最新消息
-### 交流群
-请加 yedf2008 好友或者扫码加好友,验证回复 dtm 按照指引进群
+### 微信交流群
+
+如果您希望更快的获得反馈,或者更多的了解其他用户在使用过程中的各种反馈,欢迎加入我们的微信交流群
+
+请加作者的微信 yedf2008 好友或者扫码加好友,备注 `dtm` 按照指引进群

From fa8ad16b3cba2f9eb10725073c1ec0423ea522a4 Mon Sep 17 00:00:00 2001
From: yedf2 <120050102@qq.com>
Date: Sun, 15 May 2022 12:03:59 +0800
Subject: [PATCH 02/79] update dashboard
---
dashboard/src/layout/aside.vue | 3 ++-
dtmsvr/entry/main.go | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dashboard/src/layout/aside.vue b/dashboard/src/layout/aside.vue
index 050369a..c05c2e5 100644
--- a/dashboard/src/layout/aside.vue
+++ b/dashboard/src/layout/aside.vue
@@ -4,6 +4,7 @@