GithubHelp home page GithubHelp logo

hhy5277 / incubator-shardingsphere-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/shardingsphere-example

0.0 1.0 0.0 3.02 MB

Sharding-Sphere examples

License: Apache License 2.0

Java 95.69% Shell 1.96% TSQL 2.35%

incubator-shardingsphere-example's Introduction

ShardingSphere-example

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 of dev 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.

Before start the example if you want use dev branch

Please make sure some dependencies from shardingsphere and shardingsphere-spi-impl have been installed since some examples depend on that. if you are a newbie for shardingsphere, you could prepare the dependencies as following:

1.download and install shardingsphere:

## download the code of shardingsphere
git clone https://github.com/apache/incubator-shardingsphere.git

## checkout a specific version, example is 4.0.0-RC1
cd incubator-shardingsphere && git checkout 4.0.0-RC1

## install the dependencies
mvn clean install -Prelease

2.download and install shardingsphere-spi-impl:

## download the code of shardingsphere-spi-impl
git clone https://github.com/OpenSharding/shardingsphere-spi-impl.git

## checkout a specific version, example is 4.0.0-RC1
cd shardingsphere-spi-impl && git checkout 4.0.0-RC1

## install the dependencies
mvn clean install

shardingsphere-example module design

project structure

shardingsphere-example
  ├── example-core
  │   ├── config-utility
  │   ├── example-api
  │   ├── example-raw-jdbc
  │   ├── example-spring-jpa
  │   └── example-spring-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-seata-example
  │   ├── other-feature-example
  │   │   ├── hint-example
  │   │   └── encrypt-example
  ├── sharding-proxy-example
  │   └── sharding-proxy-boot-mybatis-example
  └── src/resources
        └── manual_schema.sql

Best practice for sharding data

  • sharding databases
  • sharding tables
  • sharding databases and tables
  • master-slave
  • sharding & master-slave

You can get more detail from sharding-example

Best practice for sharding + orchestration

  • using local configuration file for zookeeper/etcd & sharding
  • using register center(zookeeper/etcd)'s configuration for sharding

You can get more detail from orchestration-example

Best Practice for sharding + distribution-transaction

  • 2pc-xa transaction
  • base-seata transaction

You can get more detail from transaction-example

Best Practice for hint routing

You can get more detail from hint-example

Best Practice for data encrypt

You can get more detail from encrypt-example

Best Practice for APM

We will add APM example recently.

Best Practice for sharding-proxy.

We prefer to add a docker base example recently.

how to use docker to config sharding-jdbc & sharding-proxy (Optional)

incubator-shardingsphere-example's People

Contributors

betterjava avatar cherrylzhao avatar gonwan avatar haocao avatar harvies avatar huangjian888 avatar it-noob avatar komachision avatar maxiaoguang64 avatar taojintianxia avatar terrymanu avatar tristazero avatar tuohai666 avatar zkzong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.