Sharding-JDBC is a distributed database middleware, focus on data sharding, read-write splitting, BASE transaction and database orchestration. It provides maximum compatibilities for applications by JDBC driver or database protocols proxy.
* Standard aggregation functions, GROUP BY, ORDER BY, LIMIT and JOIN DQL supported.
* Standard DML, DDL, TCL and database administrator command supported.
* Sharding operator `=`, `BETWEEN` and `IN` supported.
* Sharding algorithm customization and inline expression supported.
* Route by hint supported.
* Distributed sequence supported.
## 2. Read-write splitting
* Multiple slaves replica supported.
* Data consistency guarantee in same thread supported.
* Mix read-write splitting and data sharding supported.
* Route by hint supported.
## 3. BASE Transaction
* Best efforts delivery transaction supported.
* Try confirm cancel transaction (TBD).
Sharding-Sphere is an open-sourced distributed database middleware solution suite, which is composite by Sharding-JDBC, Sharding-Proxy and Sharding-Sidecar. Those 3 projects provide consistent features which include data sharding, read-write splitting, orchestration and B.A.S.E transaction. They can suitable for various scenario.
## 4. Orchestration
* Configuration center supported, can refresh dynamically.
* Circuit breaker supported.
* Open tracing supported.
Sharding-Sphere is a Relational Database Middleware which reuse capacity of original databases (such as: compute, storage), but make best simplicity and efficiency on distribute environment. Sharding-Sphere do not want implement a new database.
It can cooperate with NoSQL and NewSQL. NoSQL and NewSQL are good exploration for technology, they are care about what’s going to change. There is another theory which is care about what’s not going to change. Relational Database still is the biggest percentage of market share, it is difficult to estimate trendy in future. So we are focus about how to enhance with Relational Database now.
It can mesh interactions between applications and databases, must run in Kubernetes or Mesos environment.
It is a centre-less solution, can support any languages, we call it as `Database Mesh`.
## Sharding-JDBC
Database Mesh is focused on how to connect the distributed data-access-layer and databases together. It pays more attention on interaction, which means the messy interaction among the applications and databases will be effectively orchestrate. By using Database Mesh, applications and databases will form a large grid system, and they just need to be put into the right position on grid system accordingly.
| Heterogeneous Language | Java Only | Any | Any |
| Performance | Low loss | High loss | Low loss |
| Centre-less | Yes | No | No |
| Static Entry | No | Yes | No |
### Configure sharding rule
## Features
Sharding-JDBC support 4 types for sharding rule configuration, they are `Java`, `YAML`, `Spring namespace` and `Spring boot starter`. Developers can choose any one for best suitable situation.
### Data sharding
### Create DataSource
Use ShardingDataSourceFactory to create ShardingDataSource, which is a standard JDBC DataSource. Then developers can use it for raw JDBC, JPA, MyBatis or Other JDBC based ORM frameworks.
* Both databases and tables sharding.
* Aggregation functions, GROUP BY, ORDER BY, LIMIT, OR, and JOIN DQL supported.
* DML, DDL, TCL and database administrator command supported.
* Sharding operator `=`, `BETWEEN` and `IN` supported.
* Sharding algorithm customization and inline expression supported.