Browse Source

update readme

pull/229/head
yedf2 4 years ago
parent
commit
2b7a2ce72b
  1. 94
      README.md
  2. 94
      helper/README-en.md

94
README.md

@ -11,7 +11,7 @@ English | [简体中文](https://github.com/dtm-labs/dtm/blob/main/helper/README
## What is DTM
DTM is a distributed transaction solution which provides cross-service eventually data consistency. It provides saga, tcc, xa, 2-phase message strategies for a variety of application scenarios. It also supports multiple languages and multiple store engine to form up a transaction as following:
DTM is a distributed transaction framework which provides cross-service eventually data consistency. It provides saga, tcc, xa, 2-phase message strategies for a variety of application scenarios. It also supports multiple languages and multiple store engine to form up a transaction as following:
<img alt="function-picture" src="https://en.dtm.pub/assets/function.7d5618f8.png" height=250 />
@ -26,49 +26,26 @@ DTM is a distributed transaction solution which provides cross-service eventuall
## Features
* 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.
* Language-agnostic
- Suit for companies with multiple-language stacks.
Easy to write bindings for Go, Python, PHP, Node.js, Ruby, and other languages.
* Easy to deploy, easy to extend
- DTM depends only on MySQL, easy to deploy, cluster, and scale horizontally.
* Support for multiple distributed transaction protocol
- TCC, SAGA, XA, Transactional messages.
* Support for multiple distributed transaction solutions
- TCC, SAGA, XA, 2-phases message.
## DTM vs. others
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.
The following is a comparison of the main features of dtm and Seata.
* 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.
| Features | DTM | Seata | Remarks |
| :-----: | :----: | :----: | :----: |
| Supported languages | <span style="color:green">Golang, Python, PHP, and others</span> | <span style="color:orange">Java</span> | dtm allows easy access from a new language |
| Exception handling | [Sub-transaction barrier](https://zhuanlan.zhihu.com/p/388444465) | <span style="color:orange">manual</span> | dtm solves idempotent transaction, hanging, null compensation |
| TCC | <span style="color:green"></span> | <span style="color:green"></span> | |
| XA | <span style="color:green"></span> | <span style="color:green"></span> | |
| AT | <span style="color:orange">suggest XA</span> | <span style="color:green"></span> | AT is similar to XA with better performance but with dirty rollback |
| SAGA | <span style="color:green">support concurrency</span> | <span style="color:green">complicated state-machine mode</span> | dtm's state-machine mode is being planned |
| Transactional Messaging | <span style="color:green"></span> | <span style="color:red"></span> | dtm provides Transactional Messaging similar to RocketMQ |
| Multiple DBs in a service |<span style="color:green"></span>|<span style="color:red"></span>||
| Communication protocols | <span style="color:green">HTTP, gRPC</span> | <span style="color:green">Dubbo, no HTTP</span> | |
| Star count | <img src="https://img.shields.io/github/stars/dtm-labs/dtm.svg?style=social" alt="github stars"/> | <img src="https://img.shields.io/github/stars/seata/seata.svg?style=social" alt="github stars"/> | dtm 0.1 is released from 20210604 and under fast development |
* Easy to deploy, easy to extend
- DTM depends only on MySQL/Redis, easy to deploy, cluster, and scale horizontally.
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)
# Quick start
## Quick start
### run dtm
@ -77,14 +54,17 @@ git clone https://github.com/dtm-labs/dtm && cd dtm
go run main.go
```
### Start the example
### 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:
``` bash
git clone https://github.com/dtm-labs/dtmcli-go-sample && cd dtmcli-go-sample
go run main.go
```
# Code
## Code
### Use
``` go
@ -102,29 +82,39 @@ go run main.go
// submit the created saga transaction,dtm ensures all subtractions either complete or get revoked
err := saga.Submit()
```
### Complete example
Refer to [dtm-examples](https://github.com/dtm-labs/dtm-examples).
When the above code runs, we can see in the console that services TransOut, TransIn has been called.
### Slack
#### Timing diagram
A timing diagram for a successfully completed SAGA transaction would be as follows:
You can join the [DTM slack channel here](https://join.slack.com/t/dtm-w6k9662/shared_invite/zt-vkrph4k1-eFqEFnMkbmlXqfUo5GWHWw).
<img alt="saga-success" src="https://en.dtm.pub/assets/saga_normal.59a75c01.jpg" height=300/>
### Wechat
#### 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.
Add wechat friend with id yedf2008, or scan the OR code. Fill in dtm as verification.
Let's purposely fail the forward operation of the second sub-transaction and watch what happens
![yedf2008](http://service.ivydad.com/cover/dubbingb6b5e2c0-2d2a-cd59-f7c5-c6b90aceb6f1.jpeg)
``` 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
})
```
### Give a star! ⭐
The timing diagram for the intended failure is as follows:
If you think this project is good, or helpful to you, please give a star!
<img alt="saga-failed" src="https://en.dtm.pub/assets/saga_rollback.7989c866.jpg" height=400>
## More examples
### Who is using
<div style='vertical-align: middle'>
<img alt='Tencent' height='80' src='https://dtm.pub/assets/tencent.4b87bfd8.jpeg' /img>
<img alt='Ivydad' height='80' src='https://www.ivydad.com/_nuxt/img/header-logo.5b3eb96.png'>
<img alt='Eglass' height='80' src='https://img.epeijing.cn/official-website/assets/logo.png'>
<img alt='Jiou' height='80' src='http://www.siqitech.com.cn/img/logo.3f6c2914.png'>
<img alt='GoldenData' height='80' src='https://pic1.zhimg.com/80/v2-dc1d0cef5f7b72be345fc34d768e69e3_1440w.png'>
</div>
Refer to [dtm-examples](https://github.com/dtm-labs/dtm-examples).
## Slack
You can join the [DTM slack channel here](https://join.slack.com/t/dtm-w6k9662/shared_invite/zt-vkrph4k1-eFqEFnMkbmlXqfUo5GWHWw).
## Give a star! ⭐
If you think this project is good, or helpful to you, please give a star!

94
helper/README-en.md

@ -11,7 +11,7 @@ English | [简体中文](https://github.com/dtm-labs/dtm/blob/main/helper/README
## What is DTM
DTM is a distributed transaction solution which provides cross-service eventually data consistency. It provides saga, tcc, xa, 2-phase message strategies for a variety of application scenarios. It also supports multiple languages and multiple store engine to form up a transaction as following:
DTM is a distributed transaction framework which provides cross-service eventually data consistency. It provides saga, tcc, xa, 2-phase message strategies for a variety of application scenarios. It also supports multiple languages and multiple store engine to form up a transaction as following:
<img alt="function-picture" src="https://en.dtm.pub/assets/function.7d5618f8.png" height=250 />
@ -26,49 +26,26 @@ DTM is a distributed transaction solution which provides cross-service eventuall
## Features
* 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.
* Language-agnostic
- Suit for companies with multiple-language stacks.
Easy to write bindings for Go, Python, PHP, Node.js, Ruby, and other languages.
* Easy to deploy, easy to extend
- DTM depends only on MySQL, easy to deploy, cluster, and scale horizontally.
* Support for multiple distributed transaction protocol
- TCC, SAGA, XA, Transactional messages.
* Support for multiple distributed transaction solutions
- TCC, SAGA, XA, 2-phases message.
## DTM vs. others
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.
The following is a comparison of the main features of dtm and Seata.
* 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.
| Features | DTM | Seata | Remarks |
| :-----: | :----: | :----: | :----: |
| Supported languages | <span style="color:green">Golang, Python, PHP, and others</span> | <span style="color:orange">Java</span> | dtm allows easy access from a new language |
| Exception handling | [Sub-transaction barrier](https://zhuanlan.zhihu.com/p/388444465) | <span style="color:orange">manual</span> | dtm solves idempotent transaction, hanging, null compensation |
| TCC | <span style="color:green"></span> | <span style="color:green"></span> | |
| XA | <span style="color:green"></span> | <span style="color:green"></span> | |
| AT | <span style="color:orange">suggest XA</span> | <span style="color:green"></span> | AT is similar to XA with better performance but with dirty rollback |
| SAGA | <span style="color:green">support concurrency</span> | <span style="color:green">complicated state-machine mode</span> | dtm's state-machine mode is being planned |
| Transactional Messaging | <span style="color:green"></span> | <span style="color:red"></span> | dtm provides Transactional Messaging similar to RocketMQ |
| Multiple DBs in a service |<span style="color:green"></span>|<span style="color:red"></span>||
| Communication protocols | <span style="color:green">HTTP, gRPC</span> | <span style="color:green">Dubbo, no HTTP</span> | |
| Star count | <img src="https://img.shields.io/github/stars/dtm-labs/dtm.svg?style=social" alt="github stars"/> | <img src="https://img.shields.io/github/stars/seata/seata.svg?style=social" alt="github stars"/> | dtm 0.1 is released from 20210604 and under fast development |
* Easy to deploy, easy to extend
- DTM depends only on MySQL/Redis, easy to deploy, cluster, and scale horizontally.
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)
# Quick start
## Quick start
### run dtm
@ -77,14 +54,17 @@ git clone https://github.com/dtm-labs/dtm && cd dtm
go run main.go
```
### Start the example
### 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:
``` bash
git clone https://github.com/dtm-labs/dtmcli-go-sample && cd dtmcli-go-sample
go run main.go
```
# Code
## Code
### Use
``` go
@ -102,29 +82,39 @@ go run main.go
// submit the created saga transaction,dtm ensures all subtractions either complete or get revoked
err := saga.Submit()
```
### Complete example
Refer to [dtm-examples](https://github.com/dtm-labs/dtm-examples).
When the above code runs, we can see in the console that services TransOut, TransIn has been called.
### Slack
#### Timing diagram
A timing diagram for a successfully completed SAGA transaction would be as follows:
You can join the [DTM slack channel here](https://join.slack.com/t/dtm-w6k9662/shared_invite/zt-vkrph4k1-eFqEFnMkbmlXqfUo5GWHWw).
<img alt="saga-success" src="https://en.dtm.pub/assets/saga_normal.59a75c01.jpg" height=350/>
### Wechat
#### 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.
Add wechat friend with id yedf2008, or scan the OR code. Fill in dtm as verification.
Let's purposely fail the forward operation of the second sub-transaction and watch what happens
![yedf2008](http://service.ivydad.com/cover/dubbingb6b5e2c0-2d2a-cd59-f7c5-c6b90aceb6f1.jpeg)
``` 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
})
```
### Give a star! ⭐
The timing diagram for the intended failure is as follows:
If you think this project is good, or helpful to you, please give a star!
<img alt="saga-failed" src="https://en.dtm.pub/assets/saga_rollback.7989c866.jpg" height=450>
## More examples
### Who is using
<div style='vertical-align: middle'>
<img alt='Tencent' height='80' src='https://dtm.pub/assets/tencent.4b87bfd8.jpeg' /img>
<img alt='Ivydad' height='80' src='https://www.ivydad.com/_nuxt/img/header-logo.5b3eb96.png'>
<img alt='Eglass' height='80' src='https://img.epeijing.cn/official-website/assets/logo.png'>
<img alt='Jiou' height='80' src='http://www.siqitech.com.cn/img/logo.3f6c2914.png'>
<img alt='GoldenData' height='80' src='https://pic1.zhimg.com/80/v2-dc1d0cef5f7b72be345fc34d768e69e3_1440w.png'>
</div>
Refer to [dtm-examples](https://github.com/dtm-labs/dtm-examples).
## Slack
You can join the [DTM slack channel here](https://join.slack.com/t/dtm-w6k9662/shared_invite/zt-vkrph4k1-eFqEFnMkbmlXqfUo5GWHWw).
## Give a star! ⭐
If you think this project is good, or helpful to you, please give a star!

Loading…
Cancel
Save