Skip to content
A high-performance MySQL proxy
Go Yacc Other
Branch: master
Clone or download
flike Merge pull request #510 from qiuker521/patch-1
fix sharding name typo error
Latest commit e5cad20 Dec 28, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
backend fix#479 Nov 1, 2018
config 增加prometheus监控 Jun 11, 2018
doc Merge pull request #510 from qiuker521/patch-1 Dec 28, 2019
monitor 修复map可能存在的race Sep 26, 2018
mysql bugfix #310 Feb 12, 2017
sqlparser support go mod Nov 16, 2019
sqltypes modify doc Jan 25, 2016
web support go mod Nov 16, 2019
.travis.yml update travis Nov 16, 2019
Makefile 将代码的clone路径改为$GOPATH Aug 16, 2019 Fix typo in Dec 4, 2019 change travis.yml Jul 16, 2015
go.sum support go mod Nov 16, 2019

kingshard 中文主页

Build Status


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.


1. Basic Function

  • Splits reads and writes
  • Client's ip ACL control.
  • Transaction in single node.
  • Support limiting the max count of connections to MySQL database.
  • Support setting the backend database online or offline dynamically.
  • Supports prepared statement: COM_STMT_PREPARE, COM_STMT_EXECUTE, etc.
  • Support multi slaves, and load balancing between slaves.
  • Support reading master database forcely.
  • Support last_insert_id().
  • Support MySQL backends HA.
  • Support set the charset of proxy.
  • Support SQL blacklist.
  • Support dynamically changing the config value of kingshard.

2. Sharding Function

  • Support hash,range and date sharding across multiple nodes.
  • Support sending sql to the specified node.
  • Support most commonly used functions, such as max, min, count, sum, and also support join, limit, order by,group by.


  1. Install Go
  2. git clone $GOPATH/src/
  3. cd $GOPATH/src/
  4. source ./
  5. make
  6. set the config file (etc/ks.yaml)
  7. run kingshard (./bin/kingshard -config=etc/ks.yaml)

Details of kingshard

1.How to use kingshard building a MySQL cluster


kingshard is under the Apache 2.0 license. See the LICENSE directory for details.

You can’t perform that action at this time.