Browse Source

Merge pull request #331 from dtm-labs/alpha

Update readme
pull/335/head
yedf2 4 years ago
committed by GitHub
parent
commit
a788ebe5e8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      README.md
  2. 2
      helper/README-cn.md
  3. 19
      helper/README-en.md
  4. 2
      test/busi/data.go
  5. 3
      test/busi/utils.go

21
README.md

@ -11,12 +11,10 @@ English | [简体中文](https://github.com/dtm-labs/dtm/blob/main/helper/README
## What is DTM
DTM is a distributed transaction framework which provides cross-service eventual data consistency. It provides saga, tcc, xa, 2-phase message, outbox patterns 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 eventual data consistency. It provides saga, tcc, xa, 2-phase message, outbox, workflow patterns 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 />
## Features
## Who's using DTM (partial)
[Tencent](https://en.dtm.pub/other/using.html#tencent)
@ -27,6 +25,22 @@ DTM is a distributed transaction framework which provides cross-service eventual
[More](https://en.dtm.pub/other/using.html)
## Features
* Multiple languages support: SDK for Go, Java, PHP, C#, Python, Nodejs
* Support for multiple transaction modes: SAGA, TCC, XA, Workflow, Outbox
* Better Outbox: 2-phase messages, a more elegant solution than Outbox, support multi-databases
* Multiple database transaction support: Mysql, Redis, MongoDB, Postgres, TDSQL, etc.
* Support for multiple storage engines: Mysql (common), Redis (high performance), MongoDB (under planning)
* Support for multiple microservices architectures: [go-zero](https://github.com/zeromicro/go-zero), go-kratos/kratos, polarismesh/polaris
* Support for high availability and easy horizontal scaling
## Application scenarios.
DTM can be applied to data consistency issues in a large number of scenarios, here are a few common ones
* [cache management](https://en.dtm.pub/app/cache.html): thoroughly guarantee the cache final consistency and strong consistency
* [flash-sales to deduct inventory](https://en.dtm.pub/app/flash.html): in extreme cases, it is also possible to ensure that the precise inventory in Redis is exactly the same as the final order created, without the need for manual adjustment
* [Non-monolithic order system](https://en.dtm.pub/app/order.html): Dramatically simplifies the architecture
* [Event publishing/subscription](https://en.dtm.pub/practice/msg.html): better outbox model
## [Cook Book](https://en.dtm.pub)
## Quick start
@ -92,6 +106,7 @@ The timing diagram for the intended failure is as follows:
<img alt="saga-failed" src="https://en.dtm.pub/assets/saga_rollback.7989c866.jpg" height=550>
## More examples
If you want more quick start examples, please refer to [dtm-labs/quick-start-sample](https://github.com/dtm-labs/quick-start-sample)
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.

2
helper/README-cn.md

@ -108,6 +108,8 @@ go run main.go
在转入操作失败的情况下,TransIn和TransOut的补偿操作被执行,保证了最终的余额和转账前是一样的。
### 更多示例
关于更多quick start的例子,可以参考 [dtm-labs/quick-start-sample](https://github.com/dtm-labs/quick-start-sample)
上述示例主要演示了分布式事务的流程,更多的内容,包括如何与实际的数据库对接,如何做补偿,如何做回滚等实际的例子,请参考[dtm-labs/dtm-examples](https://github.com/dtm-labs/dtm-examples)
## 联系我们

19
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 framework which provides cross-service eventual data consistency. It provides saga, tcc, xa, 2-phase message, outbox patterns 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 eventual data consistency. It provides saga, tcc, xa, 2-phase message, outbox, workflow patterns 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 />
@ -25,6 +25,22 @@ DTM is a distributed transaction framework which provides cross-service eventual
[More](https://en.dtm.pub/other/using.html)
## Features
* Multiple languages support: SDK for Go, Java, PHP, C#, Python, Nodejs
* Support for multiple transaction modes: SAGA, TCC, XA, Workflow, Outbox
* Better Outbox: 2-phase messages, a more elegant solution than Outbox, support multi-databases
* Multiple database transaction support: Mysql, Redis, MongoDB, Postgres, TDSQL, etc.
* Support for multiple storage engines: Mysql (common), Redis (high performance), MongoDB (under planning)
* Support for multiple microservices architectures: [go-zero](https://github.com/zeromicro/go-zero), go-kratos/kratos, polarismesh/polaris
* Support for high availability and easy horizontal scaling
## Application scenarios.
DTM can be applied to data consistency issues in a large number of scenarios, here are a few common ones
* [cache management](https://en.dtm.pub/app/cache.html): thoroughly guarantee the cache final consistency and strong consistency
* [flash-sales to deduct inventory](https://en.dtm.pub/app/flash.html): in extreme cases, it is also possible to ensure that the precise inventory in Redis is exactly the same as the final order created, without the need for manual adjustment
* [Non-monolithic order system](https://en.dtm.pub/app/order.html): Dramatically simplifies the architecture
* [Event publishing/subscription](https://en.dtm.pub/practice/msg.html): better outbox model
## [Cook Book](https://en.dtm.pub)
## Quick start
@ -90,6 +106,7 @@ The timing diagram for the intended failure is as follows:
<img alt="saga-failed" src="https://en.dtm.pub/assets/saga_rollback.7989c866.jpg" height=550>
## More examples
If you want more quick start examples, please refer to [dtm-labs/quick-start-sample](https://github.com/dtm-labs/quick-start-sample)
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.

2
test/busi/data.go

@ -19,7 +19,7 @@ import (
// PopulateDB populate example mysql data
func PopulateDB(skipDrop bool) {
resetXaData()
ResetXaData()
file := fmt.Sprintf("%s/busi.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver)
dtmutil.RunSQLScript(BusiConf, file, skipDrop)
file = fmt.Sprintf("%s/dtmcli.barrier.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver)

3
test/busi/utils.go

@ -42,7 +42,8 @@ func txGet() *sql.Tx {
return tx
}
func resetXaData() {
// ResetXaData will rollback all pending xa transaction
func ResetXaData() {
if BusiConf.Driver != "mysql" {
return
}

Loading…
Cancel
Save