{"id":4495,"date":"2019-10-04T18:04:01","date_gmt":"2019-10-04T10:04:01","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=4495"},"modified":"2019-10-04T18:05:19","modified_gmt":"2019-10-04T10:05:19","slug":"%e5%86%8d%e4%b9%9f%e4%b8%8d%e6%80%95%e9%9d%a2%e8%af%95%e9%81%87%e5%88%b0-redis-%e5%92%8c-mysql-%e8%af%bb%e5%86%99%e4%b8%80%e8%87%b4%e6%80%a7%e9%97%ae%e9%a2%98%e4%ba%86","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4495","title":{"rendered":"\u518d\u4e5f\u4e0d\u6015\u9762\u8bd5\u9047\u5230 Redis \u548c MySQL \u8bfb\u5199\u4e00\u81f4\u6027\u95ee\u9898\u4e86"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5173\u4e8e CAP \u7406\u8bba\uff0c\u6211\u524d\u9762\u5df2\u7ecf\u5199\u8fc7\u76f8\u5173\u6587\u7ae0\u4e86\uff0c\u6bd4\u5982\uff0c\u8fd9\u4e00\u7bc7\u300a<a rel=\"noreferrer noopener\" aria-label=\"\uff08\u5728\u65b0\u7a97\u53e3\u6253\u5f00\uff09\" href=\"https:\/\/www.xttblog.com\/?p=2925\" target=\"_blank\">\u8be6\u89e3 CAP \u5b9a\u7406 Consistency\uff08\u4e00\u81f4\u6027\uff09\u3001 Availability\uff08\u53ef\u7528\u6027\uff09\u3001Partition tolerance\uff08\u5206\u533a\u5bb9\u9519\u6027\uff09<\/a>\u300b\uff0c\u597d\u8bc4\u5982\u6f6e\u3002<\/p>\n\n\n\n<h2>CAP \u7406\u8bba<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>C \u4e00\u81f4\u6027\uff1a\u6570\u636e\u5728\u5206\u5e03\u5f0f\u73af\u5883\u4e0b\u7684\u591a\u4e2a\u526f\u672c\u4e4b\u95f4\u80fd\u5426\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u8fd9\u91cc\u7684\u4e00\u81f4\u6027\u66f4\u591a\u662f\u6307\u5f3a\u4e00\u81f4\u6027\uff1b<\/li><li>A \u53ef\u7528\u6027\uff1a\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e00\u76f4\u5904\u4e8e\u53ef\u7528\u72b6\u6001\uff0c\u5bf9\u4e8e\u8bf7\u6c42\u603b\u662f\u80fd\u5728\u6709\u9650\u7684\u65f6\u95f4 \u5185\u8fd4\u56de\u7ed3\u679c\u81f4\u6027\uff1b<\/li><li>P \u5206\u533a\u5bb9\u9519\u6027\uff1a\u9664\u975e\u6574\u4e2a\u7f51\u7edc\u6545\u969c\uff0c\u5206\u5e03\u5f0f\u7cfb\u7edf\u5728\u4efb\u4f55\u7f51\u7edc\u6216\u8005\u5355\u70b9\u6545\u969c\u65f6\uff0c\u4ecd\u80fd\u5bf9\u5916\u63d0\u4f9b\u6ee1\u8db3\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\u7684\u670d\u52a1\uff1b<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">CAP\u7406\u8bba\uff1a\u4e00\u4e2a\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e0d\u53ef\u80fd\u540c\u65f6\u6ee1\u8db3\u4e00\u81f4\u6027\u3001\u53ef\u7528\u6027\u548c\u5206\u533a\u5bb9\u9519\u6027\u8fd9\u4e09\u4e2a \u57fa\u672c\u9700\u6c42\uff0c\u6700\u591a\u53ea\u80fd\u540c\u65f6\u6ee1\u8db3\u5176\u4e2d\u7684\u4e24\u9879\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx2.sinaimg.cn\/mw690\/8fa5dcfcly1g7mbgw1wjej20pz0df0v5.jpg\" alt=\"\" \/><figcaption>\u9762\u8bd5\u4e2d\u7684 CAP \u7406\u8bba<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u67b6\u6784\u5e08\u7684\u7cbe\u529b\u5f80\u5f80\u5c31\u82b1\u5728\u600e\u4e48\u6837\u6839\u636e\u4e1a\u52a1\u573a\u666f\u5728A\u548cC\u76f4\u63a5\u5bfb\u6c42\u5e73\u8861\u3002<\/p>\n\n\n\n<h2>BASE \u7406\u8bba<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Basically Avaliable \u57fa\u672c\u53ef\u7528\uff1a\u5f53\u5206\u5e03\u5f0f\u7cfb\u7edf\u51fa\u73b0\u4e0d\u53ef\u9884\u89c1\u7684\u6545\u969c\u65f6\uff0c\u5141\u8bb8\u635f\u5931\u90e8\u5206\u53ef\u7528\u6027\uff0c\u4fdd\u969c\u7cfb\u7edf\u7684\u201c\u57fa\u672c\u53ef\u7528\u201d\uff1b\u4f53\u73b0\u5728\u201c\u65f6\u95f4\u4e0a\u7684\u635f\u5931\u201d\u548c\u201c\u529f\u80fd\u4e0a\u7684\u635f\u5931\u201d\uff1b\u4f8b\u5982\uff1a\u90e8\u5206\u7528\u6237\u53cc\u5341\u4e00\u9ad8\u5cf0\u671f\u6dd8\u5b9d\u9875\u9762\u5361\u987f\u6216\u964d\u7ea7\u5904\u7406\uff1b<\/li><li> Soft state \u8f6f\u72b6\u6001\uff1a\u5141\u8bb8\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u5b58\u5728\u4e2d\u95f4\u72b6\u6001\uff0c\u65e2\u7cfb\u7edf\u7684\u4e0d\u540c\u8282\u70b9\u7684\u6570\u636e\u526f\u672c\u4e4b\u95f4\u7684\u6570\u636e\u540c\u6b65\u8fc7\u7a0b\u5b58\u5728\u5ef6\u65f6\uff0c\u5e76\u8ba4\u4e3a\u8fd9\u79cd\u5ef6\u65f6\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u53ef\u7528\u6027\uff1b\u4f8b\u5982\uff1a12306\u7f51\u7ad9\u5356\u706b\u8f66\u7968\uff0c\u8bf7\u6c42\u4f1a\u8fdb\u5165\u6392\u961f\u961f\u5217\uff1b<\/li><li> Eventually consistent \u6700\u7ec8\u4e00\u81f4\u6027\uff1a\u6240\u6709\u7684\u6570\u636e\u5728\u7ecf\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684\u6570\u636e\u540c\u6b65\u540e\uff0c\u6700\u7ec8\u80fd\u591f\u8fbe\u5230\u4e00\u4e2a\u4e00\u81f4\u7684\u72b6\u6001\uff1b\u4f8b\u5982\uff1a\u7406\u8d22\u4ea7\u54c1\u9996\u9875\u5145\u503c\u603b\u91d1\u989d \u77ed\u65f6\u4e0d\u4e00\u81f4\uff1b<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">BASE \u7406\u8bba\uff1a\u5373\u4f7f\u65e0\u6cd5\u505a\u5230\u5f3a\u4e00\u81f4\u6027\uff0c\u4f46\u5206\u5e03\u5f0f\u7cfb\u7edf\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u4e1a\u52a1\u7279\u70b9\uff0c\u91c7\u7528\u9002\u5f53\u7684\u65b9\u5f0f\u6765\u4f7f\u7cfb\u7edf\u8fbe\u5230\u6700\u7ec8\u7684\u4e00\u81f4\u6027\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9762\u8bd5\u4e2d\u7ecf\u5e38\u4f1a\u9047\u5230\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u95ee\u9898\uff0c\u6700\u5e38\u89c1\u7684\u662f Redis \u548c MySQL \u7684\u4e00\u81f4\u6027\u95ee\u9898\u3002\u56de\u7b54\u8fd9\u7c7b\u95ee\u9898\uff0c\u4e0d\u7ba1\u4f60\u91c7\u7528\u54ea\u79cd\u7f13\u5b58\u6a21\u5f0f\uff0c\u90fd\u6709\u6f0f\u6d1e\uff0c\u90fd\u4e0d\u5b8c\u7f8e\u3002\u56e0\u6b64\uff0c\u6700\u597d\u7684\u505a\u6cd5\u5c31\u662f\u5229\u7528\u4e1a\u52a1\u7684\u7279\u70b9\uff0c\u505a\u5230\u6700\u7ec8\u7684\u4e00\u81f4\u6027\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\uff0c\u90fd\u5c5e\u4e8e\u5206\u5e03\u5f0f\u7cfb\u7edf\u534f\u8c03\u201c\u65b9\u6cd5\u8bba\u201d\uff0cCAP \u7406\u8bba\u548c BASE \u7406\u8bba\u662f\u6700\u5e38\u89c1\u548c\u9762\u8bd5\u4e2d\u6700\u5e38\u88ab\u95ee\u5230\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4495\">\u518d\u4e5f\u4e0d\u6015\u9762\u8bd5\u9047\u5230 Redis \u548c MySQL \u8bfb\u5199\u4e00\u81f4\u6027\u95ee\u9898\u4e86<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e CAP \u7406\u8bba\uff0c\u6211\u524d\u9762\u5df2\u7ecf\u5199\u8fc7\u76f8\u5173\u6587\u7ae0\u4e86\uff0c\u6bd4\u5982\uff0c\u8fd9\u4e00\u7bc7\u300a\u8be6\u89e3 CAP \u5b9a\u7406 Consistency\uff08\u4e00\u81f4\u6027 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[2014,1842,669,216,2015],"class_list":["post-4495","post","type-post","status-publish","format-standard","hentry","category-java","category-yyzt","tag-base","tag-cap","tag-redis","tag-216","tag-2015"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4495"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4495\/revisions"}],"predecessor-version":[{"id":4502,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4495\/revisions\/4502"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}