鍘熸枃鏉ヨ嚜 http://www.gpfeng.com/?p=657&utm_source=tuicool
鍐欏湪鍓嶉潰
14骞翠腑鎹?簡涓?浠藉伐浣滐紝鍑哄浗娓歌崱浜嗕竴闃靛瓙锛岀洰鍓嶅伐浣滅?鏁版嵁搴撳唴鏍歌繙浜嗙偣锛岀?涓氬姟杩戜簡浜涳紝涓氬姟灞傞潰纰板埌鐨勨?橀珮娣扁?欐妧鏈?棶棰樹篃灏戜簡锛屾梾琛屽悗鍙戠幇浜轰篃鎳掍簡涓嶅皯锛屽?鑷村崥瀹㈤兘闀胯崏浜?
2015寮?濮嬩簡锛屽厛琛ㄦ?佷竴涓嬬洰鏍囷細 鎴?015骞寸殑鐩?爣灏辨槸鎼炲畾2014骞撮偅浜涘師瀹氫簬2013骞村畬鎴愮殑瀹夋帓锛屼笉涓哄埆鐨勶紝鍙?负鍏戠幇鎴?012骞存椂瑕佸畬鎴愮殑2011骞村勾搴﹁?鍒掔殑璇鸿█
2015-goal
闂??鑳屾櫙
宸ヤ綔涓?亣鍒版暟鎹?簱鏁版嵁澧為暱杩囧揩锛屽崟琛ㄤ竴骞翠箣鍚庨?璁″埌杈?5M琛屾暟鎹?紝鍙?互棰勮?MySQL鎬ц兘灏嗕笅闄嶅帀瀹筹紝骞朵笖闅忕潃涓氬姟鐨勮?妯″寲锛屾媴蹇冨崟琛ㄥ皢寰堥毦鎶椾綇骞跺彂鍘嬪姏锛屽嚭鐜版晠闅滃悗鎭㈠?鏃堕棿鍙橀暱瀵逛笟鍔″奖鍝嶄篃浼氬彉澶э紝鍥犳?闇?瑕佽?冭檻鏁版嵁姘村钩鎵╁睍锛岀洰鍓嶉」鐩?噰鐢℅olang寮?鍙戯紝涓?涓狦oogle寮?鍙戠殑浠ョ畝娲佺殑璇?硶锛屽唴寤洪珮骞跺彂妯″瀷锛屾敮鎸佸瀮鍦惧洖鏀朵负涓昏?鐗圭偣鐨勭紪璇戝瀷璇?█锛屾?ц兘姣擩ava濂斤紝寮?鍙戞晥鐜囨瘮C/C++楂橈紝鍏剁洰鏍囨槸鏇夸唬C/C++
鍒嗗簱鍒嗚〃
杩欏洓涓?瓧鍦ㄩ樋閲屽惉寰楁渶澶氾紝鍏跺疄杩欎篃鏄??闂??鍜屽帇鍔涙帹鍔ㄧ殑锛屾瘯绔熻?鏀?拺璧烽偅涔堝ぇ鐨勪笟鍔★紝绛夌潃Oracle杩欐牱鐨勫叕鍙告彁渚涜В鍐虫柟妗堟槸涓嶉潬璋辩殑锛岃繕涓嶅?鍗疯捣琚栧瓙鑷?繁骞诧紝鎺ョ潃灏遍檰缁?悶鍑哄苟寮?婧愪簡Cobar锛孴DDL锛堜笉缁欏嚭閾炬帴浜嗭紝澶??鏄撴悳鍒帮級杩欎簺鏁版嵁搴撲腑闂翠欢锛孋obar搴旇?鍦═DDL涔嬪墠锛岃繖涓?笢瑗块噰鐢╬roxy鏂瑰紡锛屾?ц兘鑲?畾涓嶅?浠ュ悗缁璲dbc灞傞潰瀹炵幇鐨凾DDL锛屾瘯绔熷皯浜嗕竴娆$綉缁滆浆鍙戯紝鐜板湪TDDL鍦ㄩ樋閲屾牳蹇冪郴缁熶笂澶ч噺浣跨敤锛屼笉杩囧?閮ㄧ敤鎴锋兂鐢ㄨ捣鏉ヨ繖涓?病鏈夐偅涔堝?鏄擄紝棣栧厛璇?█闄愬埗鍦ㄤ簡Java锛屽彟澶栬繕闇?瑕侀樋閲岄厤缃??鐞嗘湇鍔?iamond鐨勬敮鎸?
瑕佹兂姘村钩鎵╁睍锛屽氨闇?瑕佸垎搴撳垎琛ㄧ殑鏀?寔锛屽垎搴撳垎琛ㄨ繖鍥涗釜瀛楄?璧锋潵寰堝?鏄擄紝鎸夌収id鍙栨ā灏嗘暟鎹?墦鏁e垎鎽婂帇鍔涳紝浣嗘槸骞插畬杩欎簺涔嬪悗闇?瑕佽В鍐崇敱姝ゅ甫鏉ョ殑闂??锛岃繖浜涘緢闅撅細
1. 浜嬪姟鏀?寔锛屾墿搴?鎵╄〃鍚庝簨鍔″氨鎴愬垎甯冨紡鐨勪簡锛岄棶棰橀毦搴︽樉鐒朵笂鍗囦簡涓?涓?骇鍒?
2. 鏌ヨ?缁撴灉鍚堝苟锛岃繖涓?湅璧锋潵涓嶉毦锛屼絾鏄?妸order by/limit/鏌ヨ?涓?笉甯﹀垎琛ㄥ瓧娈电瓑鍔犱笂锛岃?瑙e喅鐨勯棶棰樿繕涔熶笉灏?
3. join锛岃繖涓?洿闅?
4. 鍒嗗簱锛熷垎琛?紵杩樻槸鍒嗗簱鍒嗚〃锛熻繖涓?渶瑕佽?冭檻骞跺仛涓?涓?喅瀹?
5. 鍒嗗畬鍚庤兘鍚﹀悎骞讹紵鍒嗗?鏄擄紝鍜屽緢闅?
6.銆傘?傘??
寮?婧愯В鍐虫柟妗?
鏁版嵁搴撳垎搴撳垎琛ㄥ紑婧愪骇鍝佹湁寰堝?锛屼笅鍥句腑鍒楀嚭浜?涓?紝瀹冧滑宸茬粡鍦ㄧ嚎涓婃壙杞戒簡杈冨ぇ鍘嬪姏锛屼富瑕佸垎涓?绫伙細浠g悊鍙婇潪浠g悊锛岄潪浠g悊鏂瑰紡鏄?互library鏂瑰紡鎻愪緵锛宭ibrary璐熻矗SQL瑙f瀽锛岃矾鐢辫?绠楃瓑锛屼綅浜巇river灞傦紝瀹炵幇闅惧害杈冨ぇ锛屼竴鑸?粎鏀?寔灏戞暟鍑犵?璇?█锛涗唬鐞嗘柟寮忕浉褰撲簬涓?涓??浜嗕竴娆¤浆鍙戯紝搴旂敤绋嬪簭杩炴帴鐨勬槸浠g悊鏈嶅姟鍣?紝鐢变唬鐞嗘湇鍔″櫒璐熻矗璺?敱璁$畻骞跺彂閫丼QL鍒扮洰鐨凞B锛屽?涓?娆$綉缁滐紝鍥犳?鍦ㄦ?ц兘涓婁唬鐞嗘柟寮忔瘮闈炰唬鐞嗘柟寮忔?ц兘绋嶄綆
db-scale
杩欎簺瑙e喅鏂规?涓璏ySQL Fabric/TDDL涓や釜涓洪潪浠g悊鏂瑰紡锛岀洿鎺ユ彁渚涜?瑷?灞傞潰鐨勬敮鎸侊紝浼樼偣鏄??ц兘浼氬緢濂斤紝鍔e娍鏄?敮鎸佺殑璇?█寰堝彈闄愬埗锛孴DDL鏀?寔鏀疛ava锛孧ySQL Faric鏀?寔Java/PHP/Python锛屾兂瀹炵幇鍏朵粬璇?█鏀?寔锛岀浉褰撲簬鍐嶆?瀹炵幇涓?娆★紝涓嶈繃鐩?墠Java/PHP/Python闈炲父娴佽?锛岃兘澶熻?鐩栫殑鐢ㄦ埛寰堝?浜嗭紝TDDL瀵逛簬澶栭儴鐢ㄦ埛鏉ヨ?锛屽厛鐢ㄨ捣鏉ユ病鏈夐偅涔堝?鏄擄紝鍜岄樋閲屽钩鍙扮揣瀵嗙粦瀹氾紝濡傛灉鏈夋椂闂撮厤缃瓺iamond鐨勮瘽锛屽彲浠ュソ濂界爺绌讹紝杩欓噷涓嶈繘琛屾繁鍏ユ帰璁?
鍙﹀?鍥涗釜鍏ㄩ儴閮芥槸Proxy鏂瑰紡锛屼互閮ㄥ垎鎬ц兘鎹㈡潵鐏垫椿鎬э紝杩欎釜灏辨槸浠佽?呰?浠佹櫤鑰呰?鏅虹殑鍐冲畾浜嗭紝鍊煎緱涓?鎻愮殑鏄疊AT涓瑽涔熷疄鐜颁簡涓?涓?Heisenberg 鐨勪腑闂翠欢锛屼粠閮ㄥ垎浠g爜銆侀厤缃?互鍙婃枃浠剁粨鏋勬潵鐪嬶紝杩欎釜鏄?粠Cobar鏉ョ殑锛屽簲璇ヤ紭鍖栦簡閮ㄥ垎鐗规?э紝涓嶈繘琛岃禈杩帮紝鏈夊叴瓒e彲浠ヨ嚜宸辩爺绌?
MySQL Fabric
杩欎釜鏄疢ySQL瀹樻柟姘村钩鎵╁睍鏂规?锛屽彿绉扮?鐞嗙洰鏍囦负锛歠arm of mysqld锛屽叾瀹炴垜姣旇緝鐪嬪ソ杩欎釜涓滆タ锛屽師鍥犳槸涓?汉鍠滄?绠?娲佺殑涓滆タ锛屾?绘劅瑙塒roxy鏂瑰紡澶氫簡涓?灞傝浆鍙戝甫鏉ヤ簡楹荤儲锛岄櫎浜嗘?ц兘澶栬繕鏈夊?鏉傛?э紝杩愮淮璧锋潵涔熷?浜嗕笉灏戜簨鎯咃紝姣曠珶杩欎釜杩涚▼down鎺夊悗鍙?敤鎬т細鍙楀埌褰卞搷锛岀畝鍗曟墠鏄?編锛屽笇鏈汳ySQL Fabric鑳藉?鎻愪緵鏇村?璇?█鏀?寔
Cobar
Cobar鏄?樋閲岀殑涓?棿浠讹紝浠?roxy鏂瑰紡鎻愪緵鏈嶅姟锛屽湪闃块噷鍐呴儴澶ч噺浣跨敤锛岀洰鍓嶅凡缁忓紑婧愬湪 github 浜嗭紝璧炲紑婧愮簿绁烇紝鎹??鍦ㄥ緢澶氬?閮ㄥ叕鍙告湁涓?浜涙垚鍔熶娇鐢ㄧ殑妗堜緥锛岄厤缃?瘮杈冨?鏄擄紝涓嶉渶瑕佷緷璧栧叾浠栦笢瑗匡紝鏈塉ava鐜??灏監K锛屽皬璇曚簡涓?鎶婏紝浜嬪姟鏀?寔姣旇緝楹荤儲锛岄渶瑕侀?氳繃set autocommit=0鏉ュ疄鐜帮紝濡傛灉鎯宠?瀹岀編鏀?寔鐨勮瘽锛岃繕鏄?渶瑕佷慨鏀笿DBC鎴栧?搴旇?瑷?鐨凪ySQL library锛屽垎搴撶ず鎰忓浘锛圕obar涓璬.t鍒嗗埌涓や釜搴撲腑锛歞1.t锛宒2.t锛夛細
cobar-frame
Cobar鏀?寔鍒嗗竷寮忓垎琛?紝浣嗘槸涓嶆敮鎸佸崟搴撳垎澶氳〃锛屽墠娈碉紙瀵规帴APP锛夊拰鍚庣?锛堝?鎺?ySQL锛夐兘瀹炵幇浜哅ySQL瀹㈡埛绔?崗璁?紝姣旇緝鍙嬪ソ锛屽?浜庢墿琛ㄧ粨鏋滈泦鐨勫悎骞朵篃鏀?寔锛屽啓鍏跺唴閮ㄧ殑SQL parse宸ョ▼甯堝姛搴曞簲璇ユ瘮杈冩繁锛屾樉绀鸿捣浜嬪姟浼氭姤閿欙紝搴旇?鏄??淏EGIN鈥濇垨鑰呪?淪tart transaction鈥濅笉鍖呭惈鍒嗚〃淇℃伅鐨勭紭鏁咃紝浣嗘槸杩欎釜鍙?互閫氳繃defer鍒板悗闈?竴涓?寘鍚?垎琛ㄤ俊鎭?殑SQL杩囨潵涓?璧峰彂鍒扮洰鏍囧簱涓?墽琛屾垨鑰呴?氳繃鍒嗗竷寮忎簨鍔★紝姣斿?2PC鏉ユ敮鎸侊紝鎵ц?鏁堟灉锛?
cobar-mysql
Atlas
铏界劧涓?汉瀵规暟瀛楀叕鍙告病鍟ュソ鎰燂紝浣嗘槸杩欎釜 Atlas 杩樻槸闈炲父鏈夌壒鐐圭殑锛屽畠鏄?熀浜嶮ySQL-Proxy涓婁簩娆″紑鍙戠殑锛屼富瑕佹敮鎸佷袱涓?壒鎬э細鍒嗚〃鍜岃?鍐欏垎绂伙紝浣嗘槸鍒嗚〃鐨勮瘽鍙?敮鎸佸崟搴撳?琛?紝鍗充簨瀹炰笂鏄?笉鏀?寔鍒嗗竷寮忓垎琛ㄧ殑锛屾墍鏈夊垎琛ㄩ兘鍦ㄥ悓涓?涓?簱涓?紝灏忚瘯浜嗕竴鎶婏紝涓嬮潰鏄?垎搴撶ず鎰忓浘锛堝洓涓?垎琛╰_0锛宼_1锛宼_2锛宼_3鍦ㄥ悓涓?涓?簱涓?級锛?
atlas-frame
Atlas鎵╁睍鎬ч檺鍒跺湪鍗曞疄渚嬫渶澶ф?ц兘锛屼絾鏄?ソ澶勬槸锛氫簨鍔℃敮鎸佺殑寰堝ソ锛屽洜涓轰笉瀛樺湪璺ㄥ簱浜嬪姟锛屾湁浜涗簨鎯呭弽鑰屽彉寰楃畝鍗曪紝璇诲啓鍒嗙?杩欎釜涓滆タ鍏跺疄娌℃湁姘村钩鎵╁睍閭d箞闅撅紝姣曠珶MySQL鐨勫?搴撳緢濂芥惌锛屼笉寰椾笉鍚愭Ы涓?涓嬶紝閫氳繃atlas鐪嬪埌鐨勪笉鏄?竴寮犲畬鏁寸殑琛?紝鑰屾槸鍚勪釜鍒嗚〃锛屽彧鑳介?氳繃鍒嗚〃鐨勫瓧娈靛畾浣嶅拰鎿嶄綔鏁版嵁锛屽惁鍒欎細鎶ラ敊锛屼笌Cobar瀵规瘮鍚庯紝Atlas杩欎釜浜у搧鍏跺疄绠?娲佷篃绮楃硻寰堝?锛屼絾鏄?殑纭?湁瀹冪壒鏈夌殑搴旂敤鍦烘櫙锛?
atlas-cmd
鍙﹀?锛孉tlas閰嶇疆绋嶅井绠?鍗曚竴浜涳紝浣嗘槸鍒嗚〃绠楁硶鏀?寔涓婄浉瀵逛簬Cobar鏄惧緱骞朵笉瀹屽杽
Vitess
Vitess鏄?Youtube寮?婧愮殑鏁版嵁搴撴墿灞曞強楂樺彲鐢ㄦ柟妗堬紝宸茬粡鐢ㄤ簬鐢熶骇鐜??锛屽姛鑳藉己澶э紝浣嗘槸鏋勬灦澶嶆潅锛岄儴缃插強杩愮淮鎴愭湰杈冮珮锛屾瀯鏋跺浘锛?
vitess
Vitess鍦╝pp涓巇atabase涔嬮棿瀛樺湪vtgate鍙妚ttablet涓や釜server锛寁ttablet瀹炵幇浜哅ySQL杩炴帴姹犲強row cache锛屼笌MySQL瀹炰緥鏄?竴瀵逛竴鍏崇郴锛屽彲浠ュ綋鎴愭槸MySQL鍓嶇?锛屼竴鑸?笌MySQL閮ㄧ讲鍦ㄤ竴璧凤紝鎵?鏈夎惤鍒癕ySQL鐨剄uery閮介渶瑕佺粡杩噕ttablet锛寁tgate鏄?竴涓猵roxy锛岃礋璐h矾鐢辫?绠椾互鍙奱pp鍙妚ttablet涔嬮棿鐨勬暟鎹?浆鍙戯紝鍒嗚〃瑙勫垯鍙婇厤缃?暟鎹?瓨鏀惧湪topology涓?紙zookeeper瀹炵幇锛夛紝鍥犳?姣忎釜query鎵ц?闇?瑕佽蛋鐨勮矾寰勮緝闀匡紝铏界劧vttablet瀹炵幇鐨勮繛鎺ユ睜鍜宺ow cache鍙?互鍔犻?焣uery鎵ц?閫熷害锛屼絾鏄痾ookeeper璁块棶锛宎pp涓巚tgage銆乿tgate涓巚ttablet涔嬮棿涓ゆ?鏁版嵁杞?彂閮借?璧扮綉缁滐紝濡傛灉缃戠粶涓嶅?绋冲畾鍙?互棰勮?鎬ц兘鎹熷け杈冨ぇ
閫氳繃涓巚itess寮?鍙戣?呯‘璁わ紝vtgate浼氱紦瀛榯opology鐨勫垎琛ㄨ?鍒欐暟鎹?紝鍥犳?鐩稿?浜庡叾浠杙roxy鏂规?锛屽彧鏄??浜嗕竴灞倂ttablet鐨勮浆鍙戜唬浠凤紝浣嗘槸鑰冭檻鍒皉ow cache鐨勫姞閫燂紝鏈?鍚庢?ц兘搴旇?鐩稿樊涓嶅ぇ
鍙﹀?锛岃繖涓?」鐩?槸閲囩敤Golang璇?█鐨勶紝杩欏?浜嶨olang椤圭洰浼樺娍闈炲父鏄庢樉锛岄噰鐢ㄦ湰鏂囦腑Vitess涔嬪?鐨勬柟妗堬紝 go-sql-driver 鏃犳硶鏀?寔浜嬪姟锛岃?瑙?google-group vitess 璁ㄨ?
鎬荤粨
鏈?枃婧愪簬椤圭洰瀹為檯闇?姹傦紝瀵瑰浗鍐呭?寮?婧愮殑MySQL姘村钩鎵╁睍鏂规?鍋氫簡涓?涓?畝鍗曟?荤粨锛屽彲浠ョ湅鍒板浗鍐呬簰鑱旂綉鍏?徃杩欒繖鏂归潰鍋氬緱寰堜笉閿欙紝鍐嶆?涓轰粬浠?殑寮?婧愮簿绁炵偣璧?