You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
8.0 KiB
Markdown

## 参考文档进行配置学习
## 1. 具体概述
Example for 2.x or 3.x or 4.x please see tags in `https://github.com/apache/shardingsphere-example/tree/${tag}`
[Apache ShardingSphere](https://github.com/apache/shardingsphere):
## download source code
git clone https://github.com/apache/shardingsphere.git
## compile source code
cd shardingsphere
mvn clean install -Prelease
## 2. 项目结构
shardingsphere-example
├── example-core 示例核心,主要是讲如何整合
│   ├── config-utility 配置工具
│   ├── example-api
│   ├── example-raw-jdbc
│   ├── example-spring-jpa
│   └── 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-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
## 3. 可用示例
| 示例 | 描述 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [sharding](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example) | 展示如何在 ShardingSphere-JDBC 中使用 table sharding\database sharding |
| [readwrite-splitting](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/mixed-feature-example/sharding-readwrite-splitting-example) | 展示如何使用 ShardingSphere-JDBC readwrite-splitting |
| [springboot jpa](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-jpa-example) | 展示如何将 SpringBoot JPA 与 ShardingSphere-JDBC 结合使用 |
| [springboot mybatis](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-spring-boot-mybatis-example) | 展示如何使用 SpringBoot Mybatis 与 ShardingSphere-JDBC |
| [governance](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/cluster-mode-example) | 展示如何使用 ShardingSphere-JDBC 治理 |
| [transaction](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/transaction-example) | 展示如何使用 ShardingSphere-JDBC 事务 |
| [hint](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example) | 展示如何使用 ShardingSphere-JDBC 提示 |
| [encryption](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-jdbc-example/single-feature-example/encrypt-example) | 展示如何使用 ShardingSphere-JDBC 加密 |
| [DistSQL](https://github.com/apache/shardingsphere/blob/master/examples/shardingsphere-proxy-example/shardingsphere-proxy-distsql-example) | 展示如何在 ShardingSphere-Proxy 中使用 DistSQL |
| APM(Pending) | 展示如何在 ShardingSphere 中使用 APM |
| proxy(Pending) | 展示如何使用 ShardingSphere-Proxy |
| [docker](https://github.com/apache/shardingsphere/blob/master/examples/docker/docker-compose.md) | 展示如何使用 docker 设置 ShardingSphere 的环境 |