Gaea
Gaea is a MySQL proxy middleware developed by Xiaomi that provides database routing, sharding, and read-write separation. It is production-deployed across Xiaomi's consumer, automotive, IoT, fintech, and internet businesses and supports multi-tenant, multi-cluster configurations.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | XiaoMi/Gaea |
| Owner | XiaoMi |
| Primary language | Go |
| License | Apache-2.0 — OSI-approved |
| Stars | 2.8k |
| Forks | 451 |
| Open issues | 67 |
| Latest release | v2.4.2 (2024-09-20) |
| Last updated | 2026-03-18 |
| Source | https://github.com/XiaoMi/Gaea |
What Gaea is
Go-based MySQL protocol proxy implementing sharding (mycat-compatible partitioning, kingshard-compatible table sharding), connection pooling, SQL routing, slow query fingerprinting, and load balancing. Uses TiDB parser for SQL analysis and etcd + gaea-cc for centralized cluster configuration management.
Get the Gaea source
Clone the repository and explore it locally.
git clone https://github.com/XiaoMi/Gaea.gitcd Gaea# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- etcd cluster and gaea-cc service are required for centralized configuration and must be deployed, monitored, and backed up alongside Gaea instances.
- Sharding key selection and routing rules must be carefully designed during schema planning; resharding and data rebalancing are manual processes not yet fully automated.
- Connection pool tuning, slow query fingerprinting, and SQL filtering rules should be tested in staging to avoid production query rejection or performance regression.
- Prepare statement support and transaction semantics differ from direct MySQL; comprehensive testing of application ORM/driver compatibility is essential.
- Documentation is primarily in Chinese; non-Chinese teams should allow time for translation and deeper design document review.
When to avoid it — and what to weigh
- No distributed transaction support — Applications requiring ACID guarantees across shards should not rely on Gaea; distributed transactions are on the roadmap but not yet implemented.
- Early-stage products with minimal ops — Small teams without dedicated database operations expertise may find the multi-cluster, etcd, and gaea-cc operational overhead excessive for single-cluster deployments.
- Non-MySQL databases required — Gaea is MySQL-protocol-specific; it cannot proxy PostgreSQL, MongoDB, or other database systems.
- Extreme low-latency requirements — Proxy overhead and routing logic add latency; use cases demanding sub-millisecond query response times should benchmark carefully or use direct database connections.
License & commercial use
Licensed under Apache License 2.0, a permissive OSI-approved license permitting commercial use, modification, and distribution with appropriate attribution.
Apache-2.0 is a permissive open-source license allowing commercial use and derivative works. However, conduct an internal review to confirm compliance with your organization's open-source policies and ensure proper attribution.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
IP/IP-segment whitelist and custom SQL interception/filtering are available for access control and query validation. No third-party security audit findings disclosed. Gaea-cc HTTP API requires careful network isolation. SQL fingerprinting and slow query logging may expose query patterns in logs; log access should be restricted. etcd cluster security (TLS, authentication) must be independently configured and maintained.
Alternatives to consider
Vitess (YouTube's MySQL proxy)
Mature, widely adopted, supports resharding automation and more advanced distributed transaction semantics; steeper learning curve and heavier operational footprint.
MySQL Router
Oracle-backed, simpler setup for read-write separation and basic routing without custom sharding; less flexible for multi-tenant or complex sharding scenarios.
ProxySQL
Lightweight, rule-based SQL routing with lower overhead; suitable for read-write splitting and simple traffic management but lacks native sharding intelligence.
Build on Gaea with DEV.co software developers
Gaea is a production-proven MySQL proxy for complex sharding and multi-tenant deployments. Contact our team to discuss architecture fit, integration planning, and operational readiness for your use case.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
Gaea FAQ
Does Gaea support distributed transactions?
Can I migrate from mycat or kingshard?
What is the performance overhead?
Is gaea-cc required for single-cluster deployments?
Work with a software development agency
Need help beyond evaluating Gaea? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Ready to evaluate Gaea for your infrastructure?
Gaea is a production-proven MySQL proxy for complex sharding and multi-tenant deployments. Contact our team to discuss architecture fit, integration planning, and operational readiness for your use case.