You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/02/13 07:56:36 UTC

[incubator-servicecomb-saga] 01/03: SCB-330 added chinese version of README

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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 5eabe8f35f06f6c42ace9b1e4f80a62f9134328e
Author: Eric Lee <da...@huawei.com>
AuthorDate: Fri Feb 9 14:52:43 2018 +0800

    SCB-330 added chinese version of README
---
 README.md         |  4 ++--
 README_ZH.md      | 34 ++++++++++++++++++++++++++++++++++
 docs/design.md    |  1 +
 docs/design_zh.md | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index e8e62a2..f9a81e3 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Saga [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+# Saga | [中文](README_ZH.md) [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICE [...]
 Apache ServiceComb (incubating) Saga is an eventually data consistency solution for micro-service applications. Transactions are commited directly in the try phase and compensated in reverse order in the rollback phase comparing to [TCC](http://design.inf.usi.ch/sites/default/files/biblio/rest-tcc.pdf). 
 
 ## Features
@@ -31,4 +31,4 @@ See [Booking Demo](saga-demo/pack-demo/README.md) for details.
 See [Pull Request Guide](http://servicecomb.incubator.apache.org/developers/submit-codes/) for details.
 
 ## License
-Licensed under an [Apache 2.0](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE) license.
+Licensed under an [Apache 2.0 license](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE).
diff --git a/README_ZH.md b/README_ZH.md
new file mode 100644
index 0000000..a7ac6ac
--- /dev/null
+++ b/README_ZH.md
@@ -0,0 +1,34 @@
+# Saga | [English](README.md) [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LI [...]
+Apache ServiceComb (incubating) Saga 是一个微服务应用的数据最终一致性解决方案。相对于[TCC](http://design.inf.usi.ch/sites/default/files/biblio/rest-tcc.pdf)而言,在try阶段,Saga会直接提交事务,后续rollback阶段则通过反向的补偿操作来完成。
+
+## 特性
+* 高可用。支持集群模式。
+* 高可靠。所有的事务事件都持久存储在数据库中。
+* 高性能。事务事件是通过gRPC来上报的,且事务的请求信息是通过Kyro进行序列化和反序列化的。
+* 低侵入。仅需2-3个注解和编写对应的补偿方法即可进行分布式事务。
+* 部署简单。可通过Docker快速部署。
+* 支持前向恢复(重试)及后向恢复(补偿)。
+
+## 架构
+Saga是由 **alpha** 和 **omega**组成,其中:
+* alpha充当协调者的角色,主要负责对事务进行管理和协调。
+* omega是微服务中内嵌的一个agent,负责对网络请求进行拦截并向alpha上报事务事件。
+
+下图展示了alpha, omega以及微服务三者的关系:
+![Saga Pack 架构](docs/static_files/pack.png)
+
+详情可浏览[Saga Pack 设计文档](docs/design_zh.md). 如果您对Saga的上一代架构感兴趣,可移步至[上一代Saga文档](docs/old_saga.md)了解详情。
+
+## 快速入门
+详情可浏览[出行预订示例](saga-demo/pack-demo/README.md)。
+
+## 联系我们
+* [提交issues](https://issues.apache.org/jira/browse/SCB)
+* [gitter聊天室](https://gitter.im/ServiceCombUsers/Lobby)
+* 邮件列表: [订阅](mailto:dev-subscribe@servicecomb.incubator.apache.org) [浏览](https://lists.apache.org/list.html?dev@servicecomb.apache.org)
+
+## 贡献
+详情可浏览[代码提交指南](http://servicecomb.incubator.apache.org/cn/developers/submit-codes/)。
+
+## License
+[Apache 2.0 license](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE)。
diff --git a/docs/design.md b/docs/design.md
index d976d1a..7329b02 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -1,4 +1,5 @@
 # Saga Pack Design
+[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](design_zh.md)
 ## Overview
 Pack contains two components: *alpha* and *omega*. Alpha is the pack leader and backed by database to make sure transaction events stored permanently while omega is the pack worker and embedded inside services to intercept transaction invocation and report events to alpha.
 
diff --git a/docs/design_zh.md b/docs/design_zh.md
new file mode 100644
index 0000000..072565a
--- /dev/null
+++ b/docs/design_zh.md
@@ -0,0 +1,34 @@
+# Saga Pack 设计文档
+[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](design.md)
+## 概览
+Pack中包含两个组件,即 **alpha** 和 **omega**。
+* alpha充当协调者的角色,主要负责对事务的事件进行持久化存储以及协调子事务的状态,使其得以最终与全局事务的状态保持一致。
+* omega是微服务中内嵌的一个agent,负责对网络请求进行拦截并向alpha上报事务事件,并在异常情况下根据alpha下发的指令执行相应的补偿操作。
+
+![Pack Architecture](static_files/pack.png)
+
+## Omega内部运行机制
+omega是微服务中内嵌的一个agent。当服务收到请求时,omega会将其拦截并从中提取请求信息中的全局事务id作为其自身的全局事务id(即Saga事件id),并提取本地事务id作为其父事务id。在预处理阶段,alpha会记录事务开始的事件;在后处理阶段,alpha会记录事务结束的事件。因此,每个成功的子事务都有一一对应的开始及结束事件。
+
+![Omega Internal](static_files/omega_internal.png)
+
+## 服务间通信流程
+服务间通信的流程与[Zipkin](https://github.com/openzipkin/zipkin)的类似。在服务生产方,omega会拦截请求中事务相关的id来提取事务的上下文。在服务消费方,omega会在请求中注入事务相关的id来传递事务的上下文。通过服务提供方和服务消费方的这种协作处理,子事务能连接起来形成一个完整的全局事务。
+
+![Inter-Service Communication](static_files/inter-service_communication.png)
+
+## 具体处理流程
+### 成功场景
+成功场景下,每个开始的事件都会有对应的结束事件。
+
+![Successful Scenario](static_files/successful_scenario.png)
+
+### 异常场景
+异常场景下,omega会向alpha上报中断事件,然后alpha会向该全局事务的其它已完成的子事务发送补偿指令,确保最终所有的子事务要么都成功,要么都回滚。
+
+![Exception Scenario](static_files/exception_scenario.png)
+
+### 超时场景
+超时场景下,已超时的事件会被alpha的定期扫描器检测出来,与此同时,该超时事务对应的全局事务也会被中断。
+
+![Timeout Scenario](static_files/timeout_scenario.png)

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.