From 264479beb46ae62b37c7262bc8679d7ffabd9643 Mon Sep 17 00:00:00 2001
From: yedf2 <120050102@qq.com>
Date: Thu, 23 Dec 2021 19:10:19 +0800
Subject: [PATCH] default to en
---
README.md | 163 +++++++++++++++++++++++++-----------------------------
1 file changed, 75 insertions(+), 88 deletions(-)
diff --git a/README.md b/README.md
index 8f866fc..e106d9e 100644
--- a/README.md
+++ b/README.md
@@ -5,134 +5,121 @@
[](https://pkg.go.dev/github.com/yedf/dtm)
[](https://github.com/avelino/awesome-go#database)
-# [English Docs](https://en.dtm.pub)
-# 跨语言分布式事务管理器
+# [中文文档](http://dtm.pub)
-DTM是一款golang开发的分布式事务管理器,解决了跨数据库、跨服务、跨语言栈更新数据的一致性问题。
+# A Cross Language Transaction Manager
-他优雅的解决了幂等、空补偿、悬挂等分布式事务难题,提供了简单易用、高性能、易水平扩展的解决方案。
+## Who's using DTM
-作者受邀参加中国数据库大会分享[多语言环境下分布式事务实践](http://dtcc.it168.com/yicheng.html#b9)
+[Ivydad](https://ivydad.com)
-## 谁在使用dtm
-[Tencent 腾讯](https://www.tencent.com/)
+[Eglass](https://epeijing.cn)
-[Ivydad 常青藤爸爸](https://ivydad.com)
+[Jiou](http://jiou.me)
-[Eglass 视咖镜小二](https://epeijing.cn)
+[GoldenData]()
-[极欧科技](http://jiou.me)
+## What is DTM
-[金数智联]()
+DTM is the first distributed transaction management framework in Golang. Unlike other frameworks, DTM provides extremely easy access interfaces of HTTP and gRPC, supports multiple language bindings, and handles tricky problems of unordered sub-transactions at the framework level.
-## 亮点
+## Features
-* 极易接入
- - 支持HTTP,提供非常简单的接口,极大降低上手分布式事务的难度,新手也能快速接入
-* 使用简单
- - 开发者不再担心悬挂、空补偿、幂等各类问题,框架层代为处理
-* 跨语言
- - 可适合多语言栈的公司使用。方便go、python、php、nodejs、ruby、c# 各类语言使用。
-* 易部署、易扩展
- - 仅依赖mysql,部署简单,易集群化,易水平扩展
-* 多种分布式事务协议支持
- - TCC、SAGA、XA、事务消息
+* Extremely easy to adapt
+ - Support HTTP and gRPC, provide easy-to-use programming interfaces, lower substantially the barrier of getting started with distributed transactions. Newcomers can adapt quickly.
-## 与其他框架对比
+* Easy to use
+ - Relieving developers from worrying about suspension, null compensation, idempotent transaction, and other tricky problems, the framework layer handles them all.
-目前开源的分布式事务框架,Java的框架较多,有大厂开源的SEATA、ServiceComb-Pack,shardingsphere,以及个人开源的himly,tcc-transaction,ByteTCC等等,其中以Seata的应用最为广泛。
+* Language-agnostic
+ - Suit for companies with multiple-language stacks.
+ Easy to write bindings for Go, Python, PHP, Node.js, Ruby, and other languages.
-非Java语言类的,暂未看到除dtm之外的成熟框架,因此这里仅将DTM和Java中最成熟的Seata对比:
+* Easy to deploy, easy to extend
+ - DTM depends only on MySQL, easy to deploy, cluster, and scale horizontally.
-| 特性| DTM | SEATA |备注|
-|:-----:|:----:|:----:|:----:|
-| 支持语言 |Go、Java、python、php、c#...|Java|dtm可轻松接入一门新语言|
-|异常处理| [子事务屏障自动处理](https://zhuanlan.zhihu.com/p/388444465) |手动处理 |dtm解决了幂等、悬挂、空补偿|
-| TCC事务| ✓|✓||
-| XA事务|✓|✓||
-|AT事务|建议使用XA|✓|AT与XA类似,性能更好,但有脏回滚|
-| SAGA事务 |支持并发 |状态机模式 ||
-|事务消息|✓|✗|dtm提供类似rocketmq的事务消息|
-|单服务多数据源|✓|✗||
-|通信协议|HTTP、gRPC、go-zero|dubbo等协议|dtm对云原生更加友好|
-|star数量||
|dtm从20210604发布0.1,发展快|
+* Support for multiple distributed transaction protocol
+ - TCC, SAGA, XA, Transactional messages.
-从上面对比的特性来看,如果您的语言栈包含了Java之外的语言,那么dtm是您的首选。如果您的语言栈是Java,您也可以选择接入dtm,使用子事务屏障技术,简化您的业务编写。
+## DTM vs. others
-## [性能测试报告](https://dtm.pub/other/performance.html)
+There is no mature open-source distributed transaction framework for non-Java languages.
+Mature open-source distributed transaction frameworks for Java language include Ali's Seata, Huawei's ServiceComb-Pack, Jingdong's shardingsphere, himly, tcc-transaction, ByteTCC, and so on, of which Seata is most widely used.
-## [教程与文档](https://dtm.pub)
+The following is a comparison of the main features of dtm and Seata.
-## [各语言客户端及示例](https://dtm.pub/summary/code.html#go)
-## 微服务框架支持
-- [go-zero](https://github.com/zeromicro/go-zero):一开源就非常火爆的微服务框架,首家接入dtm的微服务框架。感谢go-zero作者[kevwan](https://github.com/kevwan)的大力支持
-- [polaris](https://github.com/polarismesh/polaris): 腾讯开源的注册发现组件,以及在其上构建的微服务框架。感谢腾讯同学[ychensha](https://github.com/ychensha)的PR
-- 其他:看用户需求量,择机接入
+| Features | DTM | Seata | Remarks |
+| :-----: | :----: | :----: | :----: |
+| Supported languages | Golang, Python, PHP, and others | Java | dtm allows easy access from a new language |
+| Exception handling | [Sub-transaction barrier](https://zhuanlan.zhihu.com/p/388444465) | manual | dtm solves idempotent transaction, hanging, null compensation |
+| TCC | ✓ | ✓ | |
+| XA | ✓ | ✓ | |
+| AT | suggest XA | ✓ | AT is similar to XA with better performance but with dirty rollback |
+| SAGA | support concurrency | complicated state-machine mode | dtm's state-machine mode is being planned |
+| Transactional Messaging | ✓ | ✗ | dtm provides Transactional Messaging similar to RocketMQ |
+| Multiple DBs in a service |✓|✗||
+| Communication protocols | HTTP, gRPC | Dubbo, no HTTP | |
+| Star count |
|
| dtm 0.1 is released from 20210604 and under fast development |
-具体微服务接入使用,参见[微服务支持](https://dtm.pub/protocol/intro.html)
-## 快速开始
+From the features' comparison above, if your language stack includes languages other than Java, then dtm is the one for you.
+If your language stack is Java, you can also choose to access dtm and use sub-transaction barrier technology to simplify your business development.
-### 获取代码
+## [Cook Book](https://en.dtm.pub)
-`git clone https://github.com/yedf/dtm && cd dtm`
+# Quick start
-### dtm依赖于mysql
+### Install
-安装[docker 20.04+](https://docs.docker.com/get-docker/)之后
+`git clone https://github.com/yedf/dtm`
-`docker-compose -f helper/compose.mysql.yml up`
+### Configure Mysql
-> 您也可以配置使用现有的mysql,需要高级权限,允许dtm创建数据库
->
-> `cp conf.sample.yml conf.yml # 修改conf.yml`
+`cp conf.sample.yml conf.yml # Modify conf.yml`
-### 启动并运行saga示例
-`go run app/main.go qs`
+### Start the example
+`go run app/main.go`
-## 开始使用
+# Code
-### 使用
-``` GO
- // 具体业务微服务地址
+### Use
+``` go
+ // business micro-service address
const qsBusi = "http://localhost:8081/api/busi_saga"
- req := &gin.H{"amount": 30} // 微服务的载荷
- // DtmServer为DTM服务的地址,是一个url
+ // The address where DtmServer serves DTM, which is a url
DtmServer := "http://localhost:36789/api/dtmsvr"
- saga := dtmcli.NewSaga(DtmServer, dtmcli.MustGenGid(DtmServer)).
- // 添加一个TransOut的子事务,正向操作为url: qsBusi+"/TransOut", 补偿操作为url: qsBusi+"/TransOutCompensate"
- Add(qsBusi+"/TransOut", qsBusi+"/TransOutCompensate", req).
- // 添加一个TransIn的子事务,正向操作为url: qsBusi+"/TransIn", 补偿操作为url: qsBusi+"/TransInCompensate"
- Add(qsBusi+"/TransIn", qsBusi+"/TransInCompensate", req)
- // 提交saga事务,dtm会完成所有的子事务/回滚所有的子事务
- err := saga.Submit()
+ 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+"/TransOutCompensate"
+ Add(qsBusi+"/TransOut", qsBusi+"/TransOutCompensate", req).
+ // add a TransIn subtraction, forward operation with url: qsBusi+"/TransIn", reverse compensation operation with url: qsBusi+"/TransInCompensate"
+ Add(qsBusi+"/TransIn", qsBusi+"/TransInCompensate", req)
+ // submit the created saga transaction,dtm ensures all subtractions either complete or get revoked
+ err := saga.Submit()
```
+### Complete example
-成功运行后,可以看到TransOut、TransIn依次被调用,完成了整个分布式事务
+Refer to [examples/quick_start.go](./examples/quick_start.go).
-### 时序图
+### Slack
-上述saga分布式事务的时序图如下:
+You can join the [DTM slack channel here](https://join.slack.com/t/dtm-w6k9662/shared_invite/zt-vkrph4k1-eFqEFnMkbmlXqfUo5GWHWw).
-
+### Wechat
-### 完整示例
-参考[examples/quick_start.go](./examples/quick_start.go)
-
-## 公众号
-您可以关注公众号:分布式事务,及时跟踪dtm的最新内容
-## 交流群
-请加 yedf2008 好友或者扫码加好友,验证回复 dtm 按照指引进群
+Add wechat friend with id yedf2008, or scan the OR code. Fill in dtm as verification.

-欢迎使用[dtm](https://github.com/yedf/dtm),或者通过dtm学习实践分布式事务相关知识,欢迎star支持我们
+### Give a star! ⭐
+
+If you think this project is good, or helpful to you, please give a star!
-## 谁在使用
+### Who is using
-
-
-
-
+