kingshard is a high-performance proxy for MySQL powered by Go. Just like other mysql proxies, you can use it to split the read/write sqls. Now it supports basic SQL statements (select, insert, update, replace, delete). The most important feature is the sharding function. Kingshard aims to simplify the sharding solution of MySQL.
The Performance of kingshard is about 80% compared to connecting to MySQL directly.
max, min, count, sum, and also support join, limit, order by,group by.docker run -it -v ${pwd}/ks.yaml:/etc/ks.yaml wangsying/kingshard:1.6 kingshard
addr : 0.0.0.0:9696
user_list:
-
user : kingshard
password : kingshard
web_addr : 0.0.0.0:9797
web_user : admin
web_password : admin
log_level : debug
log_sql : on
slow_log_time : 100
log_path : /var/log/kingshard
allow_ips: 127.0.0.1
nodes :
-
name : node1
max_conns_limit : 16
user : kingshard
password : kingshard
master : 127.0.0.1:3306
down_after_noalive : 300
-
name : node2
max_conns_limit : 16
user : kingshard
password : kingshard
master : 192.168.59.103:3307
slave :
down_after_noalive: 100
schema_list :
-
user: kingshard
nodes: [node1,node2]
default: node1
shard:
-
db : kingshard
table: test_shard_hash
key: id
nodes: [node1, node2]
type: hash
locations: [4,4]
-
db : kingshard
table: test_shard_range
key: id
type: range
nodes: [node1, node2]
locations: [4,4]
table_row_limit: 10000
Content type
Image
Digest
Size
11.3 MB
Last updated
over 5 years ago
docker pull wangsying/kingshard:1.6-alpine3.13