{"id":2057,"date":"2018-10-29T10:22:51","date_gmt":"2018-10-29T02:22:51","guid":{"rendered":"https:\/\/damogame.cn:15443\/wordpress\/?p=2057"},"modified":"2018-10-29T10:22:51","modified_gmt":"2018-10-29T02:22:51","slug":"memsql-%e6%9e%b6%e6%9e%84%e5%88%9d%e6%8e%a2","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/2057","title":{"rendered":"MemSQL \u67b6\u6784\u521d\u63a2"},"content":{"rendered":"<div class=\"clear\">\u00a0 MemSQL \u81ea\u79f0\u662f\u6700\u5feb\u7684\u5185\u5b58\u6570\u636e\u5e93\u3002\u76ee\u524d\u5df2\u53d1\u5e03\u4e862.5\u7248\u672c\u3002<\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\" class=\"blogpost-body\">\n<div>\n<p><strong>MemSQL\u00a0\u5177\u6709\u4ee5\u4e0b\u7279\u70b9<\/strong><\/p>\n<p>1 \u9ad8\u6548\u7684\u5e76\u884c\uff0c\u5c24\u5176\u662f\u5206\u5e03\u5f0f\u7684MemSQL.<\/p>\n<p>2 \u9ad8\u6548\u7684\u5e76\u53d1\uff0c\u91c7\u7528lock-free\u7684\u5185\u5b58\u6570\u636e\u7ed3\u6784skip list \u548chash.\u652f\u6301MVCC.<\/p>\n<p>3 \u67e5\u8be2\u6267\u884c\u8ba1\u5212\u7f16\u8bd1\u6210C++\u7684\u5f62\u5f0f\uff0c\u53ef\u4ee5\u9ad8\u6548\u6267\u884c\u5e76\u4e14\u53ef\u4ee5\u91cd\u7528<\/p>\n<p>4 \u652f\u6301\u6570\u636e\u7684\u5197\u4f59\u5b58\u50a8\uff0c\u63d0\u9ad8\u53ef\u7528\u6027<\/p>\n<p>5 \u652f\u6301\u91cd\u653e\u4e8b\u7269\u65e5\u5fd7\u7684\u590d\u5236<\/p>\n<p>6 \u652f\u6301JSON\u683c\u5f0f\u7684\u6570\u636e\u5904\u7406<\/p>\n<p>\u4e0b\u9762\u6765\u770b\u770bMemsql\u7684share-nothing\u5206\u5e03\u5f0f\u67b6\u6784<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2058\" src=\"https:\/\/damogame.cn:15443\/wordpress\/wp-content\/uploads\/2018\/10\/111943212808827.png\" alt=\"\" width=\"641\" height=\"251\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2058\" src=\"https:\/\/damogame.cn:15443\/wordpress\/wp-content\/uploads\/2018\/10\/111943212808827.png\" alt=\"\" width=\"641\" height=\"251\" \/><\/p>\n<\/div>\n<div>\n<div><strong>\u4e24\u5c42\u67b6\u6784<\/strong>\uff1a\u5206\u4e3aaggregator \u548c leaf<\/div>\n<div><\/div>\n<\/div>\n<div>\u00a0 \u00a0 \u00a0Aggregator \u5b58\u50a8\u5143\u6570\u636e\uff0c\u8d1f\u8d23\u5206\u53d1sql\u7ed9leaf,\u7136\u540e\u7efc\u5408leaf\u7684\u67e5\u8be2\u7ed3\u679c\u3002aggregator\u53ef\u4ee5\u6709\u591a\u4e2a\uff0c\u5176\u4e2d\u6709\u4e00\u4e2a\u4e3a\u4e3baggregator\u3002\u00a0\u4e3baggregator \u8fd8\u53ef\u4ee5\u6267\u884cDDL\u548c\u8d1f\u8d23Leaf\u7684auto-failover.\u5176\u5b83\u666e\u901aaggregator\u00a0\u5219\u4e0d\u884c\u3002\u5f53\u4e3baggregator\u00a0\u5931\u6548\uff0c\u53ef\u4ee5\u4ece\u5176\u5b83\u666e\u901aaggregator\u00a0\u9009\u62e9\u4e00\u4e2a\u901a\u8fc7sql\u547d\u4ee4\u8bbe\u7f6e\u4e3a\u4e3baggregator\u00a0\u3002<\/div>\n<div>\u00a0 \u00a0 \u00a0Leaf\u4e0a\u5b58\u50a8\u771f\u6b63\u7684\u6570\u636e\uff0c\u6570\u636e\u901a\u8fc7\u4e3b\u952ehash\u5b58\u50a8\u5230\u5404\u4e2aleaf\u8282\u70b9\uff0cleaf\u4e4b\u95f4\u7684\u6570\u636e\u5747\u5300\u5206\u5e03\u4e0d\u4f1a\u503e\u659c\u3002\u76ee\u524d\u8fd8\u4e0d\u652f\u6301\u8303\u56f4\u5206\u533a\u3002\u5728\u5efa\u5e93\u65f6\u6307\u5b9a\u5206\u533a\u6570\uff0c\u5206\u533a\u6570\u5e94\u8be5\u4e3aleaf\u8282\u70b9\u7684\u6574\u6570\u500d\uff0c\u4e00\u822c\u8bbe\u4e3a8\u500d\u3002\u6bcf\u4e2aleaf\u90fd\u662f\u4e00\u4e2a\u5206\u5e93\uff0c\u5206\u53d6\u6570\u636e\u5b58\u50a8\u5728\u5206\u5e93\u7684\u8868\u4e2d\u3002\u8868\u53ea\u6301\u4e8c\u7ea7\u7d22\u5f15\uff0c\u540c\u65f6\u652f\u6301\u4ee5\u4e3b\u952e\u4e3a\u524d\u7f00\u7684\u552f\u4e00\u7d22\u5f15\u3002<\/div>\n<div><\/div>\n<div><strong>\u4e24\u79cd\u8868\u7c7b\u578b<\/strong>\uff1a<\/div>\n<div>\u00a0 \u00a0 \u53c2\u7167\u8868\uff08reference table): \u6570\u636e\u5206\u5e03\u5728\u4e3baggregator\u548c\u6bcf\u4e2aleaf\u8282\u70b9\u3002\u6bcf\u4e2a\u8282\u70b9\u7684\u6570\u636e\u90fd\u662f\u5b8c\u6574\u7684\uff08\u6ca1\u6709\u5206\u533a\uff09\u3002\u53c2\u7167\u8868\u540c\u8fc7\u590d\u5236\u4ece\u4e3baggregator\u5411\u6bcf\u4e2aleaf\u8282\u70b9\u540c\u6b65\u6570\u636e\u3002\u53e6\u5916\u53c2\u7167\u8868\u7684\u5199\u53ea\u80fd\u5728\u4e3baggregator\u8fdb\u884c\u3002<\/div>\n<div>\u00a0 \u00a0 \u5206\u5e03\u8868 \uff08sharded table):\u6570\u636e\u901a\u8fc7hash\u5206\u7247\u5b58\u50a8\u5728\u6bcf\u4e2aleaf\u8282\u70b9\uff0c\u6bcf\u4e2aleaf\u8282\u70b9\u53ea\u6709\u90e8\u5206\u6570\u636e\u3002<\/div>\n<div><\/div>\n<div><strong>\u6570\u636e\u5197\u4f59<\/strong>\uff1a<\/div>\n<div>\u00a0 \u00a0 \u53ef\u7528\u7ec4\uff08availability group\uff09\uff0c\u6bcf\u4e2a\u7ec4\u662f\u4e00\u4e9bleaf\u7684\u96c6\u5408\u3002\u7ec4\u4e0e\u7ec4\u4e4b\u95f4\u662f\u5197\u4f59\u5b58\u50a8\u7684\u3002\u76ee\u524d\u6700\u591a\u652f\u6301\u4e24\u4e2a\u7ec4\u3002\u4ee5\u4e24\u4e2a\u7ec4\u4e3a\u4f8b\uff0c\u6bcf\u4e2a\u7ec4\u90fd\u5305\u542b\u5b8c\u6574\u6570\u636e\uff0c\u6bcf\u4e2a\u5206\u533a\u8868\u5728\u4e24\u4e2a\u7ec4\u90fd\u6709\u4e00\u5206copy.\u53ef\u4ee5\u57fa\u4e8e\u7535\u529b\u548c\u7f51\u7edc\u6761\u4ef6\u8fdb\u884c\u5206\u7ec4\u3002<\/div>\n<div><\/div>\n<div><strong>\u6269\u5c55\u6027<\/strong>\uff1a<\/div>\n<div>\u00a0 \u00a0 \u00a0\u652f\u6301\u52a8\u6001\u589e\u5220Leaf\u8282\u70b9\uff0c\u4f46\u9700\u8981\u6267\u884crebalance partitions\u547d\u4ee4\u6765\u91cd\u65b0\u5206\u5e03\u5206\u533a\u6570\u636e\u3002rebalance \u64cd\u4f5c\u90fd\u662f\u5728\u7ebf\u8fdb\u884c\u7684\uff0c\u5373\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u4e0d\u5f71\u54cd\u6570\u636e\u6b63\u5e38\u8bbf\u95ee\u3002rebalance\u64cd\u4f5c\u7684\u5355\u4f4d\u662f\u5e93\uff0c\u6700\u5c0f\u7c92\u5ea6\u662f partition.<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0\u4e0b\u9762\u662fleaf\u8282\u70b9\u72b6\u6001\u53d8\u5316\u56fe<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/developers.memsql.com\/docs\/latest\/_images\/leaf-states.png\" alt=\"\" width=\"792\" height=\"612\" \/><\/div>\n<div><\/div>\n<div>MemSQL\u517c\u5bb9mysql\u534f\u8bae\u3002\u652f\u6301mysql\u7684ODBC,JDBC\u53ca\u5176\u5b83\u8bed\u8a00\u63a5\u53e3\u3002<\/div>\n<div><\/div>\n<div><strong>\u4e00\u4e9b\u601d\u8003<\/strong>\uff1a<\/div>\n<div>\n<p>1 \u652f\u6301mysql \u534f\u8bae\uff0c\u4f7f\u7684memsql\u5b66\u4e60\u6210\u672c\u8f83\u4f4e\uff0c\u540c\u65f6mysql\u7684ODBC\uff0cJDBC\u53ef\u4ee5\u76f4\u63a5\u62ff\u6765\u4f7f\u7528\uff0c\u63d0\u9ad8\u4e86\u53ef\u7528\u6027\uff0c\u540c\u65f6\u4e5f\u51cf\u5c11\u4e86MemSQL\u81ea\u8eab\u7684\u5f00\u53d1\u6210\u672c\u3002<br \/>\n2 redundancy_level\u76ee\u524d\u6700\u9ad8\u652f\u63012.\u96c6\u7fa4\u4e2d\u51fa\u73b0\u4e24\u4e2aLeaf\u8282\u70b9\u540c\u65f6\u6545\u969c\u7684\u53ef\u80fd\u6027\u4e0d\u662f\u5f88\u4f4e\u3002\u540e\u9700\u5e94\u8be5\u652f\u63013\u53ca\u4ee5\u4e0a\u7684level;\u5728redundancy_level\u4e3a2\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u4e00\u4e2aleaf\u8282\u70b9\u51fa\u73b0\u6545\u969c\uff0c\u5bf9\u5e94\u7684\u5197\u4f59\u8282\u70b9\u8d1f\u8f7d\u4e00\u822c\u4f1a\u63d0\u5347\u4e00\u500d\uff0c\u8d1f\u8f7d\u4e0d\u5747\u8861\uff0c\u5f88\u53ef\u80fd\u9020\u6210\u65b0\u7684\u6545\u969c\u3002<br \/>\n3 availability group\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u5206\u7ec4\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06\u4e0d\u540c\u7684\u7ec4\u653e\u5728\u4e0d\u540c\u7684\u673a\u623f\uff0c\u63d0\u9ad8\u53ef\u7528\u6027\u3002<br \/>\n4 \u5bf9\u4e8ereblance table \u64cd\u4f5c\uff0c\u53ef\u4ee5\u505a\u5230\u5728\u7ebf\u7684\u65b9\u5f0f\u8fdb\u884c\uff0c\u611f\u89c9\u96be\u5ea6\u6bd4\u8f83\u5927\uff0c\u4f46\u6587\u6863\u4e2d\u6ca1\u6709\u770b\u5230\u66f4\u8be6\u7ec6\u7684\u5b9e\u73b0\u8bf4\u660e\u3002<\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<p><a href=\"http:\/\/www.memsql.com\/\">http:\/\/www.memsql.com<\/a><\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 MemSQL \u81ea\u79f0\u662f\u6700\u5feb\u7684\u5185\u5b58\u6570\u636e\u5e93<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[119],"class_list":["post-2057","post","type-post","status-publish","format-standard","hentry","tag-03-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/2057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=2057"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/2057\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=2057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=2057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=2057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}