{"id":2925,"date":"2018-07-16T16:29:40","date_gmt":"2018-07-16T08:29:40","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2925"},"modified":"2018-07-16T16:29:40","modified_gmt":"2018-07-16T08:29:40","slug":"%e8%af%a6%e8%a7%a3-cap-%e5%ae%9a%e7%90%86-consistency%ef%bc%88%e4%b8%80%e8%87%b4%e6%80%a7%ef%bc%89%e3%80%81-availability%ef%bc%88%e5%8f%af%e7%94%a8%e6%80%a7%ef%bc%89%e3%80%81partition-tolerance","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2925","title":{"rendered":"\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"},"content":{"rendered":"<p>\n\tCAP\u539f\u5219\u53c8\u79f0CAP\u5b9a\u7406\uff0c\u6307\u7684\u662f\u5728\u4e00\u4e2a\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\uff0cConsistency\uff08\u4e00\u81f4\u6027\uff09\u3001 Availability\uff08\u53ef\u7528\u6027\uff09\u3001Partition tolerance\uff08\u5206\u533a\u5bb9\u9519\u6027\uff09\uff0c\u4e09\u8005\u4e0d\u53ef\u5f97\u517c\u3002\n<\/p>\n<p>\n\t\u5206\u5e03\u5f0f\u7cfb\u7edf\uff08distributed system\uff09\u6b63\u53d8\u5f97\u8d8a\u6765\u8d8a\u91cd\u8981\uff0c\u5927\u578b\u7f51\u7ad9\u51e0\u4e4e\u90fd\u662f\u5206\u5e03\u5f0f\u7684\u3002\n<\/p>\n<p>\n\t\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u6700\u5927\u96be\u70b9\uff0c\u5c31\u662f\u5404\u4e2a\u8282\u70b9\u7684\u72b6\u6001\u5982\u4f55\u540c\u6b65\u3002CAP \u5b9a\u7406\u662f\u8fd9\u65b9\u9762\u7684\u57fa\u672c\u5b9a\u7406\uff0c\u4e5f\u662f\u7406\u89e3\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u8d77\u70b9\u3002\n<\/p>\n<p>\n\t\u672c\u6587\u4ecb\u7ecd\u8be5\u5b9a\u7406\u3002\u5b83\u5176\u5b9e\u5f88\u597d\u61c2\uff0c\u800c\u4e14\u662f\u663e\u800c\u6613\u89c1\u7684\u3002\u4e0b\u9762\u7684\u5185\u5bb9\u4e3b\u8981\u53c2\u8003\u4e86 Michael Whittaker \u7684<a href=\"https:\/\/mwhittaker.github.io\/blog\/an_illustrated_proof_of_the_cap_theorem\/\" target=\"_blank\">\u6587\u7ae0<\/a>\u3002\n<\/p>\n<h2>\n\t\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u4e09\u4e2a\u6307\u6807<br \/>\n<\/h2>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071607.jpg\" title=\"\" \/>\n<\/p>\n<p>\n\t1998\u5e74\uff0c\u52a0\u5dde\u5927\u5b66\u7684\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6 Eric Brewer \u63d0\u51fa\uff0c\u5206\u5e03\u5f0f\u7cfb\u7edf\u6709\u4e09\u4e2a\u6307\u6807\u3002\n<\/p>\n<blockquote>\n<ul>\n<li>\n\t\t\tConsistency\n\t\t<\/li>\n<li>\n\t\t\tAvailability\n\t\t<\/li>\n<li>\n\t\t\tPartition tolerance\n\t\t<\/li>\n<\/ul>\n<\/blockquote>\n<p>\n\t\u5b83\u4eec\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u5206\u522b\u662f C\u3001A\u3001P\u3002\n<\/p>\n<p>\n\tEric Brewer \u8bf4\uff0c\u8fd9\u4e09\u4e2a\u6307\u6807\u4e0d\u53ef\u80fd\u540c\u65f6\u505a\u5230\u3002\u8fd9\u4e2a\u7ed3\u8bba\u5c31\u53eb\u505a CAP \u5b9a\u7406\u3002\n<\/p>\n<h2>\n\tPartition tolerance<br \/>\n<\/h2>\n<p>\n\t\u5148\u770b Partition tolerance\uff0c\u4e2d\u6587\u53eb\u505a&quot;\u5206\u533a\u5bb9\u9519&quot;\u3002\n<\/p>\n<p>\n\t\u5927\u591a\u6570\u5206\u5e03\u5f0f\u7cfb\u7edf\u90fd\u5206\u5e03\u5728\u591a\u4e2a\u5b50\u7f51\u7edc\u3002\u6bcf\u4e2a\u5b50\u7f51\u7edc\u5c31\u53eb\u505a\u4e00\u4e2a\u533a\uff08partition\uff09\u3002\u5206\u533a\u5bb9\u9519\u7684\u610f\u601d\u662f\uff0c\u533a\u95f4\u901a\u4fe1\u53ef\u80fd\u5931\u8d25\u3002\u6bd4\u5982\uff0c\u4e00\u53f0\u670d\u52a1\u5668\u653e\u5728\u4e2d\u56fd\uff0c\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u653e\u5728\u7f8e\u56fd\uff0c\u8fd9\u5c31\u662f\u4e24\u4e2a\u533a\uff0c\u5b83\u4eec\u4e4b\u95f4\u53ef\u80fd\u65e0\u6cd5\u901a\u4fe1\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071601.png\" title=\"\" \/>\n<\/p>\n<p>\n\t\u4e0a\u56fe\u4e2d\uff0cG1 \u548c G2 \u662f\u4e24\u53f0\u8de8\u533a\u7684\u670d\u52a1\u5668\u3002G1 \u5411 G2 \u53d1\u9001\u4e00\u6761\u6d88\u606f\uff0cG2 \u53ef\u80fd\u65e0\u6cd5\u6536\u5230\u3002\u7cfb\u7edf\u8bbe\u8ba1\u7684\u65f6\u5019\uff0c\u5fc5\u987b\u8003\u8651\u5230\u8fd9\u79cd\u60c5\u51b5\u3002\n<\/p>\n<p>\n\t\u4e00\u822c\u6765\u8bf4\uff0c\u5206\u533a\u5bb9\u9519\u65e0\u6cd5\u907f\u514d\uff0c\u56e0\u6b64\u53ef\u4ee5\u8ba4\u4e3a CAP \u7684 P \u603b\u662f\u6210\u7acb\u3002CAP \u5b9a\u7406\u544a\u8bc9\u6211\u4eec\uff0c\u5269\u4e0b\u7684 C \u548c A \u65e0\u6cd5\u540c\u65f6\u505a\u5230\u3002\n<\/p>\n<h2>\n\tConsistency<br \/>\n<\/h2>\n<p>\n\tConsistency \u4e2d\u6587\u53eb\u505a&quot;\u4e00\u81f4\u6027&quot;\u3002\u610f\u601d\u662f\uff0c\u5199\u64cd\u4f5c\u4e4b\u540e\u7684\u8bfb\u64cd\u4f5c\uff0c\u5fc5\u987b\u8fd4\u56de\u8be5\u503c\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u67d0\u6761\u8bb0\u5f55\u662f v0\uff0c\u7528\u6237\u5411 G1 \u53d1\u8d77\u4e00\u4e2a\u5199\u64cd\u4f5c\uff0c\u5c06\u5176\u6539\u4e3a v1\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071602.png\" title=\"\" \/>\n<\/p>\n<p>\n\t\u63a5\u4e0b\u6765\uff0c\u7528\u6237\u7684\u8bfb\u64cd\u4f5c\u5c31\u4f1a\u5f97\u5230 v1\u3002\u8fd9\u5c31\u53eb\u4e00\u81f4\u6027\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071603.png\" title=\"\" \/>\n<\/p>\n<p>\n\t\u95ee\u9898\u662f\uff0c\u7528\u6237\u6709\u53ef\u80fd\u5411 G2 \u53d1\u8d77\u8bfb\u64cd\u4f5c\uff0c\u7531\u4e8e G2 \u7684\u503c\u6ca1\u6709\u53d1\u751f\u53d8\u5316\uff0c\u56e0\u6b64\u8fd4\u56de\u7684\u662f v0\u3002G1 \u548c G2 \u8bfb\u64cd\u4f5c\u7684\u7ed3\u679c\u4e0d\u4e00\u81f4\uff0c\u8fd9\u5c31\u4e0d\u6ee1\u8db3\u4e00\u81f4\u6027\u4e86\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071604.png\" title=\"\" \/>\n<\/p>\n<p>\n\t\u4e3a\u4e86\u8ba9 G2 \u4e5f\u80fd\u53d8\u4e3a v1\uff0c\u5c31\u8981\u5728 G1 \u5199\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u8ba9 G1 \u5411 G2 \u53d1\u9001\u4e00\u6761\u6d88\u606f\uff0c\u8981\u6c42 G2 \u4e5f\u6539\u6210 v1\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071605.png\" title=\"\" \/>\n<\/p>\n<p>\n\t\u8fd9\u6837\u7684\u8bdd\uff0c\u7528\u6237\u5411 G2 \u53d1\u8d77\u8bfb\u64cd\u4f5c\uff0c\u4e5f\u80fd\u5f97\u5230 v1\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wangbase.com\/blogimg\/asset\/201807\/bg2018071606.png\" title=\"\" \/>\n<\/p>\n<h2>\n\tAvailability<br \/>\n<\/h2>\n<p>\n\tAvailability \u4e2d\u6587\u53eb\u505a&quot;\u53ef\u7528\u6027&quot;\uff0c\u610f\u601d\u662f\u53ea\u8981\u6536\u5230\u7528\u6237\u7684\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u5c31\u5fc5\u987b\u7ed9\u51fa\u56de\u5e94\u3002\n<\/p>\n<p>\n\t\u7528\u6237\u53ef\u4ee5\u9009\u62e9\u5411 G1 \u6216 G2 \u53d1\u8d77\u8bfb\u64cd\u4f5c\u3002\u4e0d\u7ba1\u662f\u54ea\u53f0\u670d\u52a1\u5668\uff0c\u53ea\u8981\u6536\u5230\u8bf7\u6c42\uff0c\u5c31\u5fc5\u987b\u544a\u8bc9\u7528\u6237\uff0c\u5230\u5e95\u662f v0 \u8fd8\u662f v1\uff0c\u5426\u5219\u5c31\u4e0d\u6ee1\u8db3\u53ef\u7528\u6027\u3002\n<\/p>\n<h2>\n\tConsistency \u548c Availability \u7684\u77db\u76fe<br \/>\n<\/h2>\n<p>\n\t\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u53ef\u80fd\u540c\u65f6\u6210\u7acb\uff1f\u7b54\u6848\u5f88\u7b80\u5355\uff0c\u56e0\u4e3a\u53ef\u80fd\u901a\u4fe1\u5931\u8d25\uff08\u5373\u51fa\u73b0\u5206\u533a\u5bb9\u9519\uff09\u3002\n<\/p>\n<p>\n\t\u5982\u679c\u4fdd\u8bc1 G2 \u7684\u4e00\u81f4\u6027\uff0c\u90a3\u4e48 G1 \u5fc5\u987b\u5728\u5199\u64cd\u4f5c\u65f6\uff0c\u9501\u5b9a G2 \u7684\u8bfb\u64cd\u4f5c\u548c\u5199\u64cd\u4f5c\u3002\u53ea\u6709\u6570\u636e\u540c\u6b65\u540e\uff0c\u624d\u80fd\u91cd\u65b0\u5f00\u653e\u8bfb\u5199\u3002\u9501\u5b9a\u671f\u95f4\uff0cG2 \u4e0d\u80fd\u8bfb\u5199\uff0c\u6ca1\u6709\u53ef\u7528\u6027\u4e0d\u3002\n<\/p>\n<p>\n\t\u5982\u679c\u4fdd\u8bc1 G2 \u7684\u53ef\u7528\u6027\uff0c\u90a3\u4e48\u52bf\u5fc5\u4e0d\u80fd\u9501\u5b9a G2\uff0c\u6240\u4ee5\u4e00\u81f4\u6027\u4e0d\u6210\u7acb\u3002\n<\/p>\n<p>\n\t\u7efc\u4e0a\u6240\u8ff0\uff0cG2 \u65e0\u6cd5\u540c\u65f6\u505a\u5230\u4e00\u81f4\u6027\u548c\u53ef\u7528\u6027\u3002\u7cfb\u7edf\u8bbe\u8ba1\u65f6\u53ea\u80fd\u9009\u62e9\u4e00\u4e2a\u76ee\u6807\u3002\u5982\u679c\u8ffd\u6c42\u4e00\u81f4\u6027\uff0c\u90a3\u4e48\u65e0\u6cd5\u4fdd\u8bc1\u6240\u6709\u8282\u70b9\u7684\u53ef\u7528\u6027\uff1b\u5982\u679c\u8ffd\u6c42\u6240\u6709\u8282\u70b9\u7684\u53ef\u7528\u6027\uff0c\u90a3\u5c31\u6ca1\u6cd5\u505a\u5230\u4e00\u81f4\u6027\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=2925\">\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><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>CAP\u539f\u5219\u53c8\u79f0CAP\u5b9a\u7406\uff0c\u6307\u7684\u662f\u5728\u4e00\u4e2a\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\uff0cConsistency\uff08\u4e00\u81f4\u6027\uff09\u3001 Availabilit [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[565,762,733,502,505],"class_list":["post-2925","post","type-post","status-publish","format-standard","hentry","category-java","category-yyzt","tag-java-","tag-762","tag-733","tag-502","tag-505"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2925","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=2925"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2925\/revisions"}],"predecessor-version":[{"id":2926,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2925\/revisions\/2926"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}