Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

fix: 1. 修复监控节点数据被覆盖问题 2. 新增节点没有动态监控问题

Git stats


Failed to load latest commit information.
Latest commit message
Commit time
June 11, 2018 17:45
October 30, 2018 09:27
December 28, 2019 14:45
June 20, 2020 09:41
February 12, 2017 11:17
November 16, 2019 09:05
January 25, 2016 13:59
November 16, 2019 09:05
November 16, 2019 09:05
November 16, 2019 09:14
November 16, 2019 09:05
December 4, 2019 17:03
July 16, 2015 20:10
November 16, 2019 09:05
November 16, 2019 09:05

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.