You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/07/13 10:20:58 UTC

[shardingsphere] branch master updated: Add best practices doc for transaction (#19090)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 4f15b70e828 Add best practices doc for transaction (#19090)
4f15b70e828 is described below

commit 4f15b70e828888c0d9880f1e32c623c272b73840
Author: JingShang Lu <ji...@gmail.com>
AuthorDate: Wed Jul 13 18:20:51 2022 +0800

    Add best practices doc for transaction (#19090)
    
    * add best practices doc for transaction
    
    * fix
    
    * fix
    
    * fix
---
 docs/document/content/best-practices/_index.cn.md     |  8 ++++++++
 docs/document/content/best-practices/_index.en.md     |  8 ++++++++
 .../document/content/best-practices/transaction.cn.md | 18 ++++++++++++++++++
 .../document/content/best-practices/transaction.en.md | 19 +++++++++++++++++++
 docs/document/content/downloads/_index.cn.md          |  2 +-
 docs/document/content/downloads/_index.en.md          |  4 ++--
 .../content/features/transaction/_index.en.md         |  2 +-
 docs/document/content/reference/_index.cn.md          |  4 ++--
 docs/document/content/reference/_index.en.md          |  4 ++--
 .../content/reference/api-change-history/_index.cn.md |  2 +-
 .../content/reference/api-change-history/_index.en.md |  2 +-
 docs/document/content/reference/distsql/_index.cn.md  |  2 +-
 docs/document/content/reference/distsql/_index.en.md  |  2 +-
 docs/document/content/reference/encrypt/_index.cn.md  |  2 +-
 docs/document/content/reference/encrypt/_index.en.md  |  2 +-
 docs/document/content/reference/faq/_index.cn.md      |  2 +-
 docs/document/content/reference/faq/_index.en.md      |  2 +-
 .../content/reference/management/_index.cn.md         |  2 +-
 .../content/reference/management/_index.en.md         |  2 +-
 docs/document/content/reference/scaling/_index.cn.md  |  2 +-
 docs/document/content/reference/scaling/_index.en.md  |  2 +-
 docs/document/content/reference/shadow/_index.cn.md   |  2 +-
 docs/document/content/reference/shadow/_index.en.md   |  2 +-
 docs/document/content/reference/sharding/_index.cn.md |  2 +-
 docs/document/content/reference/sharding/_index.en.md |  2 +-
 docs/document/content/reference/test/_index.cn.md     |  2 +-
 docs/document/content/reference/test/_index.en.md     |  2 +-
 .../content/reference/transaction/_index.cn.md        |  2 +-
 .../content/reference/transaction/_index.en.md        |  2 +-
 29 files changed, 81 insertions(+), 28 deletions(-)

diff --git a/docs/document/content/best-practices/_index.cn.md b/docs/document/content/best-practices/_index.cn.md
new file mode 100644
index 00000000000..baafde57acd
--- /dev/null
+++ b/docs/document/content/best-practices/_index.cn.md
@@ -0,0 +1,8 @@
++++
+pre = "<b>7. </b>"
+title = "最佳实践"
+weight = 7
+chapter = true
++++
+
+本章节面向 Apache ShardingSphere 的用户,阐述各个功能的最佳实践。
\ No newline at end of file
diff --git a/docs/document/content/best-practices/_index.en.md b/docs/document/content/best-practices/_index.en.md
new file mode 100644
index 00000000000..e367336e151
--- /dev/null
+++ b/docs/document/content/best-practices/_index.en.md
@@ -0,0 +1,8 @@
++++
+pre = "<b>7. </b>"
+title = "Best Practices"
+weight = 7
+chapter = true
++++
+
+This chapter is aimed at users of Apache ShardingSphere and describes best practices for each feature.
\ No newline at end of file
diff --git a/docs/document/content/best-practices/transaction.cn.md b/docs/document/content/best-practices/transaction.cn.md
new file mode 100644
index 00000000000..5127fac3914
--- /dev/null
+++ b/docs/document/content/best-practices/transaction.cn.md
@@ -0,0 +1,18 @@
++++
+pre = "<b>7.2. </b>"
+title = "分布式事务"
+weight = 2
+chapter = true
++++
+
+## 适用场景
+
+Apache ShardingSphere 提供分布式场景下的事务语义,当有事务需求时,可以使用。ShardingSphere 提供了三种事务模式:LOCAL,XA,BASE,以应对不同的场景。
+
+- LOCAL:适用于对数据一致性要求不高的场景。
+- XA:提供了原子性的保证,保证了数据不丢,不保证快照读。适用于对一致性要求相对高,没有快照读要求的场景。在对一致性要求较高的场景,较好的选择是使用 XA 的 Narayana 实现。
+- BASE:在一致性和性能之间做了权衡,具体参考 Seata 官网。
+
+## 操作步骤
+
+参考 [ShardingSphere 使用 XA Narayana](cn/user-manual/shardingsphere-jdbc/special-api/transaction/narayana.cn.md)
\ No newline at end of file
diff --git a/docs/document/content/best-practices/transaction.en.md b/docs/document/content/best-practices/transaction.en.md
new file mode 100644
index 00000000000..00f090443c3
--- /dev/null
+++ b/docs/document/content/best-practices/transaction.en.md
@@ -0,0 +1,19 @@
++++
+pre = "<b>7.2. </b>"
+title = "Distributed Transaction"
+weight = 2
+chapter = true
++++
+
+## Scenarios
+
+Apache ShardingSphere provides transaction semantics in distributed scenarios that can be used when transactional are required.
+ShardingSphere provides three transaction modes: LOCAL, XA, and BASE to address different scenarios.
+
+- LOCAL: Suitable for scenarios where data consistency requirements are not high.
+- XA: Provides atomicity guarantees, ensures that data is not lost, and snapshot reads are not guaranteed. Suitable for scenarios where consistency requirements are relatively high and there is no snapshot read requirement. In scenarios where consistency is required, a better choice is a Narayana implementation using XA.
+- BASE: A trade-off was made between consistency and performance, for details see Seata website.
+
+## Procedure
+
+See [ShardingSphere Using XA Narayana](en/user-manual/shardingsphere-jdbc/special-api/transaction/narayana.en.md)
\ No newline at end of file
diff --git a/docs/document/content/downloads/_index.cn.md b/docs/document/content/downloads/_index.cn.md
index 775ca0b9f0b..fc608274038 100644
--- a/docs/document/content/downloads/_index.cn.md
+++ b/docs/document/content/downloads/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>8. </b>"
+pre = "<b>9. </b>"
 title = "下载"
 weight = 8
 chapter = true
diff --git a/docs/document/content/downloads/_index.en.md b/docs/document/content/downloads/_index.en.md
index 7fcef29dde4..8950da583f5 100644
--- a/docs/document/content/downloads/_index.en.md
+++ b/docs/document/content/downloads/_index.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>8. </b>"
+pre = "<b>9. </b>"
 title = "Downloads"
-weight = 8
+weight = 9
 chapter = true
 extracss = true
 +++
diff --git a/docs/document/content/features/transaction/_index.en.md b/docs/document/content/features/transaction/_index.en.md
index 7bd2b07a86f..4d734309095 100644
--- a/docs/document/content/features/transaction/_index.en.md
+++ b/docs/document/content/features/transaction/_index.en.md
@@ -124,5 +124,5 @@ The following table can be used for comparison to help developers choose the sui
 | Concurrent performance | no loss        | severe loss          | slight loss       |
 | Applied scenarios  | Inconsistent processing by the business side | short transaction & low-level concurrency | long transaction & high concurrency |
 
-## Related reference
+## Related references
 - [YAML distributed transaction configuration](/en/user-manual/shardingsphere-jdbc/yaml-config/rules/transaction/)
diff --git a/docs/document/content/reference/_index.cn.md b/docs/document/content/reference/_index.cn.md
index 7e2a550c6d0..ce3bf579b77 100644
--- a/docs/document/content/reference/_index.cn.md
+++ b/docs/document/content/reference/_index.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>7. </b>"
+pre = "<b>8. </b>"
 title = "技术参考"
-weight = 7
+weight = 8
 chapter = true
 +++
 
diff --git a/docs/document/content/reference/_index.en.md b/docs/document/content/reference/_index.en.md
index b7a16bd64a7..7a1366182e2 100644
--- a/docs/document/content/reference/_index.en.md
+++ b/docs/document/content/reference/_index.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>7. </b>"
+pre = "<b>8. </b>"
 title = "Reference"
-weight = 7
+weight = 8
 chapter = true
 +++
 
diff --git a/docs/document/content/reference/api-change-history/_index.cn.md b/docs/document/content/reference/api-change-history/_index.cn.md
index a748a01eb1e..31e8436c8a5 100644
--- a/docs/document/content/reference/api-change-history/_index.cn.md
+++ b/docs/document/content/reference/api-change-history/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.9. </b>"
+pre = "<b>8.9. </b>"
 title = "API 变更历史"
 weight = 9
 chapter = true
diff --git a/docs/document/content/reference/api-change-history/_index.en.md b/docs/document/content/reference/api-change-history/_index.en.md
index fd962d0cf3e..6f12183d819 100644
--- a/docs/document/content/reference/api-change-history/_index.en.md
+++ b/docs/document/content/reference/api-change-history/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.9. </b>"
+pre = "<b>8.9. </b>"
 title = "API Change Histories"
 weight = 9
 chapter = true
diff --git a/docs/document/content/reference/distsql/_index.cn.md b/docs/document/content/reference/distsql/_index.cn.md
index ace849eb6e6..0476394f572 100644
--- a/docs/document/content/reference/distsql/_index.cn.md
+++ b/docs/document/content/reference/distsql/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.10. </b>"
+pre = "<b>8.10. </b>"
 title = "DistSQL"
 weight = 10
 chapter = true
diff --git a/docs/document/content/reference/distsql/_index.en.md b/docs/document/content/reference/distsql/_index.en.md
index 32d9ac9d139..af436020b40 100644
--- a/docs/document/content/reference/distsql/_index.en.md
+++ b/docs/document/content/reference/distsql/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.10. </b>"
+pre = "<b>8.10. </b>"
 title = "DistSQL"
 weight = 10
 chapter = true
diff --git a/docs/document/content/reference/encrypt/_index.cn.md b/docs/document/content/reference/encrypt/_index.cn.md
index 2603ea70e66..d190e1ec7fb 100644
--- a/docs/document/content/reference/encrypt/_index.cn.md
+++ b/docs/document/content/reference/encrypt/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.5. </b>"
+pre = "<b>8.5. </b>"
 title = "数据加密"
 weight = 5
 +++
diff --git a/docs/document/content/reference/encrypt/_index.en.md b/docs/document/content/reference/encrypt/_index.en.md
index 752cd2bba03..17a9a513676 100644
--- a/docs/document/content/reference/encrypt/_index.en.md
+++ b/docs/document/content/reference/encrypt/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.5. </b>"
+pre = "<b>8.5. </b>"
 title = "Encryption"
 weight = 5
 +++
diff --git a/docs/document/content/reference/faq/_index.cn.md b/docs/document/content/reference/faq/_index.cn.md
index 16041f1d500..3a5e5a44317 100644
--- a/docs/document/content/reference/faq/_index.cn.md
+++ b/docs/document/content/reference/faq/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.8. </b>"
+pre = "<b>8.8. </b>"
 title = "FAQ"
 weight = 8
 chapter = true
diff --git a/docs/document/content/reference/faq/_index.en.md b/docs/document/content/reference/faq/_index.en.md
index 8219ab782c4..be9ca30df35 100644
--- a/docs/document/content/reference/faq/_index.en.md
+++ b/docs/document/content/reference/faq/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.8. </b>"
+pre = "<b>8.8. </b>"
 title = "FAQ"
 weight = 8
 chapter = true
diff --git a/docs/document/content/reference/management/_index.cn.md b/docs/document/content/reference/management/_index.cn.md
index 34ee38745bf..5add7dc8eca 100644
--- a/docs/document/content/reference/management/_index.cn.md
+++ b/docs/document/content/reference/management/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.1. </b>"
+pre = "<b>8.1. </b>"
 title = "管控"
 weight = 1
 +++
diff --git a/docs/document/content/reference/management/_index.en.md b/docs/document/content/reference/management/_index.en.md
index 88216ed4409..0276e594dfe 100644
--- a/docs/document/content/reference/management/_index.en.md
+++ b/docs/document/content/reference/management/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.1. </b>"
+pre = "<b>8.1. </b>"
 title = "Management"
 weight = 1
 +++
diff --git a/docs/document/content/reference/scaling/_index.cn.md b/docs/document/content/reference/scaling/_index.cn.md
index 70e3af274af..2c935e56066 100644
--- a/docs/document/content/reference/scaling/_index.cn.md
+++ b/docs/document/content/reference/scaling/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.4. </b>"
+pre = "<b>8.4. </b>"
 title = "弹性伸缩"
 weight = 4
 +++
diff --git a/docs/document/content/reference/scaling/_index.en.md b/docs/document/content/reference/scaling/_index.en.md
index 35e39278f66..b182916c0bd 100644
--- a/docs/document/content/reference/scaling/_index.en.md
+++ b/docs/document/content/reference/scaling/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.4. </b>"
+pre = "<b>8.4. </b>"
 title = "Scaling"
 weight = 4
 +++
diff --git a/docs/document/content/reference/shadow/_index.cn.md b/docs/document/content/reference/shadow/_index.cn.md
index 9acb04ea384..e4a09d9e13a 100644
--- a/docs/document/content/reference/shadow/_index.cn.md
+++ b/docs/document/content/reference/shadow/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.6. </b>"
+pre = "<b>8.6. </b>"
 title = "影子库"
 weight = 6
 +++
diff --git a/docs/document/content/reference/shadow/_index.en.md b/docs/document/content/reference/shadow/_index.en.md
index 51f6028efee..9e2404b197f 100644
--- a/docs/document/content/reference/shadow/_index.en.md
+++ b/docs/document/content/reference/shadow/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.6. </b>"
+pre = "<b>8.6. </b>"
 title = "Shadow"
 weight = 6
 +++
diff --git a/docs/document/content/reference/sharding/_index.cn.md b/docs/document/content/reference/sharding/_index.cn.md
index 182617d04ab..32a1735e701 100644
--- a/docs/document/content/reference/sharding/_index.cn.md
+++ b/docs/document/content/reference/sharding/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.2. </b>"
+pre = "<b>8.2. </b>"
 title = "数据分片"
 weight = 2
 chapter = true
diff --git a/docs/document/content/reference/sharding/_index.en.md b/docs/document/content/reference/sharding/_index.en.md
index 49a2cba0c39..f57fc79ac08 100644
--- a/docs/document/content/reference/sharding/_index.en.md
+++ b/docs/document/content/reference/sharding/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.2. </b>"
+pre = "<b>8.2. </b>"
 title = "Sharding"
 weight = 2
 chapter = true
diff --git a/docs/document/content/reference/test/_index.cn.md b/docs/document/content/reference/test/_index.cn.md
index 6fbac8d1083..0645d77ee8e 100644
--- a/docs/document/content/reference/test/_index.cn.md
+++ b/docs/document/content/reference/test/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.7. </b>"
+pre = "<b>8.7. </b>"
 title = "测试"
 weight = 7
 chapter = true
diff --git a/docs/document/content/reference/test/_index.en.md b/docs/document/content/reference/test/_index.en.md
index abfc20fffc3..618a62e5c55 100644
--- a/docs/document/content/reference/test/_index.en.md
+++ b/docs/document/content/reference/test/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.7. </b>"
+pre = "<b>8.7. </b>"
 title = "Test"
 weight = 7
 chapter = true
diff --git a/docs/document/content/reference/transaction/_index.cn.md b/docs/document/content/reference/transaction/_index.cn.md
index e737c215c07..8417f94f966 100644
--- a/docs/document/content/reference/transaction/_index.cn.md
+++ b/docs/document/content/reference/transaction/_index.cn.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.3. </b>"
+pre = "<b>8.3. </b>"
 title = "分布式事务"
 weight = 3
 chapter = true
diff --git a/docs/document/content/reference/transaction/_index.en.md b/docs/document/content/reference/transaction/_index.en.md
index 5cebc9f2596..03e03ca77a4 100644
--- a/docs/document/content/reference/transaction/_index.en.md
+++ b/docs/document/content/reference/transaction/_index.en.md
@@ -1,5 +1,5 @@
 +++
-pre = "<b>7.3. </b>"
+pre = "<b>8.3. </b>"
 title = "Transaction"
 weight = 3
 chapter = true