Example for 1.x please see tags in https://github.com/apache/incubator-shardingsphere/tree/${tag}/sharding-jdbc-example
Example for 2.x or 3.x or 4.x please see tags in https://github.com/apache/incubator-shardingsphere-example/tree/${tag}
Need attention
- Please do not use
dev
branch to run your example, example ofdev
branch is not released yet. - The manual schema initial script is in
https://github.com/apache/incubator-shardingsphere-example/blob/dev/src/resources/manual_schema.sql
, please execute it before you first run the example. - Please make sure master-slave data sync on MySQL is running correctly. Otherwise this example will query empty data from slave.
sharding-sphere-example
├── example-common
│ ├── config-utility
│ ├── repository-api
│ ├── repository-jdbc
│ ├── repository-jpa
│ └── repository-mybatis
├── sharding-jdbc-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
│ ├── orchestration-example
│ │ ├── orchestration-raw-jdbc-example
│ │ ├── orchestration-spring-boot-example
│ │ └── orchestration-spring-namespace-example
│ ├── transaction-example
│ │ ├── transaction-2pc-xa-example
│ │ ├── transaction-base-saga-example
│ │ └──transaction-base-seata-example
│ ├── other-feature-example
│ │ ├── hint-example
│ │ ├── broadcast-example
│ │ └── encrypt-example
├── sharding-proxy-example
│ └── sharding-proxy-boot-mybatis-example
└── src/resources
└── manual_schema.sql
- sharding databases
- sharding tables
- sharding databases and tables
- master-slave
- sharding & master-slave
you can get more detail from sharding-example
-
local zookeeper/etcd & sharding
local sharding configuration can override the configuration of zookeeper/etcd.
-
cloud zookeeper/etcd & sharding
shardingsphere will load the sharding configuration form zookeeper/etcd directly.
you can get more detail from orchestration-example
- 2pc-xa transaction
- base-saga transaction
you can get more detail from transaction-example
you can get more detail from hint-example
you can get more detail from broadcast-table-example
you can get more detail from encrypt-example
we will add APM example recently.
we prefer to add a docker base example recently.