HubLensGoXiaoMi/Gaea
// archived 2026-04-13
XiaoMi

Gaea

Database#MySQL#Middleware#Sharding#Go#Database Proxy
View on GitHub
2,771

// summary

Gaea is a database middleware independently developed by Xiaomi Group based on the MySQL protocol, widely used in various business fields such as mobile, finance, and the internet. The system supports core functions including sharding, SQL routing, and read-write splitting, and is compatible with Mycat and Kingshard routing schemes. By integrating mature technologies like TiDB Parser, the project provides users with rich basic features including multi-tenant management, connection pooling, and hot configuration loading.

// technical analysis

Gaea is a MySQL database middleware developed by Xiaomi, designed to solve database scaling and management challenges in large-scale business scenarios. The project implements flexible database sharding and table partitioning by being compatible with Mycat and Kingshard routing schemes, and integrates the TiDB SQL Parser to ensure parsing accuracy. Its architecture supports multi-cluster and multi-tenant management, and through the coordination of gaea-cc and etcd, it achieves centralized configuration management and hot-loading, effectively improving the operational efficiency and scalability of database clusters.

// key highlights

01
Supports database sharding and table partitioning, compatible with Mycat and Kingshard routing rules, facilitating the migration of existing businesses.
02
Built-in TiDB SQL Parser ensures precise parsing and transparent forwarding of complex SQL statements.
03
Equipped with comprehensive read-write splitting and slave node load balancing mechanisms, effectively enhancing database concurrency processing capabilities.
04
Provides slow SQL and error SQL fingerprinting features, helping developers quickly locate and optimize performance bottlenecks.
05
Supports multi-cluster and multi-tenant architecture, achieving configuration hot-loading via etcd to meet the flexible deployment needs of large-scale businesses.
06
Built-in connection pooling and IP whitelist management optimize connection resource utilization while ensuring database access security.

// use cases

01
Supports sharding, various aggregate functions, and Join operations
02
Implements read-write splitting and replica load balancing to improve performance
03
Provides multi-cluster, multi-tenant management, and transparent SQL forwarding functions

// getting started

Developers can learn about the deployment process by consulting the quickstart.md in the project documentation. It is recommended to first configure etcd and gaea-cc to implement cluster management, and then refer to the configuration.md to complete the integration of database nodes and the setup of routing rules.