Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhongantech/dmds

DMDS is a highly scalable distributed MySQL sharding middleware.
https://github.com/zhongantech/dmds

database java middleware mysql shard

Last synced: 6 days ago
JSON representation

DMDS is a highly scalable distributed MySQL sharding middleware.

Awesome Lists containing this project

README

        

# DMDS

__DMDS__(Distributed MySQL Database Service) is a MySQL sharding middleware base on [MyCAT](https://github.com/MyCATApache/Mycat-Server).

## What is Different ?

- __Table sharding__

Support sharding database and table in the same time.

- __Simplify__

Focus on MySQL , remove some unnecessary features like zookeeper config 、 catlte .

## Deploy

- __Package__

After download source code, package it with maven and JDK (verison >= 7).

```bash
mvn clean package -DskipTests=true
```

- __Start__

Copy package `dmds-server-xxx.tar` to deploy directory. Run `bin/startup.sh ` after unzip it.

```bash
cp target/dmds-server-xxx.tar.gz deploy/
cd deploy/
tar -xf dmds-server-xxx.tar.gz
cd dmds-server-1.0.0/
./bin/startup.sh
```

- __Stop__

Run `bin/stop.sh` to stop it.

## Sharding Configuration Example

Configuration files are under conf directory like MyCAT. Let's see an example for 8 sharding tables in 2 databases.

- __schema.xml__

Configure hostNode、dataNode and schema. Schema name is `dmds_test` , data node is `dn_dmds_test_00` and `dn_dmds_test_01`

```xml






select 1


```

- __rule.xml__

Configure tableRule and sharding function. Function class must be `com.zhongan.dmds.route.function.PartitionTbByMod`.

- shardColumnType

Data type of sharding column, `0` for numerical and `1` for string.

```xml


id
function_dmds_test_ts_order



2
4
0

```

- __server.xml__

Configure access user. user name is `dmds_test`

```xml

4fe313bd
dmds_test

```

- __Table distributed__

The physical table is distributed in order on 2 databases. Table names are automatically generated.

```sql
select TABLE_SCHEMA, TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA like 'dmds_test_%' and TABLE_NAME like 'ts_order_%';
+--------------+---------------+
| TABLE_SCHEMA | TABLE_NAME |
+--------------+---------------+
| dmds_test_00 | ts_order_0000 |
| dmds_test_00 | ts_order_0001 |
| dmds_test_00 | ts_order_0002 |
| dmds_test_00 | ts_order_0003 |
| dmds_test_01 | ts_order_0004 |
| dmds_test_01 | ts_order_0005 |
| dmds_test_01 | ts_order_0006 |
| dmds_test_01 | ts_order_0007 |
+--------------+---------------+
```

## Contributing

See [Contributing to DMDS](CONTRIBUTING.md) for details on reporting bugs and commit pull request.

## License

DMDS are licensed under [GPL2.0 license](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)

## More Information
For more information, please see [MyCAT documents](https://github.com/MyCATApache/Mycat-doc/tree/master/en).