Skip to content

Commit

Permalink
update the example module docs (apache#22738)
Browse files Browse the repository at this point in the history
  • Loading branch information
totalo authored Dec 8, 2022
1 parent 84b8d57 commit 89c5a6f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 127 deletions.
73 changes: 10 additions & 63 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Example for 2.x or 3.x or 4.x please see tags in `https://github.com/apache/shar

**Notices**

- *The `shardingsphere-sample` module is a brand new sample experience module. It is in the process of development and improvement. At present, the correctness and stability of the sample cannot be guaranteed. Please ignore it for now.*
- *The `shardingsphere-sample` module is a brand new sample experience module. *

- *Please execute [initial script](https://github.com/apache/shardingsphere/blob/master/examples/src/resources/manual_schema.sql) before you first run the example if using manual mode.*

Expand All @@ -17,7 +17,7 @@ Example for 2.x or 3.x or 4.x please see tags in `https://github.com/apache/shar
Please make sure some dependencies from [Apache ShardingSphere](https://github.com/apache/shardingsphere) has been installed since examples depend on that.
if you are a newbie for Apache ShardingSphere, you could prepare the dependencies as following:

1. download and install [Apache ShardingSphere](https://github.com/apache/shardingsphere):
1. download and install [Apache ShardingSphere](https://github.com/apache/shardingsphere):

```bash
## download source code
Expand All @@ -42,74 +42,21 @@ shardingsphere-example
│   └── example-spring-mybatis
├── other-example
│   └── shardingsphere-parser-example
├── shardingsphere-jdbc-example
│   ├── mixed-feature-example
│   │   └── sharding-readwrite-splitting-example
│   │   │   ├── sharding-readwrite-splitting-raw-jdbc-example
│   │   │   ├── sharding-readwrite-splitting-spring-boot-jpa-example
│   │   │   ├── sharding-readwrite-splitting-spring-boot-mybatis-example
│   │   │   ├── sharding-readwrite-splitting-spring-namespace-jpa-example
│   │   │   └── sharding-readwrite-splitting-spring-namespace-mybatis-example
│   └── single-feature-example
│   │   ├── cluster-mode-example
│   │   │   ├── cluster-mode-raw-jdbc-example
│   │   │   ├── cluster-mode-spring-boot-mybatis-example
│   │   │   └── cluster-mode-spring-namespace-mybatis-example
│   │   ├── encrypt-example
│   │   │   ├── encrypt-raw-jdbc-example
│   │   │   ├── encrypt-spring-boot-mybatis-example
│   │   │   └── encrypt-spring-namespace-mybatis-example
│   │   ├── extension-example
│   │   │   └── custom-sharding-algortihm-example
│   │   │   │   ├── class-based-sharding-algorithm-example
│   │   │   │   └── spi-based-sharding-algorithm-example
│   │   ├── readwrite-splitting-example
│   │   │   ├── readwrite-splitting-raw-jdbc-example
│   │   │   ├── readwrite-splitting-spring-boot-jpa-example
│   │   │   ├── readwrite-splitting-spring-boot-mybatis-example
│   │   │   ├── readwrite-splitting-spring-namespace-jpa-example
│   │   │   └── readwrite-splitting-spring-namespace-mybatis-example
│   │   ├── shadow-example
│   │   │   ├── shadow-raw-jdbc-example
│   │   │   ├── shadow-spring-boot-mybatis-example
│   │   │   └── shadow-spring-namespace-mybatis-example
│   │   ├── sharding-example
│   │   │   ├── sharding-raw-jdbc-example
│   │   │   ├── sharding-spring-boot-jpa-example
│   │   │   ├── sharding-spring-boot-mybatis-example
│   │   │   ├── sharding-spring-namespace-jpa-example
│   │   │   └── sharding-spring-namespace-mybatis-example
│   │   └── transaction-example
│   │   │   ├── transaction-2pc-xa-atomikos-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-bitronix-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-narayana-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-spring-boot-example
│   │   │   ├── transaction-2pc-xa-spring-namespace-example
│   │   │   ├── transaction-base-seata-raw-jdbc-example
│   │   │   └── transaction-base-seata-spring-boot-example
├── shardingsphere-example-generator
├── shardingsphere-proxy-example
│   ├── shardingsphere-proxy-boot-mybatis-example
│   ├── shardingsphere-proxy-distsql-example
│   └── shardingsphere-proxy-hint-example
├── shardingsphere-sample
│   ├── shardingsphere-example-generator
└── src/resources
  └── manual_schema.sql
```

## Available Examples

| Example | Description                |
|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| [sharding](shardingsphere-jdbc-example/single-feature-example/sharding-example) | show how to use table sharding\database sharding with ShardingSphere-JDBC |
| [readwrite-splitting](shardingsphere-jdbc-example/mixed-feature-example/sharding-readwrite-splitting-example) | show how to use ShardingSphere-JDBC readwrite-splitting |
| [springboot jpa](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-jpa-example) | show how to use SpringBoot JPA with ShardingSphere-JDBC |
| [springboot mybatis](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-mybatis-example) | show how to use SpringBoot Mybatis with ShardingSphere-JDBC |
| [governance](shardingsphere-jdbc-example/single-feature-example/cluster-mode-example) | show how to use ShardingSphere-JDBC governance |
| [transaction](shardingsphere-jdbc-example/single-feature-example/transaction-example) | show how to use ShardingSphere-JDBC transaction |
| [hint](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example) | show how to use ShardingSphere-JDBC hint |
| [encryption](shardingsphere-jdbc-example/single-feature-example/encrypt-example) | show how to use ShardingSphere-JDBC encryption |
| [DistSQL](shardingsphere-proxy-example/shardingsphere-proxy-distsql-example) | show how to use DistSQL in ShardingSphere-Proxy |
| APM(Pending) | show how to use APM in ShardingSphere |
| proxy(Pending) | show how to use ShardingSphere-Proxy |
| [docker](./docker/docker-compose.md) | show how to use docker to setup the environment for ShardingSphere |
| Example | Description |
|------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| [ShardingSphere-JDBC Examples](shardingsphere-example-generator/README.md) | Generate the examples by configuration and show how to use ShardingSphere-JDBC |
| [DistSQL](shardingsphere-proxy-example/shardingsphere-proxy-distsql-example) | show how to use DistSQL in ShardingSphere-Proxy |
| APM(Pending) | show how to use APM in ShardingSphere |
| proxy(Pending) | show how to use ShardingSphere-Proxy |
| [docker](./docker/docker-compose.md) | show how to use docker to setup the environment for ShardingSphere |
76 changes: 12 additions & 64 deletions examples/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

**注意事项**

- *`shardingsphere-sample`模块是一个全新的示例体验模块,正在开发完善过程中,目前示例正确性以及稳定性不能够保证,请先忽略*
- *`shardingsphere-example-generator`模块是一个全新的示例体验模块*

- *如果采用手动模式,请在首次运行示例之前执行[初始化脚本](https://github.com/apache/shardingsphere/blob/master/examples/src/resources/manual_schema.sql)*
-
*如果采用手动模式,请在首次运行示例之前执行[初始化脚本](https://github.com/apache/shardingsphere/blob/master/examples/src/resources/manual_schema.sql)*

- *请确保 MySQL 上的主从数据同步正确运行。否则,读写分离示例查询从库数据为空。*

Expand All @@ -17,7 +18,7 @@
请在开始该示例之前,请确保已安装了来自 [Apache ShardingSphere](https://github.com/apache/shardingsphere) 的全部依赖项。
如果您是 ShardingSphere 的新手,您可以准备如下依赖:

1. 下载并安装 [Apache ShardingSphere](https://github.com/apache/shardingsphere):
1. 下载并安装 [Apache ShardingSphere](https://github.com/apache/shardingsphere):

```bash
## 下载源码
Expand All @@ -42,74 +43,21 @@ shardingsphere-example
│   └── example-spring-mybatis
├── other-example
│   └── shardingsphere-parser-example
├── shardingsphere-jdbc-example
│   ├── mixed-feature-example
│   │   └── sharding-readwrite-splitting-example
│   │   │   ├── sharding-readwrite-splitting-raw-jdbc-example
│   │   │   ├── sharding-readwrite-splitting-spring-boot-jpa-example
│   │   │   ├── sharding-readwrite-splitting-spring-boot-mybatis-example
│   │   │   ├── sharding-readwrite-splitting-spring-namespace-jpa-example
│   │   │   └── sharding-readwrite-splitting-spring-namespace-mybatis-example
│   └── single-feature-example
│   │   ├── cluster-mode-example
│   │   │   ├── cluster-mode-raw-jdbc-example
│   │   │   ├── cluster-mode-spring-boot-mybatis-example
│   │   │   └── cluster-mode-spring-namespace-mybatis-example
│   │   ├── encrypt-example
│   │   │   ├── encrypt-raw-jdbc-example
│   │   │   ├── encrypt-spring-boot-mybatis-example
│   │   │   └── encrypt-spring-namespace-mybatis-example
│   │   ├── extension-example
│   │   │   └── custom-sharding-algortihm-example
│   │   │   │   ├── class-based-sharding-algorithm-example
│   │   │   │   └── spi-based-sharding-algorithm-example
│   │   ├── readwrite-splitting-example
│   │   │   ├── readwrite-splitting-raw-jdbc-example
│   │   │   ├── readwrite-splitting-spring-boot-jpa-example
│   │   │   ├── readwrite-splitting-spring-boot-mybatis-example
│   │   │   ├── readwrite-splitting-spring-namespace-jpa-example
│   │   │   └── readwrite-splitting-spring-namespace-mybatis-example
│   │   ├── shadow-example
│   │   │   ├── shadow-raw-jdbc-example
│   │   │   ├── shadow-spring-boot-mybatis-example
│   │   │   └── shadow-spring-namespace-mybatis-example
│   │   ├── sharding-example
│   │   │   ├── sharding-raw-jdbc-example
│   │   │   ├── sharding-spring-boot-jpa-example
│   │   │   ├── sharding-spring-boot-mybatis-example
│   │   │   ├── sharding-spring-namespace-jpa-example
│   │   │   └── sharding-spring-namespace-mybatis-example
│   │   └── transaction-example
│   │   │   ├── transaction-2pc-xa-atomikos-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-bitronix-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-narayana-raw-jdbc-example
│   │   │   ├── transaction-2pc-xa-spring-boot-example
│   │   │   ├── transaction-2pc-xa-spring-namespace-example
│   │   │   ├── transaction-base-seata-raw-jdbc-example
│   │   │   └── transaction-base-seata-spring-boot-example
├── shardingsphere-example-generator
├── shardingsphere-proxy-example
│   ├── shardingsphere-proxy-boot-mybatis-example
│   ├── shardingsphere-proxy-distsql-example
│   └── shardingsphere-proxy-hint-example
├── shardingsphere-sample
│   ├── shardingsphere-example-generator
└── src/resources
  └── manual_schema.sql
```

## 用例列表

| 例子 | 描述 |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [分片](shardingsphere-jdbc-example/single-feature-example/sharding-example) | 演示通过 ShardingSphere-JDBC 进行分库、分表等 |
| [读写分离](shardingsphere-jdbc-example/mixed-feature-example/sharding-readwrite-splitting-example) | 演示在 ShardingSphere-JDBC 中使用读写分离 |
| [springboot jpa](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-jpa-example) | 演示通过 SpringBoot JPA 对接 ShardingSphere-JDBC |
| [springboot mybatis](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-mybatis-example) | 演示通过 SpringBoot Mybatis 对接 ShardingSphere-JDBC |
| [治理](shardingsphere-jdbc-example/single-feature-example/cluster-mode-example) | 演示在 ShardingSphere-JDBC 中使用治理 |
| [事务](shardingsphere-jdbc-example/single-feature-example/transaction-example) | 演示在 ShardingSphere-JDBC 中使用事务 |
| [hint](shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example) | 演示在 ShardingSphere-JDBC 中使用 hint |
| [加密](shardingsphere-jdbc-example/single-feature-example/encrypt-example) | 演示在 ShardingSphere-JDBC 中使用加密 |
| [DistSQL](shardingsphere-proxy-example/shardingsphere-proxy-distsql-example) | 演示在 ShardingSphere-Proxy 中使用 DistSQL |
| APM 监控(Pending) | 演示在 ShardingSphere 中使用 APM 监控 |
| proxy(Pending) | 演示使用 ShardingSphere-Proxy |
| [docker](./docker/docker-compose.md) | 演示通过 docker 创建 ShardingSphere 所依赖的环境 |
| 例子 | 描述 |
|------------------------------------------------------------------------------|--------------------------------------|
| [ShardingSphere-JDBC示例](shardingsphere-example-generator/README_ZH.md) | 通过配置生成ShardingSphere-JDBC的演示示例 |
| [DistSQL](shardingsphere-proxy-example/shardingsphere-proxy-distsql-example) | 演示在 ShardingSphere-Proxy 中使用 DistSQL |
| APM 监控(Pending) | 演示在 ShardingSphere 中使用 APM 监控 |
| proxy(Pending) | 演示使用 ShardingSphere-Proxy |
| [docker](./docker/docker-compose.md) | 演示通过 docker 创建 ShardingSphere 所依赖的环境 |

0 comments on commit 89c5a6f

Please sign in to comment.