55

GitHub - XiaoMi/Gaea

 5 years ago
source link: https://github.com/XiaoMi/Gaea
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

Build Status Go Report Card

简介

Gaea是小米商城/系统组研发的基于mysql协议的数据库中间件,目前在小米商城大陆和海外得到广泛使用,包括订单、社区、活动等多个业务。Gaea支持分库分表、sql路由、读写分离等基本特性,更多详细功能可以参照下面的功能列表。其中分库分表方案兼容了mycat和kingshard两个项目的路由方式。Gaea在设计、实现阶段参照了mycat、kingshard和vitess,并使用tidb parser作为内置的sql parser,在此表达诚挚感谢。为了方便使用和学习Gaea,我们也提供了详细的使用和设计文档,也欢迎大家多多参与。

功能列表

基础功能

  • 多租户
  • SQL透明转发
  • 慢SQL指纹
  • 错误SQL指纹
  • 注解路由
  • 慢日志
  • 读写分离,从库负载均衡
  • 自定义SQL拦截与过滤
  • 连接池
  • 配置热加载
  • IP/IP段白名单
  • 全局序列号

分库、分表功能

  • 分库: 支持mycat分库方式
  • 分表: 支持kingshard分表方式
  • 聚合函数: 支持max、min、sum、count、group by、order by等
  • join: 支持分片表和全局表的join、支持多个分片表但是路由规则相同的join

架构图

gaea架构图

安装使用

设计与实现

自有开发模块

  • backend
  • cmd
  • log
  • models
  • proxy/plan
  • proxy/router(kingshard路由方式源自kingshard项目本身)
  • proxy/sequence
  • server

外部模块

  • mysql(google vitess、tidb、kingshard都有引入)
  • parser(tidb)
  • stats(google vitess,打点统计)
  • util(混合)

社区

gitter

Gitter

微信群

微信


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK