1. 程式人生 > >Atlas & mysql-proxy

Atlas & mysql-proxy

取模 dde mysql head ESS 數據庫 com tap table

Atlas

https://github.com/Qihoo360/Atlas

https://github.com/Qihoo360/Atlas/wiki/Installing-Atlas

Atlas is a MySQL protocol-based database middleware project developed and maintained by infrastructure team of the Web platform Department in QIHU 360 SOFTWARE CO. LIMITED(NYSE:QIHU). It fixed lots of bugs and added lot of new functions on the basis of MySQL-Proxy 0.8.2. Currently the project has been widely applied in QIHU, many MySQL business has connected to the Atlas platform. The number of read and write requests forwarded by Atlas has reached billions.

Atlas的分表功能簡介

2.tables參數設置格式:數據庫名.表名.分表字段.子表數量,比如你的數據庫名叫school,表名叫stu,分表字段叫id,總共分為100張表,那麽就寫為school.stu.id.100,如果還有其他的分表,以逗號分隔即可。用戶需要手動建立100張子表(stu_0,stu_1,…stu_99,註意子表序號是從0開始的)。且所有的子表必須在DB的同一個database裏。

點評:取模方法簡單好理解,而再擴展子表就麻煩了,不如一致性哈希算法靈活,不用大量遷移數據。

4.Atlas暫不支持自動建表和跨庫分表的功能。

架構圖

https://github.com/Qihoo360/Atlas/wiki/The-Architecture-Of-Atlas

Mysql-proxy

https://downloads.mysql.com/archives/proxy

https://github.com/mysql/mysql-proxy

Atlas & mysql-proxy