Freedom251 › Database Proxy Software
kingshard

What kingshard is
kingshard is a free, open-source, self-hosted proxy for MySQL, powered by Go. It routes read and write SQL statements separately and can balance read traffic across multiple slave databases. The project supports hash and range sharding across nodes, with date sharding also described, and its usage guidance covers MySQL clusters for read/write splitting, table sharding, and connection pooling. Listed SQL support includes select, insert, update, replace, and delete. For sharded queries, kingshard lists joins, limits, ordering, grouping, and aggregate functions such as max, min, count, and sum. It also supports prepared statements, last_insert_id(), and transactions within a single node. Operational controls include backend high availability, automatic failover, connection limits, dynamic online or offline backend changes, and runtime configuration changes. Client IP access controls and an SQL blacklist provide request filtering. Deployment uses Go, a Git source clone, make, a YAML configuration file, and a locally run binary. The project is licensed under Apache 2.0 and supports MySQL as its database. Its README describes performance at about 80% compared with connecting directly to MySQL.
Who it suits
kingshard suits teams running self-hosted MySQL clusters that need read/write routing, read scaling, sharding, pooling, and backend availability controls. It is aimed at operators comfortable with Go-based source installation and YAML configuration.
What it does well
- Free and open source under Apache 2.0
- Routes reads and writes separately
- Balances reads across slave databases
- Supports hash, range, and date sharding
- Includes connection pooling and automatic failover
- Provides dynamic backend online/offline control
What to know first
- Sharded subtables require manual creation
- Transactions work only within one database
- Cross-database updates return errors
- Deployment requires Go, Git, make, and configuration
Limits
Sharded subtables must be created manually. Transactions spanning multiple databases and updates routed across multiple databases return errors.
Getting started
- Install Go
- Clone the kingshard source with Git
- Run make to build the project
- Create a YAML configuration file
- Run the locally built kingshard binary
- Create sharded subtables in their appropriate databases
Verdict
Choose kingshard for a self-hosted MySQL cluster needing SQL routing, sharding, pooling, and backend controls without a license fee. Look elsewhere if your transactions or updates routinely span multiple databases or you want a managed deployment.
Questions
Is kingshard free?
Yes. kingshard is free and open source under the Apache 2.0 license.
Which database does kingshard support?
MySQL is the supported database.
How is kingshard deployed?
It is self-hosted. Documented setup uses Go, a Git clone, make, a YAML configuration file, and a locally run binary.
What sharding methods are supported?
kingshard supports hash and range sharding across nodes, and its README also lists date sharding.
Does kingshard support read scaling?
Yes. It can split read and write statements and balance reads across multiple slave databases.
Are cross-database transactions supported?
Transactions are supported within one database. Transactions spanning multiple databases return errors.
Facts from kingshard's own pages
- Access controls
- It lists client IP ACL control and an SQL blacklist among its features. · github.com, 8 Oct 2026
- Availability
- It lists high availability for MySQL backends and allows backend databases to be set online or offline dynamically. · github.com, 8 Oct 2026
- Connections
- It supports setting a maximum number of connections to MySQL databases and transactions on a single node. · github.com, 8 Oct 2026
- Cross-node transaction limit
- The guide says transactions are supported only within one database and return errors if they span multiple databases. · github.com, 4 Oct 2026
- Cross-node update limit
- The guide says an update routed across multiple databases returns an error. · github.com, 4 Oct 2026
- Deployment
- The documented installation uses Go, Git clone, make, a YAML configuration file, and a locally run kingshard binary. · github.com, 4 Oct 2026
- Installation
- The documented installation uses Go, a source clone, make, a configuration file, and running the built binary. · github.com, 8 Oct 2026
- License
- The repository says kingshard is licensed under Apache 2.0. · github.com, 8 Oct 2026
- Manual setup limit
- The guide says sharded subtables must be created manually in the appropriate database. · github.com, 4 Oct 2026
- Operations
- It supports MySQL backend high availability, connection limits, dynamic backend online/offline changes, and runtime configuration changes. · github.com, 4 Oct 2026
- Performance claim
- The README says performance is about 80% of connecting directly to MySQL. · github.com, 8 Oct 2026
- Prepared statements
- It supports prepared statement operations including COM_STMT_PREPARE and COM_STMT_EXECUTE. · github.com, 8 Oct 2026
- Product
- kingshard is a Go-powered, high-performance proxy for MySQL. · github.com, 4 Oct 2026
- Purpose
- kingshard is a Go-powered MySQL proxy that routes read and write SQL and aims to simplify MySQL sharding. · github.com, 8 Oct 2026
- Query capabilities
- It lists support for prepared statements, single-node transactions, last_insert_id(), and common aggregate functions including max, min, count, and sum. · github.com, 4 Oct 2026
- Query features
- For sharded queries, it lists max, min, count, and sum functions, plus join, limit, order by, and group by. · github.com, 8 Oct 2026
- Read scaling
- It supports multiple slave databases and load balancing between slaves. · github.com, 8 Oct 2026
- Read/write routing
- It splits read and write SQL statements and can balance reads across multiple slave databases. · github.com, 4 Oct 2026
- Release
- The GitHub releases page identifies v1.6 as the latest release and describes multi-user support and configuration hot reload. · github.com, 8 Oct 2026
- Sharding
- It supports hash, range, and date sharding across multiple nodes, as well as sending SQL to a specified node. · github.com, 8 Oct 2026
- SQL support
- The README lists select, insert, update, replace, and delete as supported basic statements. · github.com, 8 Oct 2026
- Use case
- The usage guide describes using kingshard to build a MySQL cluster for read/write splitting, table sharding, and connection pooling. · github.com, 4 Oct 2026
Where kingshard stands on Freedom251
- Database Proxy Software#21 of 31
- Minecraft Launchers#71 of 76