README.md 8.7 KB
Newer Older
T
terrymanu 已提交
1
# [ShardingSphere - Distributed Database Middleware Ecosphere](https://shardingsphere.apache.org/)
T
terrymanu 已提交
2

T
terrymanu 已提交
3
**Official website: https://shardingsphere.apache.org/**
T
terrymanu 已提交
4

T
terrymanu 已提交
5
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
T
terrymanu 已提交
6
[![Gitter](https://badges.gitter.im/shardingsphere/shardingsphere.svg)](https://gitter.im/shardingsphere/Lobby)
7
[![GitHub release](https://img.shields.io/github/release/apache/incubator-shardingsphere.svg)](https://github.com/apache/incubator-shardingsphere/releases)
wu-sheng's avatar
wu-sheng 已提交
8
[![Stargazers over time](https://starchart.cc/apache/incubator-shardingsphere.svg)](https://starchart.cc/apache/incubator-shardingsphere)
T
terrymanu 已提交
9

10
[![Total Lines](https://tokei.rs/b1/github/apache/incubator-shardingsphere?category=lines)](https://github.com/apache/incubator-shardingsphere)
N
nancyzrh 已提交
11
[![Build Status](https://builds.apache.org/job/shardingsphere-ci-dev/badge/icon)](https://builds.apache.org/job/shardingsphere-ci-dev/)
12
[![Coverage Status](https://coveralls.io/repos/github/apache/incubator-shardingsphere/badge.svg?branch=dev)](https://coveralls.io/github/apache/incubator-shardingsphere?branch=dev)
T
terrymanu 已提交
13
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/278600ed40ad48e988ab485b439abbcd)](https://www.codacy.com/app/terrymanu/sharding-sphere?utm_source=github.com&utm_medium=referral&utm_content=sharding-sphere/sharding-sphere&utm_campaign=Badge_Grade)
14
[![snyk](https://snyk.io/test/github/apache/incubator-shardingsphere/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/apache/incubator-shardingsphere?targetFile=pom.xml)
T
terrymanu 已提交
15
[![OpenTracing-1.0 Badge](https://img.shields.io/badge/OpenTracing--1.0-enabled-blue.svg)](http://opentracing.io)
kzd666's avatar
kzd666 已提交
16
[![Skywalking Tracing](https://img.shields.io/badge/Skywalking%20Tracing-enable-brightgreen.svg)](https://github.com/apache/skywalking)
T
terrymanu 已提交
17

T
terrymanu 已提交
18
## Document
T
terrymanu 已提交
19

P
panjuan 已提交
20 21
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](https://shardingsphere.apache.org/document/current/en/overview/)
[![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](https://shardingsphere.apache.org/document/current/cn/overview/)
T
terrymanu 已提交
22

T
terrymanu 已提交
23
## Overview
T
terrymanu 已提交
24

T
terrymanu 已提交
25
ShardingSphere is an open-source ecosystem consisted of a set of distributed database middleware solutions, including 2 independent products, Sharding-JDBC & Sharding-Proxy & Sharding-Sidecar (todo). 
T
terrymanu 已提交
26
They all provide functions of data sharding, distributed transaction and database orchestration, applicable in a variety of situations such as Java isomorphism, heterogeneous language and cloud native. 
T
terrymanu 已提交
27

28
Aiming at reasonably making full use of the computation and storage capacity of the database in a distributed system, ShardingSphere defines itself as a middleware, rather than a totally new type of database. 
T
terrymanu 已提交
29
As the cornerstone of many enterprises, relational database still takes a huge market share. 
30
Therefore, at the current stage, we prefer to focus on its increment instead of a total overturn.
T
terrymanu 已提交
31

32
__Apache releases are beginning from version 4.0.0__
T
terrymanu 已提交
33

34
![ShardingSphere Scope](https://shardingsphere.apache.org//document/current/img/shardingsphere-scope_en.png)
T
terrymanu 已提交
35

T
terrymanu 已提交
36
### Sharding-JDBC
T
terrymanu 已提交
37

38
[![Maven Status](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere/sharding-jdbc/badge.svg)](https://mvnrepository.com/artifact/org.apache.shardingsphere/sharding-jdbc)
T
terrymanu 已提交
39

T
terrymanu 已提交
40
Sharding-JDBC defines itself as a lightweight Java framework that provides extra service at Java JDBC layer. 
41
With the client end connecting directly to the database, it provides service in the form of jar and requires no extra deployment and dependence. 
T
terrymanu 已提交
42
It can be considered as an enhanced JDBC driver, which is fully compatible with JDBC and all kinds of ORM frameworks.
T
terrymanu 已提交
43

L
Liang Zhang 已提交
44 45 46
* Applicable in any ORM framework based on JDBC, such as JPA, Hibernate, Mybatis, Spring JDBC Template or direct use of JDBC.
* Support any third-party database connection pool, such as DBCP, C3P0, BoneCP, Druid, HikariCP.
* Support any kind of JDBC standard database: MySQL, Oracle, SQLServer, PostgreSQL and any SQL92 followed databases.
T
terrymanu 已提交
47

48
![Sharding-JDBC Architecture](https://shardingsphere.apache.org//document/current/img/sharding-jdbc-brief.png)
T
terrymanu 已提交
49 50

### Sharding-Proxy
T
terrymanu 已提交
51

52
[![Download](https://img.shields.io/badge/release-download-orange.svg)](https://www.apache.org/dyn/closer.cgi?path=incubator/shardingsphere/4.0.0-RC2/apache-shardingsphere-incubating-4.0.0-RC2-sharding-proxy-bin.tar.gz)
C
Chris Cao 已提交
53
[![Docker Pulls](https://img.shields.io/docker/pulls/shardingsphere/sharding-proxy.svg)](https://store.docker.com/community/images/shardingsphere/sharding-proxy)
T
terrymanu 已提交
54

T
terrymanu 已提交
55
Sharding-Proxy defines itself as a transparent database proxy, providing a database server that encapsulates database binary protocol to support heterogeneous languages. 
T
terrymanu 已提交
56
Friendlier to DBA, the MySQL/PostgreSQL version provided now can use any kind of client access (such as MySQL Command Client, MySQL Workbench, Navicat etc.) that is compatible of MySQL/PostgreSQL protocol to operate data.
T
terrymanu 已提交
57

T
terrymanu 已提交
58
* Totally transparent to applications, it can be used directly as MySQL and PostgreSQL.
59
* Applicable to any kind of compatible client end that is compatible with MySQL and PostgreSQL protocol.
T
terrymanu 已提交
60

61
![Sharding-Proxy Architecture](https://shardingsphere.apache.org//document/current/img/sharding-proxy-brief_v2.png)
T
terrymanu 已提交
62

T
terrymanu 已提交
63
### Sharding-Sidecar(TODO)
T
terrymanu 已提交
64

65 66
Sharding-Sidecar (TODO) defines itself as a cloud native database agent of the Kubernetes environment, in charge of all the access to the database in the form of sidecar. 
It provides a mesh layer interacting with the database, we call this as `Database Mesh`.
T
terrymanu 已提交
67

T
terrymanu 已提交
68
Database Mesh emphasizes on how to connect distributed database access application with the database. 
69
Focusing on interaction, it effectively organizes the interaction between messy applications and the database. 
T
terrymanu 已提交
70
The application and database that use Database Mesh to visit database will form a large grid system, where they just need to be put into the right position accordingly. 
71
They are all governed by the mesh layer.
T
terrymanu 已提交
72

73
![Sharding-Sidecar Architecture](https://shardingsphere.apache.org//document/current/img/sharding-sidecar-brief_v2.png)
T
terrymanu 已提交
74

T
terrymanu 已提交
75 76
|                         | *Sharding-JDBC* | *Sharding-Proxy*     | *Sharding-Sidecar* |
| ----------------------- | --------------- | -------------------- | ------------------ |
T
terrymanu 已提交
77
| Database                | Any             | MySQL/PostgreSQL     | MySQL/PostgreSQL   |
T
terrymanu 已提交
78 79
| Connections Count Cost  | High            | Low                  | High               |
| Supported Languages     | Java Only       | Any                  | Any                |
T
terrymanu 已提交
80 81 82 83
| Performance             | Low loss        | Relatively High loss | Low loss           |
| Decentralization        | Yes             | No                   | No                 |
| Static Entry            | No              | Yes                  | No                 |

T
terrymanu 已提交
84 85 86
### Hybrid Architecture

Sharding-JDBC adopts decentralized architecture, applicable to high-performance light-weight OLTP application developed with Java; 
T
terrymanu 已提交
87
Sharding-Proxy provides static entry and all languages support, applicable for OLAP application and the sharding databases management and operation situation.
T
terrymanu 已提交
88 89

ShardingSphere is an ecosphere consists of multiple endpoints together.
90
Through a mixed use of Sharding-JDBC and Sharding-Proxy and unified sharding strategy by the same registry center, ShardingSphere can build an application system applicable to all kinds of scenarios. 
T
terrymanu 已提交
91 92
Architects can adjust the system architecture to the most applicable one to current business more freely.

93
![ShardingSphere Hybrid Architecture](https://shardingsphere.apache.org//document/current/img/shardingsphere-hybrid.png)
T
terrymanu 已提交
94

T
terrymanu 已提交
95
## Features
T
terrymanu 已提交
96

T
terrymanu 已提交
97
### Data Sharding
T
terrymanu 已提交
98

T
terrymanu 已提交
99
* Database sharding & Table sharding
T
terrymanu 已提交
100
* Read-write splitting
T
terrymanu 已提交
101 102
* Sharding strategy customization
* Centre-less Distributed primary key
T
terrymanu 已提交
103

T
terrymanu 已提交
104
### Distributed Transaction
T
terrymanu 已提交
105

T
terrymanu 已提交
106
* Unified Transaction API
T
terrymanu 已提交
107 108
* XA transaction
* BASE transaction
T
terrymanu 已提交
109

T
terrymanu 已提交
110
### Database Orchestration
T
terrymanu 已提交
111

T
terrymanu 已提交
112 113 114 115
* Dynamic Configuration
* Orchestration & Governance
* Data Encryption
* Tracing & Observability
Z
zdrjson 已提交
116
* Elastic scaling out (Planning)
T
terrymanu 已提交
117

T
terrymanu 已提交
118
## Project Status
T
terrymanu 已提交
119

T
terrymanu 已提交
120
![Status](https://shardingsphere.apache.org/document/current/img/shardingsphere-status_en.png)
T
terrymanu 已提交
121

122
## How to Build
T
terrymanu 已提交
123

124 125
```bash
./mvnw clean install -Prelease
126
``` 
T
tuohai666 已提交
127

T
tuohai666 已提交
128
Artifact:
T
tuohai666 已提交
129

T
tuohai666 已提交
130
```
T
tuohai666 已提交
131 132
sharding-distribution/sharding-jdbc-distribution/target/apache-shardingsphere-incubating-${latest.release.version}-sharding-jdbc-bin.tar.gz: Binary package of Sharding-JDBC
sharding-distribution/sharding-proxy-distribution/target/apache-shardingsphere-incubating-${latest.release.version}-sharding-proxy-bin.tar.gz: Binary package of Sharding-Proxy
133
sharding-distribution/sharding-ui-distribution/target/apache-shardingsphere-incubating-${latest.release.version}-sharding-ui-bin.tar.gz: Binary package of Sharding-UI
T
tuohai666 已提交
134
sharding-distribution/shardingsphere-src-distribution/target/apache-shardingsphere-incubating-${latest.release.version}-src.zip: Source code package of ShardingSphere
T
tuohai666 已提交
135
```