This is an automated email from the ASF dual-hosted git repository.
wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new c2993b01568 update core-feature-transaction doc (#19082)
c2993b01568 is described below
commit c2993b015681ff83ed988ae40bec86e4e101b103
Author: JingShang Lu <[email protected]>
AuthorDate: Wed Jul 13 10:42:21 2022 +0800
update core-feature-transaction doc (#19082)
---
.../content/features/transaction/_index.cn.md | 51 ++++++++++++++++++++-
.../content/features/transaction/_index.en.md | 53 +++++++++++++++++++++-
.../features/transaction/concept/_index.cn.md | 12 -----
.../features/transaction/concept/_index.en.md | 12 -----
.../features/transaction/concept/base.cn.md | 13 ------
.../features/transaction/concept/base.en.md | 14 ------
.../content/features/transaction/concept/xa.cn.md | 18 --------
.../content/features/transaction/concept/xa.en.md | 19 --------
.../features/transaction/use-norms/_index.cn.md | 10 ----
.../features/transaction/use-norms/_index.en.md | 11 -----
.../features/transaction/use-norms/base.cn.md | 19 --------
.../features/transaction/use-norms/base.en.md | 19 --------
.../transaction/use-norms/local-transaction.cn.md | 13 ------
.../transaction/use-norms/local-transaction.en.md | 13 ------
.../features/transaction/use-norms/xa.cn.md | 18 --------
.../features/transaction/use-norms/xa.en.md | 18 --------
16 files changed, 102 insertions(+), 211 deletions(-)
diff --git a/docs/document/content/features/transaction/_index.cn.md
b/docs/document/content/features/transaction/_index.cn.md
index 7cfb6eb97e9..26a8fe03598 100644
--- a/docs/document/content/features/transaction/_index.cn.md
+++ b/docs/document/content/features/transaction/_index.cn.md
@@ -5,7 +5,7 @@ weight = 5
chapter = true
+++
-## 背景
+## 定义
事务四个特性 ACID(原子性、一致性、隔离性、持久性)。
@@ -22,6 +22,55 @@ chapter = true
XA 协议最早的分布式事务模型是由 `X/Open` 国际联盟提出的 `X/Open Distributed Transaction Processing
(DTP)` 模型,简称 XA 协议。
+## 使用限制
+
+虽然 Apache ShardingSphere 希望能够完全兼容所有的分布式事务场景,并在性能上达到最优,但在 CAP
定理所指导下,分布式事务必然有所取舍。
+Apache ShardingSphere 希望能够将分布式事务的选择权交给使用者,在不同的场景用使用最适合的分布式事务解决方案。
+
+### LOCAL 事务
+
+#### 支持项
+
+* 完全支持非跨库事务,例如:仅分表,或分库但是路由的结果在单库中;
+* 完全支持因逻辑异常导致的跨库事务。例如:同一事务中,跨两个库更新。更新完毕后,抛出空指针,则两个库的内容都能够回滚。
+
+#### 不支持项
+
+* 不支持因网络、硬件异常导致的跨库事务。例如:同一事务中,跨两个库更新,更新完毕后、未提交之前,第一个库宕机,则只有第二个库数据提交,且无法回滚。
+
+### XA 事务
+
+#### 支持项
+
+* 支持 Savepoint 嵌套事务;
+* PostgreSQL/OpenGauss 事务块内,SQL 执行出现异常,执行 `Commit`,事务自动回滚;
+* 支持数据分片后的跨库事务;
+* 两阶段提交保证操作的原子性和数据的强一致性;
+* 服务宕机重启后,提交/回滚中的事务可自动恢复;
+* 支持同时使用 XA 和非 XA 的连接池。
+
+#### 不支持项
+
+* 服务宕机后,在其它机器上恢复提交/回滚中的数据;
+* MySQL 事务块内,SQL 执行出现异常,执行 `Commit`,数据保持一致。
+
+### BASE 事务
+
+#### 支持项
+
+* 支持数据分片后的跨库事务;
+* 支持 RC 隔离级别;
+* 通过 undo 快照进行事务回滚;
+* 支持服务宕机后的,自动恢复提交中的事务。
+
+#### 不支持项
+
+* 不支持除 RC 之外的隔离级别。
+
+#### 待优化项
+
+* Apache ShardingSphere 和 SEATA 重复 SQL 解析。
+
## 原理介绍
ShardingSphere 对外提供 begin/commit/rollback 传统事务接口,通过 LOCAL,XA,BASE
三种模式提供了分布式事务的能力,
diff --git a/docs/document/content/features/transaction/_index.en.md
b/docs/document/content/features/transaction/_index.en.md
index f91ab3f3fd6..7bd2b07a86f 100644
--- a/docs/document/content/features/transaction/_index.en.md
+++ b/docs/document/content/features/transaction/_index.en.md
@@ -5,7 +5,7 @@ weight = 5
chapter = true
+++
-## Background
+## Definition
Four properties of transactions: ACID
(Atomicity、Consistency、Isolation、Durability).
@@ -22,6 +22,57 @@ Distributed transactions guarantee the ACID properties in
distributed scenarios,
The original distributed transaction model of XA protocol is the "X/Open
Distributed Transaction Processing (DTP)" model, XA protocol for short, which
was proposed by the X/Open international consortium.
+## Limitations
+
+Though Apache ShardingSphere intends to be compatible with all distributed
scenario and best performance, under CAP theorem guidance, there is no sliver
bullet with distributed transaction solution.
+
+Apache ShardingSphere wants to give the user choice of distributed transaction
type and use the most suitable solution in different scenarios.
+
+### LOCAL Transaction
+
+#### Supported
+
+* Support none-cross-database transactions. For example, sharding table or
sharding database with its route result in same database;
+* Support cross-database transactions caused by logic exceptions. For example,
update two databases in transaction with exception thrown, data can rollback in
both databases.
+
+#### Unsupported
+
+* Do not support the cross-database transactions caused by network or hardware
crash. For example, when update two databases in transaction, if one database
crashes before commit, then only the data of the other database can commit.
+
+### XA Transaction
+
+#### Supported
+
+* Support Savepoint;
+* PostgreSQL/OpenGauss, in the transaction block, the SQL execution is
abnormal,then run `Commit`,transactions are automatically rollback;
+* Support cross-database transactions after sharding;
+* Operation atomicity and high data consistency in 2PC transactions;
+* When service is down and restarted, commit and rollback transactions can be
recovered automatically;
+* Support use XA and non-XA connection pool together.
+
+#### Unsupported
+
+* Recover committing and rolling back in other machines after the service is
down;
+* MySQL,in the transaction block, the SQL execution is abnormal, and run
`Commit`, and data remains consistent.
+
+### BASE Transaction
+
+#### Supported
+
+* Support cross-database transactions after sharding;
+* Support RC isolation level;
+* Rollback transaction according to undo log;
+* Support recovery committing transaction automatically after the service is
down.
+
+#### Unsupported
+
+* Do not support other isolation level except RC.
+
+#### To Be Optimized
+
+* SQL parsed twice by Apache ShardingSphere and SEATA.
+
+
## How it works
ShardingSphere provides begin/ commit/rollback traditional transaction
interfaces externally, and provides distributed transaction capabilities
through LOCAL, XA and BASE modes.
diff --git a/docs/document/content/features/transaction/concept/_index.cn.md
b/docs/document/content/features/transaction/concept/_index.cn.md
deleted file mode 100644
index e7a9df3f384..00000000000
--- a/docs/document/content/features/transaction/concept/_index.cn.md
+++ /dev/null
@@ -1,12 +0,0 @@
-+++
-title = "核心概念"
-weight = 1
-chapter = true
-+++
-
-## 导览
-
-本小节主要介绍分布式事务的核心概念,主要包括:
-
-* 基于 XA 协议的两阶段事务
-* 基于最终一致性的柔性事务
diff --git a/docs/document/content/features/transaction/concept/_index.en.md
b/docs/document/content/features/transaction/concept/_index.en.md
deleted file mode 100644
index 8b36ac79e5f..00000000000
--- a/docs/document/content/features/transaction/concept/_index.en.md
+++ /dev/null
@@ -1,12 +0,0 @@
-+++
-title = "Core Concept"
-weight = 1
-chapter = true
-+++
-
-## Navigation
-
-This chapter mainly introduces the core concepts of distributed transactions,
including:
-
-* XA transaction
-* BASE transaction
diff --git a/docs/document/content/features/transaction/concept/base.cn.md
b/docs/document/content/features/transaction/concept/base.cn.md
deleted file mode 100644
index 3c1cfa14843..00000000000
--- a/docs/document/content/features/transaction/concept/base.cn.md
+++ /dev/null
@@ -1,13 +0,0 @@
-+++
-title = "柔性事务"
-weight = 3
-+++
-
-柔性事务在 2008 年发表的一篇[论文](https://queue.acm.org/detail.cfm?id=1394128)中被最早提到,
-它提倡采用最终一致性放宽对强一致性的要求,以达到事务处理并发度的提升。
-
-TCC 和 Saga 是两种常见实现方案。
-他们主张开发者自行实现对数据库的反向操作,来达到数据在回滚时仍能够保证最终一致性。
-[SEATA](https://github.com/seata/seata) 实现了 SQL
反向操作的自动生成,可以使柔性事务不再必须由开发者介入才能使用。
-
-Apache ShardingSphere 集成了 SEATA 作为柔性事务的使用方案。
diff --git a/docs/document/content/features/transaction/concept/base.en.md
b/docs/document/content/features/transaction/concept/base.en.md
deleted file mode 100644
index 1d430327c3f..00000000000
--- a/docs/document/content/features/transaction/concept/base.en.md
+++ /dev/null
@@ -1,14 +0,0 @@
-+++
-title = "BASE"
-weight = 3
-+++
-
-A [paper](https://queue.acm.org/detail.cfm?id=1394128) published in 2008 first
mentioned on BASE transaction,
-it advocates the use of eventual consistency to instead of consistency when
improve concurrency of transaction processing.
-
-TCC and Saga are two regular implementations.
-They use reverse operation implemented by developers themselves to ensure the
eventual consistency when data rollback.
-[SEATA](https://github.com/seata/seata) implements SQL reverse operation
automatically,
-so that BASE transaction can be used without the intervention of developers.
-
-Apache ShardingSphere integrates SEATA as solution of BASE transaction.
diff --git a/docs/document/content/features/transaction/concept/xa.cn.md
b/docs/document/content/features/transaction/concept/xa.cn.md
deleted file mode 100644
index fb244163931..00000000000
--- a/docs/document/content/features/transaction/concept/xa.cn.md
+++ /dev/null
@@ -1,18 +0,0 @@
-+++
-title = "XA 事务"
-weight = 1
-+++
-
-两阶段事务提交采用的是 X/OPEN 组织所定义的 [DTP
模型](http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf)所抽象的 AP(应用程序),
TM(事务管理器)和 RM(资源管理器) 概念来保证分布式事务的强一致性。
-其中 TM 与 RM 间采用 XA 的协议进行双向通信。
-与传统的本地事务相比,XA 事务增加了准备阶段,数据库除了被动接受提交指令外,还可以反向通知调用方事务是否可以被提交。
-`TM` 可以收集所有分支事务的准备结果,并于最后进行原子提交,以保证事务的强一致性。
-
-
-
-Java 通过定义 JTA 接口实现了 XA 模型,JTA 接口中的 `ResourceManager` 需要数据库厂商提供 XA 驱动实现,
-`TransactionManager` 则需要事务管理器的厂商实现,传统的事务管理器需要同应用服务器绑定,因此使用的成本很高。
-而嵌入式的事务管理器可以通过 jar 形式提供服务,同 Apache ShardingSphere 集成后,可保证分片后跨库事务强一致性。
-
-通常,只有使用了事务管理器厂商所提供的 XA 事务连接池,才能支持 XA 的事务。
-Apache ShardingSphere 在整合 XA 事务时,采用分离 XA 事务管理和连接池管理的方式,做到对应用程序的零侵入。
diff --git a/docs/document/content/features/transaction/concept/xa.en.md
b/docs/document/content/features/transaction/concept/xa.en.md
deleted file mode 100644
index 55063ac9bd2..00000000000
--- a/docs/document/content/features/transaction/concept/xa.en.md
+++ /dev/null
@@ -1,19 +0,0 @@
-+++
-title = "XA"
-weight = 1
-+++
-
-2PC transaction submit uses the [DTP
Model](http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf) defined by
X/OPEN,
-in which created AP (Application Program), TM (Transaction Manager) and RM
(Resource Manager) can guarantee a high transaction consistency.
-TM and RM use XA protocol for bidirectional streaming.
-Compared with traditional local transactions, XA transactions have a prepared
phase, where the database cannot only passively receive commands, but also
notify the submitter whether the transaction can be accepted.
-TM can collect all the prepared results of branch transactions before
submitting all of them together, which has guaranteed the distributed
consistency.
-
-
-
-Java implements the XA model through defining a JTA interface, in which
`ResourceManager` requires an XA driver provided by database manufacturers and
`TransactionManager` is provided by transaction manager manufacturers.
-Traditional transaction managers need to be bound with application server,
which poises a high use cost. Built-in transaction managers have already been
able to provide services through jar packages.
-Integrated with Apache ShardingSphere, it can guarantee the high consistency
in cross-database transactions after sharding.
-
-Usually, to use XA transaction, users must use its connection pool provided by
transaction manager manufacturers.
-However, when Apache ShardingSphere integrates XA transactions, it has
separated the management of XA transaction and its connection pool, so XA will
not invade the applications.
diff --git a/docs/document/content/features/transaction/use-norms/_index.cn.md
b/docs/document/content/features/transaction/use-norms/_index.cn.md
deleted file mode 100644
index 1c3a513426d..00000000000
--- a/docs/document/content/features/transaction/use-norms/_index.cn.md
+++ /dev/null
@@ -1,10 +0,0 @@
-+++
-title = "使用规范"
-weight = 2
-chapter = true
-+++
-
-## 背景
-
-虽然 Apache ShardingSphere 希望能够完全兼容所有的分布式事务场景,并在性能上达到最优,但在 CAP
定理所指导下,分布式事务必然有所取舍。
-Apache ShardingSphere 希望能够将分布式事务的选择权交给使用者,在不同的场景用使用最适合的分布式事务解决方案。
diff --git a/docs/document/content/features/transaction/use-norms/_index.en.md
b/docs/document/content/features/transaction/use-norms/_index.en.md
deleted file mode 100644
index 399415777c6..00000000000
--- a/docs/document/content/features/transaction/use-norms/_index.en.md
+++ /dev/null
@@ -1,11 +0,0 @@
-+++
-title = "Use Norms"
-weight = 2
-chapter = true
-+++
-
-## Background
-
-Though Apache ShardingSphere intends to be compatible with all distributed
scenario and best performance, under CAP theorem guidance, there is no sliver
bullet with distributed transaction solution.
-
-Apache ShardingSphere wants to give the user choice of distributed transaction
type and use the most suitable solution in different scenarios.
diff --git a/docs/document/content/features/transaction/use-norms/base.cn.md
b/docs/document/content/features/transaction/use-norms/base.cn.md
deleted file mode 100644
index 454b7ad2011..00000000000
--- a/docs/document/content/features/transaction/use-norms/base.cn.md
+++ /dev/null
@@ -1,19 +0,0 @@
-+++
-title = "柔性事务"
-weight = 3
-+++
-
-## 支持项
-
-* 支持数据分片后的跨库事务;
-* 支持 RC 隔离级别;
-* 通过 undo 快照进行事务回滚;
-* 支持服务宕机后的,自动恢复提交中的事务。
-
-## 不支持项
-
-* 不支持除 RC 之外的隔离级别。
-
-## 待优化项
-
-* Apache ShardingSphere 和 SEATA 重复 SQL 解析。
diff --git a/docs/document/content/features/transaction/use-norms/base.en.md
b/docs/document/content/features/transaction/use-norms/base.en.md
deleted file mode 100644
index 07a7aeacb6b..00000000000
--- a/docs/document/content/features/transaction/use-norms/base.en.md
+++ /dev/null
@@ -1,19 +0,0 @@
-+++
-title = "BASE"
-weight = 3
-+++
-
-## Supported
-
-* Support cross-database transactions after sharding;
-* Support RC isolation level;
-* Rollback transaction according to undo log;
-* Support recovery committing transaction automatically after the service is
down.
-
-## Unsupported
-
-* Do not support other isolation level except RC.
-
-## To Be Optimized
-
-* SQL parsed twice by Apache ShardingSphere and SEATA.
diff --git
a/docs/document/content/features/transaction/use-norms/local-transaction.cn.md
b/docs/document/content/features/transaction/use-norms/local-transaction.cn.md
deleted file mode 100644
index 64a77377b06..00000000000
---
a/docs/document/content/features/transaction/use-norms/local-transaction.cn.md
+++ /dev/null
@@ -1,13 +0,0 @@
-+++
-title = "本地事务"
-weight = 1
-+++
-
-## 支持项
-
-* 完全支持非跨库事务,例如:仅分表,或分库但是路由的结果在单库中;
-* 完全支持因逻辑异常导致的跨库事务。例如:同一事务中,跨两个库更新。更新完毕后,抛出空指针,则两个库的内容都能够回滚。
-
-## 不支持项
-
-* 不支持因网络、硬件异常导致的跨库事务。例如:同一事务中,跨两个库更新,更新完毕后、未提交之前,第一个库宕机,则只有第二个库数据提交,且无法回滚。
diff --git
a/docs/document/content/features/transaction/use-norms/local-transaction.en.md
b/docs/document/content/features/transaction/use-norms/local-transaction.en.md
deleted file mode 100644
index 0018c82d2d6..00000000000
---
a/docs/document/content/features/transaction/use-norms/local-transaction.en.md
+++ /dev/null
@@ -1,13 +0,0 @@
-+++
-title = "Local Transaction"
-weight = 1
-+++
-
-## Supported
-
-* Support none-cross-database transactions. For example, sharding table or
sharding database with its route result in same database;
-* Support cross-database transactions caused by logic exceptions. For example,
update two databases in transaction with exception thrown, data can rollback in
both databases.
-
-## Unsupported
-
-* Do not support the cross-database transactions caused by network or hardware
crash. For example, when update two databases in transaction, if one database
crashes before commit, then only the data of the other database can commit.
diff --git a/docs/document/content/features/transaction/use-norms/xa.cn.md
b/docs/document/content/features/transaction/use-norms/xa.cn.md
deleted file mode 100644
index 766ab3e4e17..00000000000
--- a/docs/document/content/features/transaction/use-norms/xa.cn.md
+++ /dev/null
@@ -1,18 +0,0 @@
-+++
-title = "XA 事务"
-weight = 2
-+++
-
-## 支持项
-
-* 支持 Savepoint 嵌套事务;
-* PostgreSQL/OpenGauss 事务块内,SQL 执行出现异常,执行 `Commit`,事务自动回滚;
-* 支持数据分片后的跨库事务;
-* 两阶段提交保证操作的原子性和数据的强一致性;
-* 服务宕机重启后,提交/回滚中的事务可自动恢复;
-* 支持同时使用 XA 和非 XA 的连接池。
-
-## 不支持项
-
-* 服务宕机后,在其它机器上恢复提交/回滚中的数据;
-* MySQL 事务块内,SQL 执行出现异常,执行 `Commit`,数据保持一致。
diff --git a/docs/document/content/features/transaction/use-norms/xa.en.md
b/docs/document/content/features/transaction/use-norms/xa.en.md
deleted file mode 100644
index 250fd1f26bd..00000000000
--- a/docs/document/content/features/transaction/use-norms/xa.en.md
+++ /dev/null
@@ -1,18 +0,0 @@
-+++
-title = "XA"
-weight = 2
-+++
-
-## Supported
-
-* Support Savepoint;
-* PostgreSQL/OpenGauss, in the transaction block, the SQL execution is
abnormal,then run `Commit`,transactions are automatically rollback;
-* Support cross-database transactions after sharding;
-* Operation atomicity and high data consistency in 2PC transactions;
-* When service is down and restarted, commit and rollback transactions can be
recovered automatically;
-* Support use XA and non-XA connection pool together.
-
-## Unsupported
-
-* Recover committing and rolling back in other machines after the service is
down;
-* MySQL,in the transaction block, the SQL execution is abnormal, and run
`Commit`, and data remains consistent.