Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kingshard

> 数据库
Open source

A high-performance MySQL proxy

6.4K stars0 likes1 views
WebsiteGitHub

About

A high-performance MySQL proxy

kingshard 中文主页

Overview

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.

Feature

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.

Install

  1. Install Go
  2. git clone https://github.com/flike/kingshard.git $GOPATH/src/github.com/flike/kingshard
  3. cd $GOPATH/src/github.com/flike/kingshard
  4. source ./dev.sh
  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

License

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

Issues· 160 open

View all issuesOpen on GitHub
  • #636

    The Ultimate Guide to Outfitting Your Crew Without Leaving the Office

    Updated Apr 16, 2026
  • #635

    Best Hi Vis Workwear for Australian Job Sites in 2026

    Updated Apr 9, 2026
  • #624

    在用kingshard的活跃用户在这里登记一下吧,咱们一起交流交流

    Updated Apr 12, 2025
  • #568

    小白求指教 ERROR conn.go:[231]

    Updated Mar 11, 2025
  • #626

    分表问题

    Updated Jun 29, 2023
  • #620

    这个好像好久不更新了

    Updated Oct 19, 2022
  • #621

    When does kingshard support mysql8.0? My company now uses mysql8.0.

    Updated Oct 19, 2022
  • #590

    mysql连接时Access denied for user 'kingshard'@'127.0.0.1:52778' (using password: Yes)

    Updated Oct 19, 2022
  • #623

    谁能把这项目救活?

    Updated Oct 19, 2022
  • #622

    kingshard QQ群还活跃吗?

    Updated Oct 19, 2022

> Tags

Gokingshardmysqlmysql-proxy

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库