{"id":21526,"date":"2024-01-02T10:51:23","date_gmt":"2024-01-02T10:51:23","guid":{"rendered":"https:\/\/server.hk\/blog\/21526\/"},"modified":"2024-11-14T10:31:16","modified_gmt":"2024-11-14T02:31:16","slug":"mongodb-glossary-auto-sharding","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21526\/","title":{"rendered":"MongoDB \u8a5e\u5f59\u8868 &#8211; \u81ea\u52d5\u5206\u7247"},"content":{"rendered":"<h1 id=\"mongodb-glossary-auto-sharding-rCxvPRrekA\">MongoDB \u8a5e\u5f59\u8868 &#8211; \u81ea\u52d5\u5206\u7247<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u7684\u4e16\u754c\u4e2d\uff0c\u5206\u7247\u662f\u4e00\u7a2e\u7528\u65bc\u5c07\u6578\u64da\u5206\u4f48\u5230\u591a\u500b\u4f3a\u670d\u5668\u4e0a\u7684\u6280\u8853\u3002\u5b83\u6709\u52a9\u65bc\u63d0\u5347\u6578\u64da\u5eab\u7684\u6027\u80fd\u3001\u64f4\u5c55\u6027\u548c\u53ef\u7528\u6027\u3002MongoDB \u4f5c\u70ba\u4e00\u500b\u53d7\u6b61\u8fce\u7684 NoSQL \u6578\u64da\u5eab\uff0c\u4e5f\u901a\u904e\u5176\u540d\u70ba\u81ea\u52d5\u5206\u7247\u7684\u529f\u80fd\u4f86\u652f\u6301\u5206\u7247\u3002<\/p>\n<h2 id=\"what-is-sharding-rCxvPRrekA\">\u4ec0\u9ebc\u662f\u5206\u7247\uff1f<\/h2>\n<p>\u5206\u7247\u662f\u5c07\u6578\u64da\u6c34\u5e73\u5730\u5206\u5340\u5230\u591a\u500b\u4f3a\u670d\u5668\u6216\u5206\u7247\u4e0a\u7684\u904e\u7a0b\u3002\u6bcf\u500b\u5206\u7247\u5305\u542b\u6578\u64da\u7684\u4e00\u90e8\u5206\uff0c\u6240\u6709\u5206\u7247\u96c6\u9ad4\u69cb\u6210\u4e00\u500b\u5206\u4f48\u5f0f\u6578\u64da\u5eab\u3002\u901a\u904e\u5206\u4f48\u6578\u64da\uff0c\u5206\u7247\u5141\u8a31\u5e73\u884c\u8655\u7406\u4e26\u6709\u6548\u5730\u5229\u7528\u8cc7\u6e90\u3002<\/p>\n<p>\u5206\u7247\u5728\u8655\u7406\u7121\u6cd5\u88dd\u5165\u55ae\u53f0\u4f3a\u670d\u5668\u7684\u5927\u578b\u6578\u64da\u96c6\u6216\u9700\u8981\u9ad8\u8b80\u5beb\u541e\u5410\u91cf\u6642\u5c24\u5176\u6709\u7528\u3002\u5b83\u5141\u8a31\u6578\u64da\u5eab\u901a\u904e\u5411\u53e2\u96c6\u4e2d\u6dfb\u52a0\u66f4\u591a\u4f3a\u670d\u5668\u4f86\u6c34\u5e73\u64f4\u5c55\uff0c\u96a8\u7740\u6578\u64da\u7684\u589e\u9577\u800c\u64f4\u5c55\u3002<\/p>\n<h2 id=\"how-does-auto-sharding-work-in-mongodb-rCxvPRrekA\">MongoDB \u7684\u81ea\u52d5\u5206\u7247\u5982\u4f55\u904b\u4f5c\uff1f<\/h2>\n<p>MongoDB \u7684\u81ea\u52d5\u5206\u7247\u529f\u80fd\u7c21\u5316\u4e86\u5206\u7247\u7684\u904e\u7a0b\uff0c\u901a\u904e\u81ea\u52d5\u5c07\u6578\u64da\u5206\u4f48\u5230\u4e0d\u540c\u7684\u5206\u7247\u4e0a\u4f86\u9032\u884c\u7ba1\u7406\u3002\u5b83\u6839\u64da\u5206\u7247\u9375\uff08\u5373\u9078\u5b9a\u7684\u5b57\u6bb5\u6216\u5b57\u6bb5\u7d44\u5408\uff09\u4f86\u7ba1\u7406\u6578\u64da\u7684\u653e\u7f6e\u548c\u79fb\u52d5\uff0c\u6c7a\u5b9a\u6578\u64da\u61c9\u5b58\u653e\u5728\u54ea\u500b\u5206\u7247\u4e0a\u3002<\/p>\n<p>\u7576\u65b0\u7684\u6587\u6a94\u63d2\u5165\u5230\u5206\u7247\u96c6\u5408\u4e2d\u6642\uff0cMongoDB \u6703\u5c0d\u5206\u7247\u9375\u9032\u884c\u96dc\u6e4a\uff0c\u4ee5\u78ba\u5b9a\u76ee\u6a19\u5206\u7247\u3002\u5206\u7247\u9375\u7684\u503c\u7528\u65bc\u8a08\u7b97\u4e00\u500b\u96dc\u6e4a\uff0c\u7136\u5f8c\u6620\u5c04\u5230\u7279\u5b9a\u7684\u5206\u7247\u3002\u9019\u78ba\u4fdd\u4e86\u64c1\u6709\u76f8\u540c\u5206\u7247\u9375\u7684\u6587\u6a94\u5b58\u5132\u5728\u540c\u4e00\u500b\u5206\u7247\u4e0a\u3002<\/p>\n<p>\u81ea\u52d5\u5206\u7247\u9084\u80fd\u5920\u52d5\u614b\u91cd\u65b0\u5e73\u8861\u5206\u7247\u4e0a\u7684\u6578\u64da\u3002\u96a8\u7740\u6578\u64da\u5206\u4f48\u96a8\u6642\u9593\u8b8a\u5316\uff0cMongoDB \u81ea\u52d5\u5728\u5206\u7247\u4e4b\u9593\u9077\u79fb\u6578\u64da\u584a\uff0c\u4ee5\u4fdd\u6301\u5747\u52fb\u7684\u5206\u4f48\u3002\u9019\u4e00\u904e\u7a0b\u5c0d\u61c9\u7528\u7a0b\u5e8f\u662f\u900f\u660e\u7684\uff0c\u4e26\u4e0d\u9700\u8981\u624b\u52d5\u5e72\u9810\u3002<\/p>\n<h2 id=\"advantages-of-auto-sharding-in-mongodb-rCxvPRrekA\">MongoDB \u81ea\u52d5\u5206\u7247\u7684\u512a\u9ede<\/h2>\n<p>1. <strong>\u53ef\u64f4\u5c55\u6027\uff1a<\/strong> \u81ea\u52d5\u5206\u7247\u5141\u8a31 MongoDB \u901a\u904e\u5411\u53e2\u96c6\u4e2d\u6dfb\u52a0\u66f4\u591a\u5206\u7247\u4f86\u6c34\u5e73\u64f4\u5c55\u3002\u9019\u4f7f\u5f97\u6578\u64da\u5eab\u80fd\u5920\u8655\u7406\u4e0d\u65b7\u589e\u9577\u7684\u6578\u64da\u91cf\u548c\u9ad8\u6d41\u91cf\u8ca0\u8f09\u3002<\/p>\n<p>2. <strong>\u6027\u80fd\uff1a<\/strong> \u901a\u904e\u5c07\u6578\u64da\u5206\u4f48\u5230\u591a\u500b\u5206\u7247\uff0c\u81ea\u52d5\u5206\u7247\u5141\u8a31\u67e5\u8a62\u7684\u5e73\u884c\u8655\u7406\uff0c\u5f9e\u800c\u63d0\u9ad8\u8b80\u5beb\u6027\u80fd\u3002<\/p>\n<p>3. <strong>\u9ad8\u53ef\u7528\u6027\uff1a<\/strong> MongoDB \u7684\u81ea\u52d5\u5206\u7247\u63d0\u4f9b\u5167\u5efa\u7684\u5bb9\u932f\u529f\u80fd\u3002\u5982\u679c\u67d0\u500b\u5206\u7247\u6545\u969c\uff0c\u6578\u64da\u5c07\u81ea\u52d5\u91cd\u65b0\u5206\u4f48\u5230\u5269\u9918\u7684\u5206\u7247\uff0c\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u9023\u7e8c\u53ef\u7528\u6027\u3002<\/p>\n<p>4. <strong>\u9748\u6d3b\u6027\uff1a<\/strong> \u81ea\u52d5\u5206\u7247\u5141\u8a31\u52d5\u614b\u6dfb\u52a0\u548c\u79fb\u9664\u5206\u7247\uff0c\u800c\u4e0d\u6703\u5c0d\u61c9\u7528\u7a0b\u5e8f\u9020\u6210\u5f71\u97ff\u3002\u9019\u7a2e\u9748\u6d3b\u6027\u4f7f\u5f97\u6578\u64da\u5eab\u66f4\u5bb9\u6613\u6839\u64da\u8b8a\u5316\u7684\u9700\u6c42\u9032\u884c\u64f4\u5c55\u3002<\/p>\n<h2 id=\"conclusion-rCxvPRrekA\">\u7d50\u8ad6<\/h2>\n<p>\u81ea\u52d5\u5206\u7247\u662f MongoDB \u7684\u4e00\u9805\u5f37\u5927\u529f\u80fd\uff0c\u7c21\u5316\u4e86\u5c07\u6578\u64da\u5206\u4f48\u5230\u591a\u500b\u4f3a\u670d\u5668\u7684\u904e\u7a0b\u3002\u5b83\u5be6\u73fe\u4e86\u6c34\u5e73\u64f4\u5c55\u3001\u63d0\u9ad8\u4e86\u6027\u80fd\uff0c\u4e26\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u9ad8\u53ef\u7528\u6027\u3002\u901a\u904e\u81ea\u52d5\u5316\u6578\u64da\u7684\u5206\u4f48\u548c\u9077\u79fb\uff0cMongoDB \u7684\u81ea\u52d5\u5206\u7247\u70ba\u7ba1\u7406\u5927\u898f\u6a21\u6578\u64da\u5eab\u7684\u958b\u767c\u8005\u548c\u7ba1\u7406\u54e1\u63d0\u4f9b\u4e86\u7121\u7e2b\u7684\u4f7f\u7528\u9ad4\u9a57\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 VPS \u4e3b\u6a5f\u89e3\u6c7a\u65b9\u6848\u4f86\u904b\u884c\u60a8\u7684 MongoDB \u90e8\u7f72\uff0c\u8003\u616e\u9078\u64c7 <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u901a\u904e\u4ed6\u5011\u9802\u5c16\u7684 VPS \u89e3\u6c7a\u65b9\u6848\uff0c\u60a8\u53ef\u4ee5\u78ba\u4fdd\u60a8\u7684 MongoDB \u61c9\u7528\u7a0b\u5e8f\u7372\u5f97\u6700\u4f73\u6027\u80fd\u548c\u64f4\u5c55\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB \u8a5e\u5f59\u8868 &#038;#82&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-21526","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=21526"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21526\/revisions"}],"predecessor-version":[{"id":23936,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21526\/revisions\/23936"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}