This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 80182d11808 Add DistSQL documents in features. (#18805)
80182d11808 is described below
commit 80182d118080054ac6463a534cb4a13913178c11
Author: Raigor <[email protected]>
AuthorDate: Sun Jul 3 15:35:54 2022 +0800
Add DistSQL documents in features. (#18805)
---
.../document/content/features/distsql/_index.cn.md | 62 +++++++++++++++++++++
.../document/content/features/distsql/_index.en.md | 61 ++++++++++++++++++++
docs/document/static/img/distsql/after.png | Bin 0 -> 110713 bytes
docs/document/static/img/distsql/before.png | Bin 0 -> 138692 bytes
docs/document/static/img/distsql/overview.png | Bin 0 -> 138120 bytes
5 files changed, 123 insertions(+)
diff --git a/docs/document/content/features/distsql/_index.cn.md
b/docs/document/content/features/distsql/_index.cn.md
new file mode 100644
index 00000000000..1b9cdb34d30
--- /dev/null
+++ b/docs/document/content/features/distsql/_index.cn.md
@@ -0,0 +1,62 @@
++++
+pre = "<b>4.12. </b>"
+title = "DistSQL"
+weight = 12
++++
+
+## 定义
+DistSQL(Distributed SQL)是 Apache ShardingSphere 特有的操作语言。 它与标准 SQL
的使用方式完全一致,用于提供增量功能的 SQL 级别操作能力。
+
+灵活的规则配置和资源管控能力是 Apache ShardingSphere 的特点之一。
+
+在使用 4.x
及其之前版本时,开发者虽然可以像使用原生数据库一样操作数据,但却需要通过本地文件或注册中心配置资源和规则。然而,操作习惯变更,对于运维工程师并不友好。
+
+从 5.x 版本开始,DistSQL(Distributed SQL)让用户可以像操作数据库一样操作 Apache
ShardingSphere,使其从面向开发人员的框架和中间件转变为面向运维人员的数据库产品。
+
+## 相关概念
+DistSQL 细分为 RDL、RQL 和 RAL 三种类型。
+
+### RDL
+Resource & Rule Definition Language,负责资源和规则的创建、修改和删除。
+
+### RQL
+Resource & Rule Query Language,负责资源和规则的查询和展现。
+
+### RAL
+Resource & Rule Administration Language,负责 Hint、事务类型切换、分片执行计划查询等管理功能。
+
+## 对系统的影响
+
+### 之前
+在拥有 DistSQL 以前,用户一边使用 SQL 语句操作数据,一边使用 YAML 文件来管理 ShardingSphere 的配置,如下图:
+
+
+
+这时用户不得不面对以下几个问题:
+- 需要通过不同类型的客户端来操作数据和管理 ShardingSphere 规则;
+- 多个逻辑库需要多个 YAML 文件;
+- 修改 YAML 需要文件的编辑权限;
+- 修改 YAML 后需要重启 ShardingSphere。
+
+### 之后
+随着 DistSQL 的出现,对 ShardingSphere 的操作方式也得到了改变:
+
+
+
+现在,用户的使用体验得到了巨大改善:
+- 使用相同的客户端来管理数据和 ShardingSphere 配置;
+- 不再额外创建 YAML 文件,通过 DistSQL 管理逻辑库;
+- 不再需要文件的编辑权限,通过 DistSQL 来管理配置;
+- 配置的变更实时生效,无需重启 ShardingSphere。
+
+## 使用限制
+DistSQL 只能用于 ShardingSphere-Proxy,ShardingSphere-JDBC 暂不提供。
+
+## 原理介绍
+与标准 SQL 一样,DistSQL 由 ShardingSphere 的解析引擎进行识别,将输入语句转换为抽象语法树,进而生成各个语法对应的
`Statement`,最后由合适的 `Handler` 进行业务处理。
+整体流程如下图所示:
+
+
+
+## 相关参考
+[用户手册:DistSQL](/cn/user-manual/shardingsphere-proxy/distsql/)
diff --git a/docs/document/content/features/distsql/_index.en.md
b/docs/document/content/features/distsql/_index.en.md
new file mode 100644
index 00000000000..14d9645bbb1
--- /dev/null
+++ b/docs/document/content/features/distsql/_index.en.md
@@ -0,0 +1,61 @@
++++
+pre = "<b>4.12. </b>"
+title = "DistSQL"
+weight = 12
++++
+
+## Definition
+DistSQL (Distributed SQL) is Apache ShardingSphere's specific SQL, providing
additional operation capabilities compared to standard SQL.
+
+Flexible rule configuration and resource management & control capabilities are
one of the characteristics of Apache ShardingSphere.
+
+When using 4.x and earlier versions, developers can operate data just like
using a database, but they need to configure resources and rules through YAML
file (or registry center). However, the YAML file format and the changes
brought by using the registry center made it unfriendly to DBAs.
+
+Starting from version 5.x, DistSQL enables users to operate Apache
ShardingSphere just like a database, transforming it from a framework and
middleware for developers to a database product for DBAs.
+
+## Related Concepts
+DistSQL is divided into RDL, RQL, and RAL.
+
+### RDL
+Resource & Rule Definition Language, is responsible for the definition of
resources and rules.
+
+### RQL
+Resource & Rule Query Language, is responsible for the query of resources and
rules.
+
+### RAL
+Resource & Rule Administration Language, is responsible for the added-on
administrator features of hint, transaction type switch, sharding execute
planning, etc.
+
+## Impact on the System
+
+### Before
+Before having DistSQL, users used SQL to operate data while using YAML
configuration files to manage ShardingSphere, as shown below:
+
+
+
+At that time, users faced the following problems:
+- Different types of clients are required to operate data and manage
ShardingSphere configuration.
+- Multiple logical databases require multiple YAML files.
+- Editing a YAML file requires writing permissions.
+- Need to restart ShardingSphere after editing YAML.
+
+### After
+With the advent of DistSQL, the operation of ShardingSphere has also changed:
+
+
+
+Now, the user experience has been greatly improved:
+- Uses the same client to operate data and ShardingSphere configuration.
+- No need for additional YAML files, and the logical databases are managed
through DistSQL.
+- Editing permissions for files are no longer required, and configuration is
managed through DistSQL.
+- Configuration changes take effect in real-time without restarting
ShardingSphere.
+
+## Limitations
+DistSQL can be used only with ShardingSphere-Proxy, not with
ShardingSphere-JDBC for now.
+
+## How it works
+Like standard SQL, DistSQL is recognized by the parsing engine of
ShardingSphere. It converts the input statement into an abstract syntax tree
and then generates the `Statement` corresponding to each grammar, which is
processed by the appropriate `Handler`.
+
+
+
+## Related References
+[User Manual: DistSQL](/en/user-manual/shardingsphere-proxy/distsql/)
diff --git a/docs/document/static/img/distsql/after.png
b/docs/document/static/img/distsql/after.png
new file mode 100644
index 00000000000..672fb0210a9
Binary files /dev/null and b/docs/document/static/img/distsql/after.png differ
diff --git a/docs/document/static/img/distsql/before.png
b/docs/document/static/img/distsql/before.png
new file mode 100644
index 00000000000..1a9148eb14b
Binary files /dev/null and b/docs/document/static/img/distsql/before.png differ
diff --git a/docs/document/static/img/distsql/overview.png
b/docs/document/static/img/distsql/overview.png
new file mode 100644
index 00000000000..abc07060b70
Binary files /dev/null and b/docs/document/static/img/distsql/overview.png
differ