{"id":29998,"date":"2023-08-27T23:40:58","date_gmt":"2023-12-08T02:59:42","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/"},"modified":"2025-08-12T16:58:56","modified_gmt":"2025-08-12T08:58:56","slug":"mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/","title":{"rendered":"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83"},"content":{"rendered":"<h2>0. \u76ee\u5f55<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u9996\u5148\uff0c<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Sharding\uff08\u5206\u7247\uff09\u7684\u6982\u8ff0\uff1b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>MongoDB\u7684Sharding\uff08\u5206\u7247\uff09\u64cd\u4f5c\uff1b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>MongoDB\u4e2dSharding\uff08\u5206\u7247\uff09\u7684\u793a\u4f8b\u5b9e\u73b0\uff1b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5728\u8fdb\u884cMongoDB\u7684Sharding\uff08\u5206\u7247\uff09\u65f6\u9700\u8981\u8003\u8651\u7684\u4e8b\u9879\uff1b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>6. \u4ee5Ethereum\uff08\u4ee5\u592a\u574a\uff09\u4e3a\u4f8b\u7684\u533a\u5757\u94feSharding\uff08\u5206\u7247\uff09\u6280\u672f\u3002<\/ol>\n<h2>\u9996\u5148\uff08\u5173\u4e8eMongoDB\u4e2d\u7684Sharding\uff08\u5206\u7247\uff09\uff09\u5206\u7247\uff08Sharding\uff09\u662f\u4e00\u79cd\u6280\u672f\uff0c\u88ab\u5173\u6ce8\u4e3a\u6269\u5c55\u4ee5\u592a\u574a\u7b49\u533a\u5757\u94fe\u7684\u65b9\u5f0f\uff0c\u4f46\u5b83\u672c\u8d28\u4e0a\u662f\u4e00\u79cd\u5c06\u5e38\u89c4\u6570\u636e\u5e93\u5206\u6563\u5230\u591a\u4e2a\u670d\u52a1\u5668\u7684\u529f\u80fd\u3002\u91c7\u7528NoSQL\u7ed3\u6784\u7684MongoDB\u6570\u636e\u5e93\u65e9\u5728\u5f00\u53d1\u521d\u671f\u5c31\u88ab\u8bbe\u8ba1\u4e3a\u652f\u6301\u5206\u7247\uff08Sharding\uff09\u3002\u5b83\u65e8\u5728\u5b9e\u73b0\u6570\u636e\u548c\u5904\u7406\u7684\u5206\u6563\uff0c\u800c\u65e0\u9700\u5355\u4e00\u6545\u969c\u70b9\u3002<\/p>\n<p>\u4e3a\u4e86\u8ba8\u8bba\u533a\u5757\u94fe\u6280\u672f\u4e2d\u4f7f\u7528\u7684\u5206\u7247\u6280\u672fSharding\uff0c\u672c\u6587\u5c06\u4f7f\u7528MongoDB\u6765\u63a2\u8ba8\u6570\u636e\u5206\u6563\u4e2d\u7684Sharding\u3002\u6211\u4eec\u5c06\u901a\u8fc7\u67e5\u770b\u5b9e\u9645\u793a\u4f8b\u5e76\u6267\u884c\u6837\u672c\u6765\u6df1\u5165\u7406\u89e3Sharding\u7b49\u590d\u6742\u7684\u673a\u5236\uff0c\u5e76\u6309\u7167\u4ee5\u4e0b\u987a\u5e8f\u8fdb\u884c\u8ba8\u8bba\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3068\u306f\u4f55\u304b\u3002\u306a\u305c\u91cd\u8981\u3068\u306a\u308b\u306e\u304b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">MongoDB\u3067\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308b\u306e\u304b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">MongoDB\u306b\u304a\u3051\u308bSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u306e\u30b5\u30f3\u30d7\u30eb\u5b9f\u88c5<\/ul>\n<h2>2. Sharding\uff08\u5206\u7247\uff09\u7684\u6982\u8ff0\u5728\u5404\u79cd\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\uff0c\u5982\u533a\u5757\u94fe\u7b49\uff0c\u7ecf\u5e38\u4f1a\u51fa\u73b0\u5907\u4efd\u7684\u60c5\u51b5\uff0c\u4f46\u6bcf\u4e2a\u5907\u4efd\u4e2d\u901a\u5e38\u90fd\u590d\u5236\u4e86\u5176\u4ed6\u5907\u4efd\u7684\u6570\u636e\u3002\u5728\u6bd4\u7279\u5e01\u548c\u4ee5\u592a\u574a\u7b49\u533a\u5757\u94fe\u7f51\u7edc\u4e2d\uff0c\u53c2\u4e0e\u4f5c\u4e3a\u77ff\u5de5\u7684\u6240\u6709\u8282\u70b9\uff08\u5907\u4efd\uff09\u5b9e\u9645\u4e0a\u90fd\u6301\u6709\u5e76\u5904\u7406\u6574\u4e2a\u533a\u5757\u94fe\u7f51\u7edc\u7684\u5168\u90e8\u6570\u636e\u3002\u7136\u800c\uff0c\u968f\u7740\u6570\u636e\u5927\u5c0f\u7684\u589e\u52a0\u4ee5\u53ca\u5bf9\u66f4\u9891\u7e41\u548c\u66f4\u5927\u91cf\u7684\u8bfb\u5199\u541e\u5410\u91cf\u7684\u9700\u6c42\uff0c\u5904\u7406\u80fd\u529b\u4f1a\u8fbe\u5230\u6781\u9650\u3002\u5bf9\u4e8e\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u5c06\u6570\u636e\u5e93\u548c\u7f51\u7edc\u5206\u6563\u5230\u591a\u4e2a\u8282\u70b9\u96c6\u662f\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u8fdb\u884c\u5206\u7247\uff08Sharding\uff09\u7684\u4f18\u70b9\u5305\u62ec\u4ee5\u4e0b\u51e0\u70b9\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">CPU\u3084I\/O\u8ca0\u8377\u3092\u5206\u6563\u3055\u305b\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30e1\u30e2\u30ea\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u5206\u6563\u306b\u3088\u308b\u30b3\u30b9\u30c8\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u305f\u5bb9\u91cf\u306e\u8ffd\u52a0\u3082\u53ef\u80fd\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\uff08\u30e1\u30e2\u30ea64GB\u4e00\u679a\u3088\u308a\u30014GB16\u679a\u306e\u65b9\u304c\u5b89\u3044\u3002\uff09<\/ul>\n<p>Mongodb\u662f\u4e00\u79cd\u5f15\u5165\u4e86\u6b64\u7c7b\u673a\u5236\u7684NOSQL\u6570\u636e\u5e93\uff0c\u4ece\u5f00\u53d1\u521d\u671f\u5c31\u5df2\u7ecf\u65e8\u5728\u5b9e\u73b0Sharding\uff08\u5206\u7247\uff09\u3002\u7279\u522b\u662f\u5728\u73b0\u6709\u673a\u5236\u4e2d\uff0cSharding\uff08\u5206\u7247\uff09\u4e0d\u662f\u81ea\u52a8\u6267\u884c\u800c\u662f\u624b\u52a8\u6267\u884c\u7684\uff0c\u901a\u8fc7\u81ea\u52a8\u5316\u8fd9\u4e00\u8fc7\u7a0b\uff0c\u66f4\u591a\u7684\u5de5\u7a0b\u5e08\u80fd\u591f\u5b9e\u73b0Sharding\uff08\u5206\u7247\uff09\uff0c\u8fd9\u662fMongoDB\u7684\u4e00\u5927\u7279\u70b9\u3002<\/p>\n<h2>3. MongoDB\u7684Sharding\uff08\u5206\u7247\uff09\u64cd\u4f5c<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"mongodb2.png\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/11-0.\/attachments\/e33b6b72-869a-4058-9ebb-ab1bcfbdb4bc\" alt=\"undefined\" \/><\/p>\n<h3>3-1. \u7528\u8bed\u8bf4\u660e3-1. \u7528\u8bed\u89e3\u91ca<\/p>\n<p>3-1. \u4ee5\u7528\u8bed\u8bf4\u660e<\/p>\n<p>3-1. \u89e3\u91ca\u7528\u8bed<\/p>\n<p>\u5206\u7247\uff08\uff09<br \/>\n\u662f\u5b58\u50a8\u5206\u6563\u6570\u636e\u96c6\u7684mongod\u8fdb\u7a0b\u7684\u96c6\u5408\u4f53\u3002<\/p>\n<p>mongos\u670d\u52a1\u5668\u662fSharding\u8def\u7531\u8fc7\u7a0b\u4e2d\u7684\u8fdb\u7a0b\u3002mongos\u8fdb\u7a0b\u901a\u8fc7\u5c06\u6240\u6709\u8bfb\u5199\u8bf7\u6c42\u5206\u914d\u5230\u9002\u5f53\u7684Shard\u4e0a\u4e0e\u5ba2\u6237\u7aef\u8fdb\u884c\u534f\u4f5c\u3002\u901a\u8fc7mongos\uff0c\u5ba2\u6237\u7aef\u53ef\u4ee5\u770b\u5230\u6570\u636e\u5b58\u50a8\u5177\u6709\u4e00\u81f4\u6027\u3002mongos\u670d\u52a1\u5668\u672c\u8eab\u4e0d\u5b58\u50a8\u72b6\u6001\u6216\u6570\u636e\u3002<\/p>\n<p>\u914d\u7f6e\u670d\u52a1\u5668<br \/>\nmongod\u8fdb\u7a0b\uff0c\u7528\u4e8e\u7ba1\u7406Sharding\uff08\u5206\u7247\uff09\u7684\u5143\u6570\u636e\u3002\u5176\u804c\u8d23\u662f\u786e\u4fdd\u6bcf\u4e2a\u5206\u7247\u7ec4\u7684\u6b63\u786e\u72b6\u6001\u88ab\u4fdd\u5b58\u3002\u5143\u6570\u636e\u5305\u62ec\u5168\u5c40\u5206\u7247\u7ec4\u7684\u914d\u7f6e\u3001\u6bcf\u4e2a\u6570\u636e\u5e93\u548c\u96c6\u5408\u7684\u4f4d\u7f6e\u3001\u7279\u5b9a\u8303\u56f4\u6570\u636e\u7684\u5b58\u50a8\u4f4d\u7f6e\u4ee5\u53ca\u5206\u7247\u6570\u636e\u8fc1\u79fb\u5386\u53f2\u7684\u53d8\u66f4\u65e5\u5fd7\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u8fd9\u4e9b\u5143\u6570\u636e\u5728\u786e\u4fdd\u5206\u7247\u6b63\u5e38\u8fd0\u884c\u65b9\u9762\u626e\u6f14\u7740\u6838\u5fc3\u89d2\u8272\uff0c\u6bcf\u6b21\u542f\u52a8mongos\u8fdb\u7a0b\u65f6\uff0c\u5b83\u90fd\u4f1a\u4ece\u914d\u7f6e\u670d\u52a1\u5668\u68c0\u7d22\u5143\u6570\u636e\u7684\u526f\u672c\u3002<\/p>\n<p>\u5efa\u8bae\u4f7f\u7528\u591a\u4e2a\u914d\u7f6e\u670d\u52a1\u5668\u6765\u914d\u7f6e\uff0c\u4ee5\u907f\u514d\u6210\u4e3a\u5355\u4e00\u6545\u969c\u70b9\u3002\u5728\u51c6\u5907\u591a\u4e2a\u914d\u7f6e\u670d\u52a1\u5668\u65f6\uff0c\u9700\u8981\u975e\u5e38\u5f3a\u5927\u7684\u4e00\u81f4\u6027\u4fdd\u969c\uff0c\u56e0\u6b64\u4f1a\u4f7f\u75282PC\uff08Two-Phase Commit\uff09\u6765\u8fdb\u884c\u540c\u6b65\u3002\uff08\u8be6\u7ec6\u4fe1\u606f\u8bf7\u53c2\u8003&#8221;\u5728\u6784\u5efa\u533a\u5757\u94fe\u7684\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u5bb9\u9519\u6027&#8221;\u4e00\u6587\u3002\uff09<\/p>\n<p>\u96c6\u5408\u6570\u636e\u6bd4\u6570\u636e\u5e93\u66f4\u7ec6\u7c92\u5ea6\u7684\u6570\u636e\u7ec4\u3002\u5728\u533a\u5757\u94fe\u4e2d\u5bf9\u5e94\u4e8e\u533a\u5757\u3002<\/p>\n<p>\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u7684\u952e\u8303\u56f4\uff0c\u8be5\u952e\u8303\u56f4\u7528\u4e8e\u5206\u6563\u6570\u636e\u3002 MongoDB\u901a\u8fc7\u81ea\u52a8\u8c03\u6574\u5206\u7247\u952e\u6765\u5e73\u8861\u6570\u636e\u7684\u4e0d\u5747\u8861\u3002<\/p>\n<p>\u5757\uff08chunk\uff09\u662f\u5206\u6563\u6570\u636e\u7684\u5355\u4f4d\u3002\u4e00\u7ec4\u4ea4\u6613\u3002<\/p>\n<h3>3-2. \u7531\u4e8eShard Key\u7684\u8303\u56f4\uff0c\u6570\u636e\u88ab\u5206\u6563\u3002\u4e3a\u4e86\u66f4\u6e05\u695a\u5730\u7406\u89e3Sharding\uff08\u5206\u7247\uff09\u662f\u901a\u8fc7\u54ea\u4e9b\u5b9e\u9645\u64cd\u4f5c\u6765\u5206\u6563\u6570\u636e\u7684\uff0c\u8ba9\u6211\u4eec\u4ee5\u4f8b\u5b50\u6765\u770b\u4e00\u4e0b\u3002<\/p>\n<p>\u5728MongoDB\u4e2d\uff0c\u901a\u8fc7\u6307\u5b9a\u5206\u7247\u952e\u53ef\u4ee5\u786e\u5b9a\u6bcf\u4e2a\u670d\u52a1\u5668\u5b58\u50a8\u7684\u6570\u636e\u8303\u56f4\u3002\u670d\u52a1\u5668\u4e4b\u95f4\u4e0d\u4f1a\u5b58\u5728\u91cd\u590d\u6570\u636e\uff0c\u4e00\u4e2a\u6570\u636e\u53ea\u4f1a\u5b58\u50a8\u5728\u7531\u5206\u7247\u952e\u8303\u56f4\u786e\u5b9a\u7684\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\u3002\u4f8b\u5982\uff0c\u8003\u8651\u4e00\u4e2a\u5177\u6709\u4ee5\u4e0b\u96c6\u5408\uff08\u6570\u636e\u7ec4\uff09\u7684\u7535\u5b50\u8868\u683c\u7ba1\u7406\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<pre class=\"post-pre\"><code>{\r\n    _id: ObjectID (\"34x78rfcnNne3792c\")\r\n    filename:\"spreadsheet-1\",\r\n    updated_at: ISODate(\"\u30fb\u30fb\u30fb\"),\r\n    username: \"adam\",\r\n    data: \"raw document data\"\r\n}\r\n<\/code><\/pre>\n<p>\u5982\u679c\u7528\u6237\u6570\u91cf\u589e\u52a0\uff0c\u4e14\u5728MongoDB\u4e2d\u9700\u8981Sharding\uff08\u5206\u7247\uff09\u65f6\uff0c\u53ef\u4ee5\u4ece\u4e0a\u8ff0\u96c6\u5408\u4e2d\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u4f5c\u4e3a\u5206\u7247\u952e\u58f0\u660e\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9009\u62e9username\u548cid\u4f5c\u4e3a\u7ec4\u5408\u5206\u7247\u952e\u53ef\u80fd\u662f\u5408\u9002\u7684\u3002\u8fde\u7eed\u7684\u6570\u636e\u5728\u5206\u7247\u952e\u7684\u8303\u56f4\u5185\u88ab\u5206\u6210\u4e86\u4ee5\u4e0b\u7684\u5757\u3002\u6bcf\u4e2a\u5757\u90fd\u6709\u8d77\u59cb\u503c\u548c\u7ed3\u675f\u503c\uff0c\u5e76\u4e14\u6bcf\u4e2a\u5757\u90fd\u88ab\u5206\u914d\u7ed9\u4e86\u5404\u4e2a\u5206\u7247\u3002<\/p>\n<div>\n<div class=\"post-table\">\u958b\u59cb\u5024\u7d42\u4e86\u5024\u30b7\u30e3\u30fc\u30c9_\u221eadamBadamdaytonAdaytonharrisBharrsinorrisAnorris\u221eC\u5c3d\u7ba1\u6bcf\u4e2a\u5757\u8868\u793a\u4e00\u4e2a\u8fde\u7eed\u503c\u7684\u8303\u56f4\uff0c\u4f46\u6bcf\u4e2a\u5757\u90fd\u53ef\u4ee5\u5206\u914d\u5230\u4efb\u4f55\u5206\u7247\u4e2d\uff0c\u8fd9\u662f\u5b83\u7684\u7279\u70b9\u3002\u800c\u4e14\uff0c\u5757\u662f\u903b\u8f91\u4e0a\u800c\u4e0d\u662f\u7269\u7406\u4e0a\u7684\u5b58\u5728\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u4ee5\u4e0a\u9762\u7684\u4f8b\u5b50\u4e3a\u4f8b\uff0c\u4ee5harris\u5f00\u5934\u4ee5norris\u7ed3\u5c3e\u7684\u5757\u5728\u5206\u7247A\u4e2d\u53ea\u8868\u793a\u6240\u6709\u6587\u6863\u90fd\u5b58\u50a8\u5728\u8fd9\u4e2a\u5206\u7247\u952e\u8303\u56f4\u5185\uff0c\u800c\u4e0d\u5173\u6ce8\u5176\u987a\u5e8f\u6216\u8fde\u7eed\u6027\u3002<\/p>\n<h3>\u5728Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u5bf9\u5757\u7684\u5206\u5272\u548c\u8fc1\u79fb\u8fdb\u884c\u64cd\u4f5c\u3002\u5bf9\u4e8eChunk\u7684\u5206\u5272\u548c\u8fc1\u79fb\uff0c\u5728Sharding\uff08\u5206\u7247\uff09\u4e2d\u626e\u6f14\u7740\u6838\u5fc3\u673a\u5236\u7684\u89d2\u8272\u3002<\/p>\n<p>\u5728MongoDB\u7684Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u5f53\u4e00\u4e2achunk\u7684\u5927\u5c0f\u8d85\u8fc7\u4e86\u9884\u8bbe\u7684\u9608\u503c\u65f6\uff0c\u5b83\u4f1a\u81ea\u52a8\u5206\u5272\u3002chunk\u7684\u9ed8\u8ba4\u6700\u5927\u5927\u5c0f\u662f64MB\u6216\u8005100,000\u4e2a\u6587\u6863\uff0c\u5f53\u5176\u4e2d\u4e00\u4e2a\u6761\u4ef6\u88ab\u8d85\u8fc7\u65f6\uff0cchunk\u5c06\u88ab\u5206\u5272\u3002<\/p>\n<p>\u5728\u8bbe\u8ba1\u5206\u7247\uff08Sharding\uff09\u7cfb\u7edf\u65f6\uff0c\u6700\u56f0\u96be\u7684\u90e8\u5206\u4e4b\u4e00\u662f\u786e\u4fdd\u6570\u636e\u5728\u5206\u5272\u540e\u59cb\u7ec8\u4fdd\u6301\u5747\u8861\u3002MongoDB\u901a\u8fc7\u5728\u5206\u7247\u95f4\u968f\u65f6\u79fb\u52a8\u6570\u636e\u5757\uff08chunk\uff09\u6765\u5b9e\u73b0\u5e73\u8861\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u88ab\u79f0\u4e3a\u8fc1\u79fb\uff0c\u7531\u540d\u4e3a\u8d1f\u8f7d\u5747\u8861\u5668\uff08Balancer\uff09\u7684\u8f6f\u4ef6\u8fdb\u7a0b\u6765\u7ba1\u7406\u3002\u8d1f\u8f7d\u5747\u8861\u5668\u4f1a\u8ffd\u8e2a\u6bcf\u4e2a\u5206\u7247\u4e0a\u7684\u6570\u636e\u5757\u6570\u91cf\uff0c\u5f53\u5dee\u8ddd\u8fbe\u5230\u4e00\u5b9a\u9608\u503c\u65f6\uff0c\u4f1a\u5c06\u6700\u591a\u6570\u636e\u5757\u7684\u5206\u7247\u4e2d\u7684\u6570\u636e\u8fc1\u79fb\u5230\u6570\u636e\u5757\u6700\u5c11\u7684\u5206\u7247\u4e2d\u3002<\/p>\n<h3>3-4. MongoDB\u4e0a\u7684\u5206\u7247\uff08Sharding\uff09\u6267\u884c\u8fc7\u7a0b\u603b\u7ed3\u8fc4\u4eca\u4e3a\u6b62\uff0c\u6211\u4eec\u5df2\u7ecf\u89e3\u91ca\u4e86\u5728MongoDB\u4e0a\u5982\u4f55\u8fdb\u884cSharding\uff08\u5206\u7247\uff09\u7684\u8fc7\u7a0b\u3002\u7b80\u8981\u603b\u7ed3\u5982\u4e0b\u3002<\/p>\n<p>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3068\u3044\u3046\u30c7\u30fc\u30bf\u7fa4\u306e\u751f\u6210<br \/>\n\u30d5\u30a3\u30fc\u30eb\u3069\u306e\u4e2d\u304b\u3089\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3092\u5b9a\u7fa9\u3057\u3066\u3055\u3089\u306b\u5c0f\u3055\u306a\u307e\u3068\u307e\u308a\u3067\u3042\u308b\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3059\u308b<br \/>\n\u30c7\u30fc\u30bf\u91cf\u304c\u5897\u3048\u308b\u7a0b\u30c1\u30e3\u30f3\u30af\u304c\u7d30\u304b\u304f\u5206\u5272\u3055\u308c\u3066\u3044\u304d\u3001\u81ea\u52d5\u3067\u5404\u30b7\u30e3\u30fc\u30c9\u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b<br \/>\n\u30b7\u30e3\u30fc\u30c9\u9593\u306e\u30c1\u30e3\u30f3\u30af\u6570\u306b\u504f\u308a\u304c\u751f\u3058\u305f\u5834\u5408\u3001\u30d0\u30e9\u30f3\u30b5\u30fc\u306b\u3088\u3063\u3066\u30c1\u30e3\u30f3\u30af\u306e\u79fb\u884c\u304c\u884c\u308f\u308c\u5747\u7b49\u306b\u306a\u308b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSharding\uff08\u5206\u7247\uff09\u7684\u5927\u81f4\u6d41\u7a0b\u3002<\/p>\n<h2>\u5728MongoDB\u4e2d\uff0cSharding\uff08\u5206\u7247\uff09\u7684\u793a\u4f8b\u5b9e\u73b0\u3002\u672c\u7ae0\u5c06\u901a\u8fc7\u5728MongoDB\u4e0a\u8fd0\u884c\u793a\u4f8b\uff0c\u5e76\u5b9e\u65bdSharding\u6765\u66f4\u8be6\u7ec6\u5730\u89e3\u91caSharding\u3002\u603b\u4f53\u800c\u8a00\uff0c\u5728MongoDB\u4e0a\u8fdb\u884cSharding\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code>1. \u5fc5\u8981\u306amongod\u3092\u5168\u3066\u7528\u610f\u3057\u8d77\u52d5\u3059\u308b\r\n2. \u5fc5\u8981\u306aconfig\u30b5\u30fc\u30d0\u30fc\u3092\u5168\u3066\u7528\u610f\u3057\u8d77\u52d5\u3059\u308b\r\n3. mongos\u3092\u7528\u610f\u3057\u8d77\u52d5\u3059\u308b\r\n4. \u30b7\u30e3\u30fc\u30c9\u30af\u30e9\u30b9\u30bf\u306b\u5404\u30b7\u30e3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\r\n5. \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6709\u52b9\u5316\u3059\u308b\r\n6. \u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3092\u5b9a\u7fa9\u3057\u3066\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u30b7\u30e3\u30fc\u30c9\u5316\u3059\u308b\r\n7. \u30b7\u30e3\u30fc\u30c9\u5316\u3055\u308c\u305f\u30af\u30e9\u30b9\u30bf\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3080\r\n8. \u30c7\u30fc\u30bf\u91cf\u304c\u5927\u304d\u304f\u306a\u308c\u3070\u3001\u81ea\u52d5\u3067\u7d30\u304b\u3044\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3055\u308c\u3001\u5404\u30b7\u30e3\u30fc\u30c9\u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\r\n9. \u30b7\u30e3\u30fc\u30c9\u9593\u306e\u30c1\u30e3\u30f3\u30af\u306e\u6570\u306b\u504f\u308a\u304c\u751f\u3058\u308c\u3070\u30d0\u30e9\u30f3\u30b5\u30fc\u304c\u30c1\u30e3\u30f3\u30af\u3092\u79fb\u884c\u3055\u305b\u308b\r\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528Sharding\uff08\u5206\u7247\uff09\u7684\u793a\u4f8b\u6765\u4e86\u89e3\u5b9e\u9645\u7684\u5b9e\u73b0\u65b9\u6cd5\u3002\u5728\u672c\u6b21\u793a\u4f8b\u4e2d\uff0c\u5206\u7247\u96c6\u7fa4\u7684\u914d\u7f6e\u5982\u4e0b\uff0c\u6309\u4ee5\u4e0b\u65b9\u5f0f\u51c6\u5907\u4e24\u4e2a\u5206\u7247A\u548cB\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2018-08-08 13.56.57.png\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/40-0.\/attachments\/474d1ec7-b39e-49e0-aee7-8dda918b7385\" alt=\"undefined\" \/><\/p>\n<blockquote><p>\u300aMongoDB\u5b9e\u6218\uff08\u7b2c9\u7ae0\u5206\u7247\uff09\u300b<\/p><\/blockquote>\n<h3>\u5728MongoDB\u4e0a\u8fdb\u884c\u5206\u7247\uff08Sharding\uff09\u6240\u9700\u7684mongod\u5fc5\u987b\u5168\u90e8\u51c6\u5907\u5e76\u542f\u52a8\u3002<br \/>\n\u9996\u5148\uff0c\u5728\u8fdb\u884c\u5206\u7247\uff08Sharding\uff09\u65f6\uff0c\u9700\u8981\u521b\u5efa\u4e24\u4e2a\u6570\u636e\u76ee\u5f55\u96c6\uff0c\u7528\u4e8e\u4f5c\u4e3a\u5206\u7247A\u548c\u5206\u7247B\u7684\u4e24\u4e2a\u526f\u672c\u96c6\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mkdir \/data\/rs-a-1\r\n$ mkdir \/data\/rs-a-2\r\n$ mkdir \/data\/rs-a-3\r\n$ mkdir \/data\/rs-b-1\r\n$ mkdir \/data\/rs-b-2\r\n$ mkdir \/data\/rs-b-3\r\n<\/code><\/pre>\n<p>\u5982\u679c\u80fd\u521b\u5efa\u76ee\u5f55\uff0c\u63a5\u4e0b\u6765\u9700\u8981\u542f\u52a8\u7528\u4e8eSharding\uff08\u5206\u7247\uff09\u7684mongodb\u3002\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u51c6\u5907\u4e00\u4e2a\u7ec8\u7aef\u7a97\u53e3\uff0c\u5e76\u52a0\u4e0a&#8211;shardsvr\u9009\u9879\u6765\u8bbe\u7f6e\u5b83\u4eec\u5c06\u88ab\u653e\u7f6e\u5728\u54ea\u4e2a\u5206\u7247\u4e0a\u3002\u5982\u679c\u52a0\u4e0a&#8211;fork\u9009\u9879\uff0c\u8fd8\u53ef\u4ee5\u5728\u540e\u53f0\u8fd0\u884c\u3002<\/p>\n<p>&lt;\u542f\u52a8\u590d\u5236\u96c61\uff08shard-a\uff09\u4e2d\u7684mongod&gt;<\/p>\n<pre class=\"post-pre\"><code>$ mongod --shardsvr --replSet shard-a --dbpath \/data\/rs-a-1 \\\r\n  --port 30000 --logpath \/data\/rs-a-1.log \r\n$ mongod --shardsvr --replSet shard-a --dbpath \/data\/rs-a-2 \\\r\n  --port 30001 --logpath \/data\/rs-a-2.log\r\n$ mongod --shardsvr --replSet shard-a --dbpath \/data\/rs-a-3 \\\r\n  --port 30002 --logpath \/data\/rs-a-3.log \r\n<\/code><\/pre>\n<p>&lt;\u542f\u52a8\u590d\u5236\u96c62\uff08shard-b\uff09\u7684mongod&gt;<\/p>\n<pre class=\"post-pre\"><code>$ mongod --shardsvr --replSet shard-b --dbpath \/data\/rs-b-1 \\\r\n  --port 30100 --logpath \/data\/rs-b-1.log\r\n$ mongod --shardsvr --replSet shard-b --dbpath \/data\/rs-b-2 \\\r\n  --port 30101 --logpath \/data\/rs-b-2.log\r\n$ mongod --shardsvr --replSet shard-b --dbpath \/data\/rs-b-3 \\\r\n  --port 30102 --logpath \/data\/rs-b-3.log\r\n<\/code><\/pre>\n<p>\u4e00\u65e6\u542f\u52a8\u540e\uff0c\u8fde\u63a5\u5230\u6bcf\u4e2a\u590d\u5236\u96c6\u5e76\u6267\u884c rs.initiate() \u8fdb\u884c\u521d\u59cb\u5316\uff0c\u7136\u540e\u9010\u6e10\u6dfb\u52a0\u8282\u70b9\u5230\u8282\u70b9\u7ec4\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mongo localhost:30000\r\n&gt; rs.initiate()\r\n<\/code><\/pre>\n<p>\u5728\u6b64\uff0c\u7b49\u5f85\u5927\u7ea61\u5206\u949f\u76f4\u5230\u521d\u59cb\u8282\u70b9\u53d8\u4e3a\u4e3b\u8282\u70b9\uff0c\u5f53\u663e\u793aPRIMARY\u65f6\uff0c\u7ee7\u7eed\u6dfb\u52a0\u5269\u4f59\u7684\u8282\u70b9\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; rs.add(\"localhost:30001\")\r\n&gt; rs.add(\"localhost:30002\", {arbiterOnly: true})\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7b2c\u4e09\u4e2a\u8282\u70b9\u53ef\u4ee5\u662f\u4ef2\u88c1\u8005\u3002\u7a0d\u540e\u4f1a\u8be6\u7ec6\u89e3\u91ca\uff0c\u4ef2\u88c1\u8005\u662f\u6307\u4ec5\u4fdd\u5b58\u526f\u672c\u96c6\u7684\u914d\u7f6e\u6570\u636e\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u51c6\u5907\u4e13\u7528\u670d\u52a1\u5668\u3002<\/p>\n<p>\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff0c\u4ee5\u4e0b\u662f\u5bf9\u539f\u6587\u7684\u4e2d\u6587\u7ffb\u8bd1\uff1a<br \/>\n\u5982\u679c\u6267\u884c\u7b2c\u4e8c\u4e2a\u590d\u5236\u96c6\uff0c\u53ea\u9700\u4e0e\u4e0a\u8ff0\u76f8\u540c\u5373\u53ef\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u6bcf\u4e2a\u590d\u5236\u96c6\u7684shell\u4e2d\u8fd0\u884crs.status()\u547d\u4ee4\u6765\u786e\u8ba4\u7528\u4e8e\u5206\u7247\u7684\u590d\u5236\u96c6\u662f\u5426\u5904\u4e8e\u5728\u7ebf\u72b6\u6001\u4ee5\u53ca\u8be5\u5206\u7247\u4e2dmongod\u6210\u5458\u7684\u72b6\u6001\u3002<\/p>\n<pre class=\"post-pre\"><code>shard-a:PRIMARY&gt; rs.status()\r\n{\r\n\"set\" : \"shard-a\",\r\n\"date\" : ISODate(\"\u30fb\u30fb\u30fb\"),\r\n\"myState\" : 1,\r\n\u30fb\u30fb\u30fb\r\n\"members\" : [\r\n    {\r\n        \"_id\" : 0,\r\n        \"name\" : \"localhost:30000\",\r\n        \"health\" : 1,\r\n        \"state\" : 1,\r\n        \"stateStr\" : \"PRIMARY\",\r\n        \u30fb\u30fb\u30fb\r\n    },\r\n    {\r\n        \"_id\" : 1,\r\n        \"name\" : \"localhost:30001\",\r\n        \"health\" : 1,\r\n        \"state\" : 2,\r\n        \"stateStr\" : \"SECONDARY\",\r\n         \u30fb\u30fb\u30fb\r\n\u30fb\u30fb\u30fb\r\n\u30fb\u30fb\u30fb\r\n<\/code><\/pre>\n<h3>\u5728MongoDB\u4e0a\u5b9e\u73b0Sharding\u6240\u9700\u7684\u6240\u6709config\u670d\u52a1\u5668\u90fd\u5df2\u51c6\u5907\u597d\u5e76\u542f\u52a8\u3002\u5982\u679c\u80fd\u591f\u786e\u8ba4MongoDB\u5df2\u7ecf\u542f\u52a8\uff0c\u5c31\u53ef\u4ee5\u542f\u52a8\u6240\u6709\u9700\u8981\u8bbe\u7f6eSharding\uff08\u5206\u7247\uff09\u6240\u9700\u7684\u914d\u7f6e\u670d\u52a1\u5668\u3002\u6211\u4eec\u9700\u8981\u4e3a\u6bcf\u4e2a\u914d\u7f6e\u670d\u52a1\u5668\u521b\u5efa\u6570\u636e\u76ee\u5f55\uff0c\u5e76\u4f7f\u7528&#8211;configsvr\u9009\u9879\u6765\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mkdir \/data\/config-1\r\n$ mongod --configsvr --replSet config --dbpath \/data\/config-1 --port 27019 \\\r\n  --logpath \/data\/config-1.log\r\n\r\n$ mkdir \/data\/config-2\r\n$ mongod --configsvrr --replSet config --dbpath \/data\/config-2 --port 27020 \\\r\n  --logpath \/data\/config-2.log\r\n\r\n$ mkdir \/data\/config-3\r\n$ mongod --configsvrr --replSet config --dbpath \/data\/config-3 --port 27021 \\\r\n  --logpath \/data\/config-3.log\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ece\u6bcf\u4e2ashell\u8fde\u63a5\u8fdb\u5165\u6765\u786e\u8ba4config\u670d\u52a1\u5668\u662f\u5426\u5df2\u7ecf\u542f\u52a8\u3002\u7136\u540e\uff0c\u5728\u8fd9\u4e09\u53f0\u673a\u5668\u4e0a\u5efa\u7acb\u4e00\u4e2a\u96c6\u7fa4\u3002\u5728\u5176\u4e2d\u4e00\u53f0\u673a\u5668\u4e0a\u4f7f\u7528rs.initiate()\u547d\u4ee4\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u4ee5\u521b\u5efaPrimary\u7684Config\u670d\u52a1\u5668\u3002<\/p>\n<h3>\u51c6\u5907\u5e76\u542f\u52a8\u5728MongoDB\u4e0a\u5b9e\u65bdSharding\u6240\u9700\u7684mongos\u3002mongos\u542f\u52a8\u65f6\u5fc5\u987b\u4f7f\u7528&#8211;configdb\u9009\u9879\u3002\u8bf7\u786e\u4fdd\u5728\u6307\u5b9a\u914d\u7f6e\u670d\u52a1\u5668\u5730\u5740\u65f6\u4e0d\u8981\u5305\u542b\u7a7a\u683c\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mongos --configdb config\/localhost:27019,localhost:27020,localhost:27021 \\\r\n--logpath .\/data\/mongos.log --port 40000\r\n<\/code><\/pre>\n<h3>\u8fdb\u884cSharding\uff08\u5206\u7247\uff09\u6240\u9700\u7684MongoDB\u96c6\u7fa4\u914d\u7f6e\u3002\u7531\u4e8e\u51c6\u5907\u5e76\u542f\u52a8\u4e86\u8fdb\u884cSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u6240\u9700\u7684\u6240\u6709\u914d\u7f6e\u8981\u7d20\uff0c\u63a5\u4e0b\u6765\u5c06\u5bf9\u96c6\u7fa4\u8fdb\u884c\u914d\u7f6e\u4ee5\u8fdb\u884cSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u6267\u884c\u3002\u4f7f\u7528Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u7684\u8f85\u52a9\u65b9\u6cd5\uff0c\u5e76\u901a\u8fc7sh\u5bf9\u8c61\u8fdb\u884c\u6267\u884c\u3002<\/p>\n<p>\u4f7f\u7528sh.addShard()\u65b9\u6cd5\uff0c\u5c06\u4e4b\u524d\u521b\u5efa\u7684\u4e24\u4e2a\u526f\u672c\u96c6\u6dfb\u52a0\u5230\u5206\u7247\u4e2d\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u526f\u672c\u96c6\uff0c\u6307\u5b9a\u4e24\u4e2a\u975e\u4ef2\u88c1\u6210\u5458\u7684\u5730\u5740\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mongo localhost:40000\r\n&gt; sh.addShard(\"shard-a\/localhost:30000,localhost:30001\")\r\n  { \"shardAdded\" : \"shard-a\", \"ok\" : 1 }\r\n&gt; sh.addShard(\"shard-b\/localhost:30100,localhost:30101\")\r\n  { \"shardAdded\" : \"shard-b\", \"ok\" : 1 }\r\n<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\u67e5\u770b\u6ce8\u518c\u5728\u8bbe\u7f6e\u6570\u636e\u5e93\u4e0a\u7684\u5206\u7247\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; db.getSiblingDB(\"config\").shards.find()\r\n{ \"_id\" : \"shard-a\", \"host\" : \"shard-a\/localhost:30000,localhost:30001\" }\r\n{ \"_id\" : \"shard-b\", \"host\" : \"shard-b\/localhost:30100,localhost:30101\" }\r\n<\/code><\/pre>\n<h3>\u5728MongoDB\u4e0a\u542f\u7528\u6570\u636e\u5e93\u5206\u7247\uff08Sharding\uff09\u3002sh.enableSharding()\u30b3\u30de\u30f3\u30c9\u306b\u3088\u3063\u3066\u3001MongoDB\u4e0a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3092\u6709\u52b9\u5316\u3067\u304d\u308b\u3002\u4eca\u56de\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306fcloud-docs\u3068\u3044\u3046\u540d\u524d\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3092\u6709\u52b9\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; sh.enableSharding(\"cloud-docs\")\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u53ef\u4ee5\u786e\u8ba4\u8be5\u6570\u636e\u5e93\u662f\u5426\u542f\u7528\u4e86Sharding\uff08\u5206\u7247\uff09\u529f\u80fd\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; db.getSiblingDB(\"config\").databases.find()\r\n{ \"_id\" : \"admin\", \"partitioned\" : false, \"primary\" : \"config\" }\r\n{ \"_id\" : \"cloud-docs\", \"partitioned\" : true, \"primary\" : \"shard-a\" }\r\n<\/code><\/pre>\n<h3>4-6.MongoDB\u4e0a\u3067Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3059\u308b\u305f\u3081\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u30b7\u30e3\u30fc\u30c9\u5316\u3092\u884c\u3046\u6b21\u306b\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u30b7\u30e3\u30fc\u30c9\u5316\u3059\u308b\u3002\u4eca\u56de\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u540d\u524d\u306fspreadsheets\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u30b7\u30e3\u30fc\u30c9\u5316\u3059\u308b\u969b\u306b\u306f\u3001\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\u3002\u4eca\u56de\u306eMongoDB\u306b\u304a\u3051\u308bSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3067\u306f\u3001\u30c1\u30e3\u30f3\u30af\u306e\u7bc4\u56f2\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u3001\u304b\u3064\u30c7\u30fc\u30bf\u3092\u3046\u307e\u304f\u5206\u6563\u3067\u304d\u308b\u3053\u3068\u304b\u3089\u3001\u8907\u5408\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3068\u3057\u3066{user- name: 1, _id: 1}\u3092\u7528\u3044\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; sh.shardCollection(\"cloud-docs.spreadsheets\", {username: 1, _id: 1})\r\n<\/code><\/pre>\n<p>\u540c\u6837\uff0c\u53ef\u4ee5\u786e\u8ba4\u96c6\u5408\u662f\u5426\u8bbe\u7f6e\u4e86\u6570\u636e\u5206\u7247\u5316\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; db.getSiblingDB(\"config\").collections.findOne()\r\n{\r\n  \"_id\" : \"cloud-docs.spreadsheets\",\r\n  \"lastmod\" : ISODate(\"\u30fb\u30fb\u30fb\"),\r\n  \"dropped\" : false,\r\n  \"key\" : {\r\n    \"username\" : 1,\r\n    \"_id\" : 1\r\n  },\r\n  \"unique\" : false\r\n}\r\n<\/code><\/pre>\n<h3>4-7.MongoDB\u4e0a\u3067\u30b7\u30e3\u30fc\u30c9\u5316\u3055\u308c\u305f\u30af\u30e9\u30b9\u30bf\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3093\u3067Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3092\u8a66\u3059<br \/>\n\u5728\u8fd9\u6b21\u7684\u6837\u672c\u6570\u636e\u5e93\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u8868\u683c\u6765\u8868\u793a\u6570\u636e\u3002\u6bcf\u6761\u6570\u636e\u5305\u62ec\u4e94\u4e2a\u5b57\u6bb5\uff1a_id \/ \u6587\u4ef6\u540d \/ \u66f4\u65b0\u65f6\u95f4 \/ \u7528\u6237\u540d \/ \u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>{\r\n  _id: ObjectId(\"4d6f29c0e4ef0123afdacaeb\"),\r\n  filename: \"sheet-1\",\r\n  updated_at: new Date(),\r\n  username: \"Aaron\",\r\n  data: \"RAW DATA\"\r\n}\r\n<\/code><\/pre>\n<p>\u4eca\u56de\u306f\u3001data\u30d5\u30a3\u30fc\u30eb\u30c9\u306b5KB\u3092\u633f\u5165\u3057\u305f\u30c7\u30fc\u30bf\u3092200\u500b\u7528\u610f\u3059\u308b\u70ba\u306bRuby\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7528\u610f\u3057\u305f\u3002\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u4e8c\u3064\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304b\u3089\u5b9f\u884c\u3059\u308c\u3070\u3001\u30c7\u30fc\u30bf\u304cMongoDB\u5185\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306b\u4fdd\u5b58\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">require<\/span> <span class=\"s1\">'rubygems'<\/span>\r\n<span class=\"nb\">require<\/span> <span class=\"s1\">'mongo'<\/span>\r\n<span class=\"nb\">require<\/span> <span class=\"s1\">'faker'<\/span>\r\n\r\n<span class=\"c1\">#&lt;start id=\"write_docs\"&gt;<\/span>\r\n<span class=\"vi\">@con<\/span>  <span class=\"o\">=<\/span> <span class=\"no\">Mongo<\/span><span class=\"o\">::<\/span><span class=\"no\">Client<\/span><span class=\"p\">.<\/span><span class=\"nf\">new<\/span><span class=\"p\">([<\/span><span class=\"s1\">'127.0.0.1:40000'<\/span><span class=\"p\">],<\/span> <span class=\"n\">options<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span><span class=\"ss\">database: <\/span><span class=\"s2\">\"cloud-docs\"<\/span><span class=\"p\">})<\/span>\r\n<span class=\"vi\">@col<\/span>  <span class=\"o\">=<\/span> <span class=\"vi\">@con<\/span><span class=\"p\">[<\/span><span class=\"ss\">:spreadsheets<\/span><span class=\"p\">]<\/span>\r\n<span class=\"vi\">@data<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">\"abcde\"<\/span> <span class=\"o\">*<\/span> <span class=\"mi\">1000<\/span>\r\n\r\n<span class=\"k\">def<\/span> <span class=\"nf\">write_user_docs<\/span><span class=\"p\">(<\/span><span class=\"n\">iterations<\/span><span class=\"o\">=<\/span><span class=\"mi\">0<\/span><span class=\"p\">,<\/span> <span class=\"n\">name_count<\/span><span class=\"o\">=<\/span><span class=\"mi\">200<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"n\">iterations<\/span><span class=\"p\">.<\/span><span class=\"nf\">times<\/span> <span class=\"k\">do<\/span> <span class=\"o\">|<\/span><span class=\"n\">n<\/span><span class=\"o\">|<\/span>\r\n    <span class=\"n\">name_count<\/span><span class=\"p\">.<\/span><span class=\"nf\">times<\/span> <span class=\"k\">do<\/span> <span class=\"o\">|<\/span><span class=\"n\">n<\/span><span class=\"o\">|<\/span>\r\n      <span class=\"n\">doc<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span> <span class=\"ss\">:filename<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"s2\">\"sheet-<\/span><span class=\"si\">#{<\/span><span class=\"n\">n<\/span><span class=\"si\">}<\/span><span class=\"s2\">\"<\/span><span class=\"p\">,<\/span>\r\n              <span class=\"ss\">:updated_at<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"no\">Time<\/span><span class=\"p\">.<\/span><span class=\"nf\">now<\/span><span class=\"p\">.<\/span><span class=\"nf\">utc<\/span><span class=\"p\">,<\/span>\r\n              <span class=\"ss\">:username<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"no\">Faker<\/span><span class=\"o\">::<\/span><span class=\"no\">Name<\/span><span class=\"p\">.<\/span><span class=\"nf\">first_name<\/span><span class=\"p\">,<\/span>\r\n              <span class=\"ss\">:data<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"vi\">@data<\/span>\r\n            <span class=\"p\">}<\/span>\r\n      <span class=\"vi\">@col<\/span><span class=\"p\">.<\/span><span class=\"nf\">insert_one<\/span><span class=\"p\">(<\/span><span class=\"n\">doc<\/span><span class=\"p\">)<\/span>\r\n    <span class=\"k\">end<\/span>\r\n  <span class=\"k\">end<\/span>\r\n<span class=\"k\">end<\/span>\r\n<span class=\"c1\">#&lt;start id=\"write_docs\"&gt;<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"no\">ARGV<\/span><span class=\"p\">.<\/span><span class=\"nf\">empty?<\/span> <span class=\"o\">||<\/span> <span class=\"o\">!<\/span><span class=\"p\">(<\/span><span class=\"no\">ARGV<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">]<\/span> <span class=\"o\">=~<\/span> <span class=\"sr\">\/^\\d+$\/<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"nb\">puts<\/span> <span class=\"s2\">\"Usage: load.rb [iterations] [name_count]\"<\/span>\r\n<span class=\"k\">else<\/span>\r\n  <span class=\"n\">iterations<\/span> <span class=\"o\">=<\/span> <span class=\"no\">ARGV<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">].<\/span><span class=\"nf\">to_i<\/span>\r\n\r\n  <span class=\"k\">if<\/span> <span class=\"no\">ARGV<\/span><span class=\"p\">[<\/span><span class=\"mi\">1<\/span><span class=\"p\">]<\/span> <span class=\"o\">&amp;&amp;<\/span> <span class=\"no\">ARGV<\/span><span class=\"p\">[<\/span><span class=\"mi\">1<\/span><span class=\"p\">]<\/span> <span class=\"o\">=~<\/span> <span class=\"sr\">\/^\\d+$\/<\/span>\r\n    <span class=\"n\">name_count<\/span> <span class=\"o\">=<\/span> <span class=\"no\">ARGV<\/span><span class=\"p\">[<\/span><span class=\"mi\">1<\/span><span class=\"p\">].<\/span><span class=\"nf\">to_i<\/span>\r\n  <span class=\"k\">else<\/span>\r\n    <span class=\"n\">name_count<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">200<\/span>\r\n  <span class=\"k\">end<\/span>\r\n\r\n  <span class=\"n\">write_user_docs<\/span><span class=\"p\">(<\/span><span class=\"n\">iterations<\/span><span class=\"p\">,<\/span> <span class=\"n\">name_count<\/span><span class=\"p\">)<\/span>\r\n<span class=\"k\">end<\/span>\r\n<\/code><\/pre>\n<blockquote><p>https:\/\/github.com\/yodash\/mongodb\u5206\u7247<\/p><\/blockquote>\n<pre class=\"post-pre\"><code>$ gem install mongo\r\n$ gem install faker\r\n$ ruby load.rb 1 200\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879, \u4ee5\u4e0b\u662f\u4e2d\u6587\u672c\u5730\u5316\u7684\u6539\u8ff0\u7248\u672c:<br \/>\n\u5f53\u5b9e\u9645\u8fde\u63a5\u5230mongos\u5e76\u68c0\u67e5\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u786e\u8ba4\u6709200\u4eba\u7684\u6570\u636e\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mongo localhost:40000\r\n&gt; use cloud-docs\r\n&gt; db.spreadsheets.count()\r\n200\r\n&gt; db.spreadsheets.stats().size\r\n1019496\r\n&gt; db.spreadsheets.findOne({}, {data: 0})\r\n{\r\n  \"_id\" : ObjectId(\"4d6d6b191d41c8547d0024c2\"),\r\n  \"username\" : \"Aaron\",\r\n  \"updated_at\" : ISODate(\"\u30fb\u30fb\u30fb\"),\r\n  \"filename\" : \"sheet-0\"\r\n}\r\n<\/code><\/pre>\n<h3>4-8.MongoDB\u7684Sharding\uff08\u5206\u7247\uff09Chunk\u5206\u5272\u4e0e\u8fc1\u79fb<br \/>\n\u7136\u540e\u6211\u4eec\u8fdb\u884c\u4e86800\u6b21\u6570\u636e\u5199\u5165\uff0c\u5e76\u786e\u8ba4\u8fdb\u884c\u4e86Sharding\uff08\u5206\u7247\uff09\u4ee5\u66f4\u7ec6\u5206\u533a\u5757\u7684\u65b9\u5f0f\u5206\u5272\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5206\u914d\u5230\u5404\u4e2a\u5206\u7247\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>$ ruby load.rb 800 200\r\n<\/code><\/pre>\n<p>\u56e0\u4e3a\u65f6\u95f4\u4f1a\u82b1\u8d39\u5f88\u4e45\uff0c\u6240\u4ee5\u5728\u8fd9\u91cc\u5403\u4e00\u4e9bPocky\u5e76\u4f11\u606f\u4e00\u4e0b\u5427\u3002\u6309\u7167\u4ee5\u4e0b\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u786e\u8ba4\u6570\u636e\u5199\u5165\u662f\u5426\u6210\u529f\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; use config\r\n&gt; db.chunks.count()\r\n21\r\n&gt; db.chunks.count({\"shard\": \"shard-a\"})\r\n11\r\n&gt; db.chunks.count({\"shard\": \"shard-b\"})\r\n10\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u6267\u884csh.status()\u547d\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u786e\u8ba4\u5728\u672c\u6b21\u60c5\u51b5\u4e2d\uff0c\u6bcf\u4e2a\u5206\u7247\u5206\u914d\u4e8610\u81f311\u4e2a\u5757\u3002\u540c\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8be5\u547d\u4ee4\u66f4\u8be6\u7ec6\u5730\u67e5\u770b\u6bcf\u4e2a\u5206\u7247\u548c\u5757\u7684\u4fe1\u606f\u3002<br \/>\n\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6765\u786e\u8ba4\u5757\u7684\u5212\u5206\u548c\u8fc1\u79fb\u60c5\u51b5\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u5757\u7684\u5212\u5206\u53d1\u751f\u4e8620\u6b21\uff0c\u540c\u65f6\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u5668\u8fdb\u884c\u4e866\u6b21\u5757\u7684\u8fc1\u79fb\u3002<\/p>\n<pre class=\"post-pre\"><code>&gt; db.changelog.count({what: \"split\"})\r\n20\r\n&gt; db.changelog.find({what: \"moveChunk.commit\"}).count()\r\n6\r\n<\/code><\/pre>\n<h2>\u5728\u8fdb\u884cMongoDB\u5206\u7247\uff08Sharding\uff09\u65f6\u9700\u8981\u8003\u8651\u7684\u4e8b\u9879\u3002\u5728\u8fd9\u4e00\u90e8\u5206\uff0c\u6211\u4eec\u901a\u8fc7\u5b9e\u9645\u6837\u4f8b\u6765\u89e3\u91caSharding\uff08\u5206\u7247\uff09\u7684\u5b9e\u73b0\u3002\u672c\u7ae0\u5c06\u8ba8\u8bba\u8bbe\u8ba1Sharding\uff08\u5206\u7247\uff09\u65f6\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u8981\u70b9\u3002\u8fd9\u4e9b\u8ba8\u8bba\u9002\u7528\u4e8e\u5728\u50cf\u4ee5\u592a\u574a\u7b49\u533a\u5757\u94fe\u4e2d\u8fdb\u884cSharding\uff08\u5206\u7247\uff09\u7684\u591a\u79cd\u60c5\u51b5\u3002<\/p>\n<h3>5-1. \u5728\u5206\u7247\uff08Sharding\uff09\u4e2d\u7684\u67e5\u8be2\u53ca\u5176\u7c7b\u578b\u5728Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u67e5\u8be2\u53ef\u4ee5\u5206\u6210\u4e24\u79cd\u7c7b\u578b\u3002\u4e00\u79cd\u662f\u4ec5\u5305\u542b\u5206\u7247\u952e\u7684\u7279\u5b9a\u67e5\u8be2\uff0c\u53e6\u4e00\u79cd\u662f\u4e0d\u5305\u542b\u5206\u7247\u952e\u7684\u5168\u5c40\u67e5\u8be2\u3002<\/p>\n<p>\u8bf7\u8bb0\u4f4f\uff0c\u4f7f\u7528\u5206\u7247\u952e\u6765\u51b3\u5b9a\u6bcf\u4e2a\u5206\u7247\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5757\u88ab\u5206\u914d\u5230\u54ea\u4e2a\u5206\u7247\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5728\u7b2c\u4e00\u4e2a\u67e5\u8be2\u7684\u60c5\u51b5\u4e0b\uff0cmongos\u80fd\u591f\u5feb\u901f\u627e\u5230\u5305\u542b\u67e5\u8be2\u7ed3\u679c\u96c6\u7684\u6570\u636e\u5c5e\u4e8e\u54ea\u4e2a\u5206\u7247\uff0c\u4f46\u5728\u7b2c\u4e8c\u4e2a\u67e5\u8be2\u7684\u60c5\u51b5\u4e0b\uff0c\u5fc5\u987b\u8bbf\u95ee\u6240\u6709\u5206\u7247\u6765\u67e5\u627e\u6570\u636e\u5757\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5728\u6267\u884c\u5168\u5c40\u67e5\u8be2\u65f6\uff0c\u6709\u65f6\u5728\u6267\u884c\u67e5\u8be2\u4e4b\u524d\u751f\u6210\u7d22\u5f15\u4f1a\u66f4\u597d\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7\u751f\u6210&#8221;updated_at: 1&#8243;\u7d22\u5f15\u6765\u663e\u8457\u63d0\u9ad8\u67e5\u8be2\u6700\u65b0\u6587\u6863\u7684\u6548\u7387\u3002<\/p>\n<h3>5-2. \u5728\u5206\u7247\uff08Sharding\uff09\u4e2d\u9009\u62e9\u5206\u7247\u952e\u7684\u65b9\u6cd5\u4e00\u65e6\u51b3\u5b9a\u7684\u5206\u7247\u952e\u65e0\u6cd5\u66f4\u6539\uff0c\u800c\u4e14\u63d2\u5165\u548c\u67e5\u8be2\uff08\u5199\u5165\u548c\u8bfb\u53d6\uff09\u7684\u6027\u80fd\u5f88\u5927\u7a0b\u5ea6\u4e0a\u53d6\u51b3\u4e8e\u662f\u5426\u6b63\u786e\u8bbe\u7f6e\u5206\u7247\u952e\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u8ba8\u8bba\u8fdb\u884c\u5206\u7247\u65f6\u7406\u60f3\u7684\u5206\u7247\u952e\u8bbe\u7f6e\u65b9\u6cd5\u3002<\/p>\n<p>\u9996\u5148\uff0c\u4e0d\u9002\u5f53\u7684\u788e\u7247\u5bc6\u94a5\u662f\u6307\u4ec0\u4e48\u6837\u7684\uff1f<\/p>\n<h4>\u25cbSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3067\u30c7\u30fc\u30bf\u5206\u6563\u304c\u5341\u5206\u306b\u884c\u308f\u308c\u306a\u3044\u4f8b\u3048\u3070\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306e\u3088\u3046\u306a\u5358\u8abf\u306b\u5897\u52a0\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3068\u3057\u305f\u5834\u5408\u3092\u8003\u3048\u3066\u307f\u3066\u307b\u3057\u3044\u3002\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u304c\u9023\u7d9a\u3057\u305f\u7bc4\u56f2\u304c\u30c1\u30e3\u30f3\u30af\u3068\u3057\u3066\u5206\u3051\u3089\u308c\u308b\u305f\u3081\u3001\u65b0\u3057\u3044\u633f\u5165\u306f\u5168\u3066\u9023\u7d9a\u3057\u305f\u72ed\u3044\u7bc4\u56f2\u5185\u3067\u884c\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>\u6240\u6709\u8fd9\u6837\u7684\u63d2\u5165\u90fd\u88ab\u5206\u914d\u7ed9\u4e00\u4e2achunk\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u5c31\u662f\u8d1f\u8f7d\u4f1a\u96c6\u4e2d\u5728\u4e00\u4e2ashard\u4e0a\u3002\u8fd9\u65e0\u6cd5\u5b9e\u73b0\u539f\u672cSharding\u7684\u76ee\u7684\u3002<\/p>\n<h4>\u5206\u7247\uff08Sharding\uff09\u4e0a\u7684\u672c\u5730\u6027\u4e0d\u8db3\u3002\u5148\u306b\u8ff0\u3079\u305f\u3088\u3046\u306b\u3001\u5897\u52a0\u3057\u3066\u3044\u304f\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306f\u660e\u3089\u304b\u306a\u65b9\u5411\u6027\u3092\u3082\u3064\u3002\u4e00\u65b9\u3001\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306a\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306f\u5168\u304f\u65b9\u5411\u6027\u3092\u3082\u305f\u306a\u3044\u3002\u524d\u8005\u306f\u5206\u6563\u304c\u4e0d\u5341\u5206\u3068\u306a\u308b\u304c\u3001\u5f8c\u8005\u306f\u5206\u6563\u3055\u305b\u3059\u304e\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u3053\u306e\u5834\u5408\u3082Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u306b\u304a\u3051\u308b\u52b9\u7387\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u3002\u3053\u308c\u306f\u76f4\u611f\u7684\u306b\u306f\u308f\u304b\u3089\u306a\u3044\u304c\u3001\u30ed\u30fc\u30ab\u30ea\u30c6\u30a3\u3092\u8003\u616e\u3059\u308c\u3070\u7406\u89e3\u3067\u304d\u308b\u3002<\/p>\n<p>\u3053\u3053\u3067\u306e\u30ed\u30fc\u30ab\u30ea\u30c6\u30a3\u306e\u6982\u5ff5\u306f\u3001\u300c\u3042\u308b\u671f\u9593\u5185\u306b\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u591a\u304f\u306e\u5834\u5408\u95a2\u9023\u6027\u304c\u3042\u308b\u300d\u3068\u3044\u3046\u3053\u3068\u3092\u6307\u3059\u3002\u3053\u306e\u8fd1\u63a5\u6027\u306f\u3064\u307e\u308a\u3001\u6700\u9069\u5316\u306e\u4f59\u5730\u304c\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3002\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u30c7\u30fc\u30bf\u306eSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3092\u884c\u3048\u3070\u3001\u4f55\u5ea6\u3082\u5168\u3066\u306e\u30b7\u30e3\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5fc5\u8981\u304c\u751f\u307e\u308c\u308b\u3002\u3057\u304b\u3057\u3001\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fcID\u306e\u3088\u3046\u306a\u4e00\u6bb5\u968e\u7c92\u5ea6\u306e\u8352\u3044\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3092\u7528\u3044\u305f\u5834\u5408\u3001\u5c11\u6570\u3082\u3057\u304f\u306f\u4e00\u3064\u306e\u30b7\u30e3\u30fc\u30c9\u3068\u901a\u4fe1\u3092\u884c\u3046\u3060\u3051\u3067\u6e08\u307f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5927\u304d\u304f\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<h4>\u25cbSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u5185\u306e\u30c1\u30e3\u30f3\u30af\u304c\u5341\u5206\u306b\u5206\u5272\u3067\u304d\u306a\u3044\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u304c\u7c97\u904e\u304e\u308b\u3068\u3001\u30c1\u30e3\u30f3\u30af\u306e\u5206\u5272\u304c\u5341\u5206\u306b\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u3002\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fcID\u306e\u307f\u3092\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306b\u9078\u3076\u3068\u3001\u4f55\u767e\u4e07\u56de\u3082\u306e\u30a2\u30af\u30bb\u30b9\u3092\u884c\u3046\u4e00\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u3044\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u3053\u306e\u5834\u5408\u3001\u30c1\u30e3\u30f3\u30af\u304c\u5206\u5272\u3067\u304d\u305a\u3001\u30b7\u30e3\u30fc\u30c9\u9593\u306e\u30c7\u30fc\u30bf\u3084\u8ca0\u8377\u304c\u30a2\u30f3\u30d0\u30e9\u30f3\u30b9\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u6050\u308c\u304c\u3042\u308b\u3002<\/p>\n<h3>\u5728Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u7406\u60f3\u7684\u5206\u7247\u952e\u6839\u636e\u4ee5\u4e0a\u6240\u8ff0\uff0c\u6211\u4eec\u80fd\u591f\u7406\u89e3\u7406\u60f3\u7684\u5206\u7247\u952e\u5e94\u8be5\u5177\u5907\u54ea\u4e9b\u7279\u5f81\u3002\u6700\u4f73\u7684\u5206\u7247\u952e\u5e94\u6ee1\u8db3\u4ee5\u4e0b\u7279\u5f81\uff1a<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u633f\u5165\u304c\u30b7\u30e3\u30fc\u30c9\u9593\u3067\u5747\u7b49\u306b\u5206\u6563\u3055\u305b\u3089\u308c\u308b\u304b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>CRUD\u64cd\u4f5c\u306b\u304a\u3044\u3066\u30ed\u30fc\u30ab\u30ea\u30c6\u30a3\u306e\u5229\u70b9\u3092\u6d3b\u304b\u305b\u308b\u304b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30c1\u30e3\u30f3\u30af\u304c\u5206\u5272\u53ef\u80fd\u306a\u7c92\u5ea6\u3067\u3042\u308b\u304b<\/ol>\n<p>\u3053\u308c\u3089\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306f\u3001\u6982\u3057\u3066\u4e8c\u3064\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304b\u3089\u69cb\u6210\u3055\u308c\u308b\u3082\u306e\u3067\u3001\u4e00\u3064\u76ee\u306f\u7c97\u3044\u7c92\u5ea6\u3001\u4e8c\u3064\u76ee\u306f\u7d30\u304b\u3044\u7c92\u5ea6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u9078\u629e\u3055\u308c\u308b\u3002\u4eca\u56de\u306e\u4f8b\u3067\u306f{username: 1, _id: 1} \u3068\u3044\u3046\u8907\u5408\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3092\u4f7f\u3063\u305f\u304c\u3001\u3053\u308c\u306f\u3001\u4e00\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u3069\u308c\u3060\u3051\u5927\u91cf\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u30c1\u30e3\u30f3\u30af\u306e\u5206\u5272\u53ef\u80fd\u6027\u3092\u4fdd\u8a3c\u3067\u304d\u308b\u3088\u3046\u306a\u6700\u9069\u306a\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3067\u3042\u308b\u3068\u3044\u3048\u308b\u3002<\/p>\n<h3>5-3. \u5728Sharding\uff08\u5206\u7247\uff09\u4e0a\u7684\u90e8\u7f72\u5728\u914d\u7f6e\u8fdb\u7a0b\u7684\u65b9\u5f0f\u4e5f\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u95ee\u9898\u3002\u5982\u679c\u8981\u4e3a\u8bbe\u7f6e\u670d\u52a1\u5668\u548cmongos\u7b49\u6240\u6709\u5185\u5bb9\u63d0\u4f9b\u72ec\u7acb\u7684\u673a\u5668\uff0c\u90a3\u4e48\u6210\u672c\u5c06\u975e\u5e38\u9ad8\u3002\u7136\u800c\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u5e76\u4e0d\u9700\u8981\u8fd9\u6837\uff0c\u53ea\u8981\u6ee1\u8db3\u4ee5\u4e0b\u6700\u4f4e\u6761\u4ef6\uff0c\u5c31\u53ef\u4ee5\u4fdd\u6301\u4e00\u5b9a\u7684\u5bb9\u9519\u6027\u3002\uff08\u6709\u5173\u5bb9\u9519\u6027\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u201c\u5728\u6784\u6210\u533a\u5757\u94fe\u7684\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u5bb9\u9519\u6027\u201d\u4e00\u6587\u3002\uff09<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u4e00\u3064\u306e\u30b7\u30e3\u30fc\u30c9\u53ca\u3073\u30ec\u30d7\u30ea\u30ab\u30bb\u30c3\u30c8\u306e\u5404\u30e1\u30f3\u30d0\u30fc\u306f\u3001\u305d\u308c\u304c\u5b8c\u5168\u306a\u30ec\u30d7\u30ea\u30ab\u306a\u306e\u304b\u3001\u30a2\u30fc\u30d3\u30bf\u30fc\u306a\u306e\u304b\u306b\u5bc4\u3089\u305a\u3001\u5225\u3005\u306e\u30de\u30b7\u30f3\u306b\u7f6e\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u5168\u3066\u306e\u30ec\u30d7\u30ea\u30ab\u30bb\u30c3\u30c8\u306e\u30e1\u30f3\u30d0\u30fc\u306b\u306f\u3001\u5c02\u7528\u306e\u30de\u30b7\u30f3\u3092\u5272\u308a\u5f53\u3066\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30ec\u30d7\u30ea\u30ab\u30bb\u30c3\u30c8\u306e\u30a2\u30fc\u30d3\u30bf\u30fc\u306f\u8efd\u91cf\u306a\u306e\u3067\u3001\u4ed6\u306e\u30d7\u30ed\u30bb\u30b9\u3068\u5171\u5b58\u3055\u305b\u3066\u3082\u826f\u3044\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u8a2d\u5b9a\u30b5\u30fc\u30d0\u306f\u3001\u30de\u30b7\u30f3\u3092\u4ed6\u3068\u5171\u7528\u3057\u3066\u3082\u69cb\u308f\u306a\u3044\u3002\u8a2d\u5b9a\u30af\u30e9\u30b9\u30bf\u4e2d\u306e\u3059\u3079\u3066\u306e\u8a2d\u5b9a\u30b5\u30fc\u30d0\u7fa4\u306f\u3001\u5225\u3005\u306e\u30de\u30b7\u30f3\u4e0a\u306b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/ol>\n<p>\u4f8b\u3048\u3070\u3001\u4eca\u56de\u306e\u30b5\u30f3\u30d7\u30eb\u306b\u304a\u3051\u308b\u5b9f\u88c5\u4f8b\u3067\u306f\u3001\u5fc5\u8981\u306a\u30d7\u30ed\u30bb\u30b9\u306f9\u3064\u3060\u3063\u305f\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b4\u3064\u306e\u30de\u30b7\u30f3\u3092\u7528\u610f\u3059\u308c\u3070\u5341\u5206\u3067\u3042\u308b\u3002\u3082\u3057\u3001\u9ad8\u3044\u53ef\u7528\u6027\u3084\u4fdd\u5b88\u6027\u304c\u6c42\u3081\u3089\u308c\u308b\u3088\u3046\u306a\u30b5\u30fc\u30d3\u30b9\u306b\u304a\u3044\u3066\u306f\u3001\u30a2\u30fc\u30d3\u30bf\u30fc\u3092\u901a\u5e38\u306e\u30ce\u30fc\u30c9\u3068\u3057\u3001\u5404\u30b7\u30e3\u30fc\u30c9\u5185\u306b\u4e09\u3064\u306e\u30ce\u30fc\u30c9\u3092\u7528\u610f\u3059\u308b\u3053\u3068\u3067\u30ea\u30ab\u30d0\u30ea\u304c\u52b9\u304f\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"09fig04.jpg\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/121-0.\/attachments\/cfd92c96-f160-4d83-a2b4-32dfd9487e6d\" alt=\"undefined\" \/><\/p>\n<blockquote><p>\u300aMongoDB\u5b9e\u6218\u300b\uff08\u7b2c\u4e5d\u7ae0 \u5206\u7247\uff09<\/p><\/blockquote>\n<h3>5-4. \u5728\u5206\u7247\uff08Sharding\uff09\u65f6\u6dfb\u52a0\u65b0\u7684\u5206\u7247\u3002\u65b0\u3057\u3044\u30b7\u30e3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u969b\u306f\u3001\u30d0\u30e9\u30f3\u30b5\u30fc\u306b\u3088\u3063\u3066\u53e4\u3044\u30b7\u30e3\u30fc\u30c9\u304b\u3089\u30c1\u30e3\u30f3\u30af\u3092\u79fb\u884c\u3057\u3066\u65b0\u3057\u3044\u30b7\u30e3\u30fc\u30c9\u306b\u3082\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u3053\u306e\u6642\u3001\u4f8b\u3048\u3070MondoDB\u306b\u304a\u3044\u3066\u306f\u30d0\u30e9\u30f3\u30b5\u30fc\u306b\u3088\u308b\u30c1\u30e3\u30f3\u30af\u306e\u79fb\u884c\u306f\u73fe\u72b6\u4e00\u3064\u305a\u3064\u3057\u304b\u884c\u3048\u306a\u3044\u305f\u3081\u3001\u591a\u5927\u306a\u6642\u9593\u3092\u8981\u3059\u308b\u4e8b\u306b\u306a\u308b\u3002Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u304c\u7570\u5e38\u3092\u304d\u305f\u3055\u306a\u3044\u3088\u3046\u3001\u5fc5\u8981\u306a\u969b\u306f\u65e9\u3044\u6bb5\u968e\u3067\u30b7\u30e3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u3068\u306a\u308b\u3002<\/p>\n<h2>6. Ethereum\uff08\u30a4\u30fc\u30b5\u30ea\u30a2\u30e0\uff09\u3092\u306f\u3058\u3081\u3068\u3057\u305f\u30d6\u30ed\u30c3\u30af\u30c1\u30a7\u30fc\u30f3\u306eSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09MongoDB\u4e0a\u306eSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3068\u306e\u6bd4\u8f03\u3057\u306a\u304c\u3089\u3001Ethereum\u306e\u3088\u3046\u306a\u30d6\u30ed\u30c3\u30af\u30c1\u30a7\u30fc\u30f3\u3067Sharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u3092\u884c\u3063\u305f\u5834\u5408\u3001\u3069\u306e\u3088\u3046\u306b\u306a\u308b\u304b\u3092\u8003\u3048\u3066\u3044\u304f\u3002<\/p>\n<h3>6-1. \u5206\u6563\u7cfb\u7edf \u00d7 \u5206\u6563\u7cfb\u7edf\u533a\u5757\u94fe\u662f\u4e00\u79cd\u7531\u591a\u4e2a\u8282\u70b9\u5904\u7406\u4ea4\u6613\u7684\u5206\u5e03\u5f0f\u7cfb\u7edf\u3002\u800c\u5206\u7247\u4e5f\u6b63\u5982\u4e4b\u524d\u6240\u8ff0\uff0c\u662f\u5c06\u6570\u636e\u5e93\u5206\u5272\u6210\u5757\u5e76\u5c06\u6574\u4e2a\u7cfb\u7edf\u5206\u6563\u5316\u7684\u6280\u672f\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u901a\u8fc7\u5728\u4ee5\u592a\u574a\u7b49\u533a\u5757\u94fe\u4e0a\u8fdb\u884c\u5206\u7247\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u5206\u5e03\u5f0f\u7cfb\u7edf\u5206\u6563\u5316\u7684\u884c\u4e3a\u3002<\/p>\n<p>\u5728\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u63d0\u5230\u4e86\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u5b9e\u73b0\u4e00\u81f4\u6027\u7684\u590d\u5236\u3001\u540c\u6b65\u4ee5\u53ca\u5bb9\u9519\u6027\u7684\u91cd\u8981\u6027\uff0c\u5e76\u89e3\u91ca\u4e86\u5176\u4e2d\u6240\u4f34\u968f\u7684\u590d\u6742\u6027\u548c\u56f0\u96be\u6027\u3002\u8981\u5b9e\u73b0\u5206\u5e03\u5f0f\u7cfb\u7edf\uff0c\u9700\u8981\u8fdb\u884c\u66f4\u7cbe\u5bc6\u7684\u7cfb\u7edf\u8bbe\u8ba1\u3002<\/p>\n<p>\u5c24\u5176\u662f\u5728\u5904\u7406\u50cf\u52a0\u5bc6\u8d27\u5e01\u8fd9\u6837\u6709\u7740\u91cd\u8981\u4ef7\u503c\u7684\u533a\u5757\u94fe\u65f6\uff0c\u7f51\u7edc\u7834\u574f\u5982\u53cc\u91cd\u652f\u4ed8\u5373\u4f7f\u51fa\u73b0\u4e00\u4e01\u70b9\uff0c\u4e5f\u662f\u81f4\u547d\u7684\uff0c\u56e0\u6b64\u975e\u5e38\u9700\u8981\u4e25\u683c\u7684\u5bb9\u9519\u6027\u3002<\/p>\n<h3>6-2. \u5728\u533a\u5757\u94fe\u7684\u5206\u7247\u4e2d\uff0c\u5207\u7247\u4e4b\u95f4\u7684\u901a\u4fe1\u548c\u540c\u6b65\u5728MongoDB\u7684Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u5c06\u6570\u636e\u5206\u914d\u5230\u5404\u4e2a\u5206\u7247\u5e76\u4fdd\u5b58\u8d77\u6765\u5373\u53ef\u3002\u7136\u800c\uff0c\u533a\u5757\u94fe\u6d89\u53ca\u5904\u7406\u8d26\u6237\u3001\u4ea4\u6613\u548c\u667a\u80fd\u5408\u7ea6\u3002\u8fd9\u4e9b\u4e0d\u662f\u72ec\u7acb\u5b58\u5728\u7684\u6570\u636e\uff0c\u800c\u662f\u5f7c\u6b64\u4e4b\u95f4\u6709\u673a\u5f71\u54cd\u7684\u6570\u636e\u3002\u4f8b\u5982\uff0c\u5728\u667a\u80fd\u5408\u7ea6\u5411\u591a\u4e2a\u8d26\u6237\u8fdb\u884c\u5e01\u7684\u652f\u4ed8\u65f6\uff0c\u7ecf\u5e38\u9700\u8981\u8de8\u5206\u7247\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u5728\u6bd4\u7279\u5e01\u548c\u4ee5\u592a\u574a\u7b49\u533a\u5757\u94fe\u7cfb\u7edf\u4e2d\uff0c\u4e3a\u4e86\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e0a\u8fdb\u884c\u540c\u6b65\uff0c\u91c7\u7528\u4e86\u8fd1\u4f3c\u4e8e\u5206\u5e03\u5f0f\u7b97\u6cd5\u7684\u6392\u4ed6\u63a7\u5236\u548c\u9886\u5bfc\u8005\u9009\u4e3e\u7b97\u6cd5\u6765\u8fbe\u6210\u5171\u8bc6\u3002\u5f53\u5728\u533a\u5757\u94fe\u4e0a\u8fdb\u884c\u5206\u7247\uff08Sharding\uff09\u65f6\uff0c\u9664\u4e86\u5728\u5404\u5206\u7247\u5185\u8fdb\u884c\u7b26\u5408\u5171\u8bc6\u7b97\u6cd5\u7684\u540c\u6b65\u901a\u4fe1\u5916\uff0c\u8fd8\u9700\u8981\u5728\u5206\u7247\u4e4b\u95f4\u8fdb\u884c\u540c\u6b65\u901a\u4fe1\u3002\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u5206\u7247\u95f4\u901a\u4fe1\u95ee\u9898\u3002\u5728\u4ee5\u592a\u574a\u4e2d\uff0c\u8ba8\u8bba\u5df2\u7ecf\u671d\u7740\u901a\u8fc7\u4ea4\u6362\u65e5\u5fd7\u4fe1\u606f\uff08receipt\uff09\u800c\u975e\u72b6\u6001\u4f20\u8f93\u7684\u65b9\u5f0f\u8fdb\u884c\u5206\u7247\u95f4\u901a\u4fe1\u3002<\/p>\n<h3>\u5728\u533a\u5757\u94fe\u7684\u5206\u7247\u6280\u672f\u4e2d\uff0c\u5355\u4e00\u5206\u7247\u5185\u7684\u53bb\u4e2d\u5fc3\u5316\u7684\u9700\u6c42\u3002\u53e6\u5916\uff0c\u5728MongoDB\u7684Sharding\u4e2d\uff0c\u53ea\u9700\u8981\u6ce8\u610f\u6570\u636e\u7684\u5206\u914d\u5373\u53ef\u3002\u7136\u800c\uff0c\u5728\u50cf\u4ee5\u592a\u574a\u8fd9\u6837\u7684\u533a\u5757\u94fe\u7684Sharding\u4e2d\uff0c\u540c\u65f6\u4e5f\u9700\u8981\u8003\u8651\u5982\u4f55\u5206\u914d\u6bcf\u4e2a\u8282\u70b9\u3002<\/p>\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5728\u533a\u5757\u94fe\u4e2d\u901a\u8fc7\u53cc\u91cd\u652f\u4ed8\u7b49\u624b\u6bb5\u8fdb\u884c\u7be1\u6539\uff0c\u9700\u8981PoW\u65f6\u9700\u8981\u8fbe\u5230\u7f51\u7edc\u6574\u4f53\u8ba1\u7b97\u91cf\u768451%\u7684\u5171\u8c0b\u3002\u5728\u5927\u89c4\u6a21\u7f51\u7edc\u4e2d\uff0c\u8fd9\u5e76\u4e0d\u5bb9\u6613\uff0c\u4f46Sharding\uff08\u5206\u7247\uff09\u7684\u60c5\u51b5\u5374\u4e0d\u540c\u3002\u5728\u4e00\u4e2a\u88ab\u5206\u6210100\u4e2a\u5206\u7247\u7684\u7f51\u7edc\u4e2d\uff0c\u53ea\u9700\u8981\u8fbe\u5230\u6574\u4f53\u8ba1\u7b97\u91cf\u76841%\u5373\u53ef\u5bf9\u5206\u7247\u5185\u7684\u6570\u636e\u8fdb\u884c\u7be1\u6539\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"1_oFqPmM3MX9plcAZLGHr1PQ.png\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/137-1.\/attachments\/864c0e70-ae6c-49bd-992c-744759ef42ff\" alt=\"undefined\" \/><\/p>\n<blockquote><p>\u4ee5\u4e0b\u662f\u4e2d\u6587\u7684\u4e00\u4e2a\u9009\u9879\uff1a<\/p>\n<p>https:\/\/medium.com\/@icebearhww\/ethereum-sharding-and-finality-65248951f649 \u7684\u5185\u5bb9\u53ef\u4ee5\u7b80\u8ff0\u5982\u4e0b\u3002<\/p><\/blockquote>\n<p>\u56e0\u6b64\uff0c\u4ee5\u592a\u574a\u7684\u8bbe\u8ba1\u8003\u8651\u4e86\u8282\u70b9\u9a8c\u8bc1\u79f0\u4e3a\u201c\u9a8c\u8bc1\u5668\u201d\u7684\u4ea4\u6613\u7684\u968f\u673a\u6392\u5217\u3002\u5728Zilliqa\u4e2d\uff0c\u9664\u4e86\u6bcf\u4e2a\u7eaa\u5143\u90fd\u4f1a\u6301\u7eed\u5bf9\u77ff\u5de5\u8fdb\u884c\u968f\u673a\u6392\u5217\uff0c\u8fd8\u91c7\u7528\u4e86\u5f15\u5165PBFT\u578b\u5171\u8bc6\u7b97\u6cd5\u7684\u591a\u7b7e\u540d\u673a\u5236\uff0c\u4ee5\u9632\u6b62\u5206\u5c94\u73b0\u8c61\u53d1\u751f\u3002<\/p>\n<h3>\u5728\u533a\u5757\u94fe\u7684Sharding\uff08\u5206\u7247\uff09\u4e2d\uff0c\u9009\u62e9\u9002\u5f53\u7684\u5206\u7247\u952e\u548c\u5757\u7684\u5206\u914d\u65b9\u5f0f\u3002\u30d6\u30ed\u30c3\u30af\u30c1\u30a7\u30fc\u30f3\u3067\u306eSharding\uff08\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09\u306b\u304a\u3044\u3066\u9069\u5207\u306a\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306e\u8a2d\u5b9a\u3068\u306f\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u308d\u3046\u304b\u3002MongoDB\u3067\u306e\u9069\u5207\u306a\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u3068\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7279\u5fb4\u3092\u6301\u3064\u3082\u306e\u3067\u3042\u3063\u305f\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u633f\u5165\u304c\u30b7\u30e3\u30fc\u30c9\u9593\u3067\u5747\u7b49\u306b\u5206\u6563\u3055\u305b\u3089\u308c\u308b\u304b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>CRUD\u64cd\u4f5c\u306b\u304a\u3044\u3066\u30ed\u30fc\u30ab\u30ea\u30c6\u30a3\u306e\u5229\u70b9\u3092\u6d3b\u304b\u305b\u308b\u304b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30c1\u30e3\u30f3\u30af\u304c\u5206\u5272\u53ef\u80fd\u306a\u7c92\u5ea6\u3067\u3042\u308b\u304b<\/ol>\n<p>\u5728\u533a\u5757\u94fe\u7684\u5206\u7247\u6280\u672f\uff08Sharding\uff09\u4e2d\uff0c\u8fd9\u4e9b\u6761\u4ef6\u4e5f\u662f\u4e00\u6837\u7684\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u533a\u5757\u94fe\u9700\u8981\u5177\u5907\u9ad8\u5ea6\u5bb9\u9519\u6027\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u8fdb\u4e00\u6b65\u6ee1\u8db3\u9632\u6b62\u7f51\u7edc\u7834\u574f\uff08\u5982\u53cc\u91cd\u652f\u4ed8\uff09\u7684\u6761\u4ef6\u3002<\/p>\n<p>Zilliqa\u3067\u306f\u3001\u30b7\u30e3\u30fc\u30c9\u30ad\u30fc\u306e\u9078\u629e\u306b\u3064\u3044\u3066\u4e00\u3064\u306e\u89e3\u3092\u51fa\u3057\u3066\u3044\u308b\u3002\u9001\u4fe1\u8005\u306e\u30a2\u30c9\u30ec\u30b9\u306b\u57fa\u3065\u3044\u3066\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u5404\u30b7\u30e3\u30fc\u30c9\u306b\u632f\u308a\u5206\u3051\u308b\u3068\u3057\u3066\u3044\u308b\u306e\u3067\u3042\u308b\u3002\u3053\u306e\u6642\u3001\u5358\u4e00\u306e\u9001\u4fe1\u8005\u306b\u3088\u308b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306f\u3001\u5e38\u306b\u540c\u3058\u30b7\u30e3\u30fc\u30c9\u5185\u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u30b7\u30e3\u30fc\u30c9\u5185\u306e\u30b3\u30f3\u30bb\u30f3\u30b5\u30b9\u304c\u660e\u78ba\u306b\u53d6\u308c\u3066\u3044\u308c\u3070\u3001\u30b7\u30e3\u30fc\u30c9\u9593\u901a\u4fe1\u304c\u9045\u308c\u3066\u3044\u3066\u3082\u4e8c\u91cd\u652f\u6255\u3044\u554f\u984c\u3092\u9632\u6b62\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u7136\u800c\uff0c\u901a\u8fc7\u8fd9\u79cd\u5206\u7247\u952e\u8bbe\u7f6e\uff0c\u5f53\u4e00\u4e2a\u7528\u6237\u540c\u65f6\u6267\u884c\u5927\u91cf\u7684\u5199\u5165\u548c\u8bfb\u53d6\u64cd\u4f5c\u65f6\uff0c\u5c06\u4f1a\u5411\u4e00\u4e2a\u5206\u7247\u53d1\u9001\u6781\u7aef\u7684\u4e8b\u52a1\u3002\u56e0\u6b64\uff0c\u5728MongoDB\u4e2d\uff0c\u901a\u8fc7\u8bbe\u7f6e\u4e8b\u52a1ID\u548c\u7528\u6237\u540d\u7684\u590d\u5408\u5206\u7247\u952e\uff0c\u53ef\u4ee5\u5c06\u5206\u5757\u8fdb\u884c\u5212\u5206\u3002\u7136\u800c\uff0c\u5982\u679c\u5c06\u4e00\u4e2a\u53d1\u9001\u8005\u7684\u4e8b\u52a1\u5206\u6563\u5230\u591a\u4e2a\u5206\u7247\u4e2d\uff0c\u5c31\u4f1a\u589e\u52a0\u53cc\u91cd\u652f\u4ed8\u7684\u98ce\u9669\uff0c\u5982\u524d\u6240\u8ff0\u3002\u5728\u533a\u5757\u94fe\u4e2d\uff0c\u4eba\u4eec\u666e\u904d\u8ba4\u4e3a\u5e94\u8be5\u727a\u7272\u4e00\u4e9b\u6548\u7387\uff0c\u4ee5\u4fdd\u6301\u9ad8\u5bb9\u9519\u6027\u3002<\/p>\n<p>\u4ec5\u9700\u8981\u4e00\u79cd\u9009\u62e9\uff0c\u4ee5\u4e0b\u662f\u539f\u6587\u7684\u6c49\u8bed\u672c\u5730\u5316\u91ca\u4e49\uff1a<\/p>\n<p>The text should be fully available in either American or British English, providing the full range of options.<\/p>\n<blockquote><p>\u300aMongoDB\u5b9e\u6218\u300b<\/p>\n<p>https:\/\/livebook.manning.com\/#!\/book\/mongodb-in-action\/chapter-9\/1<\/p>\n<p>\u4ee5\u592a\u574a\u7ef4\u57fa\u788e\u7247\u5316\uff08Sharding\uff09<\/p>\n<p>https:\/\/github.com\/ethereum\/wiki\/wiki\/Sharding-introduction-R&#038;D-compendium<\/p>\n<p>Zilliqa\u767d\u76ae\u4e66<\/p>\n<p>https:\/\/docs.zilliqa.com\/whitepaper.pdf<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>0. \u76ee\u5f55 \u9996\u5148\uff0c &nbsp; Sharding\uff08\u5206\u7247\uff09\u7684\u6982\u8ff0\uff1b &nbsp; MongoDB\u7684Shardi [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-29998","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eetehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eetehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-08T02:59:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T08:58:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/11-0.\/attachments\/e33b6b72-869a-4058-9ebb-ab1bcfbdb4bc\" \/>\n<meta name=\"author\" content=\"\u79d1, \u9896\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u9896\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/\",\"name\":\"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-08T02:59:42+00:00\",\"dateModified\":\"2025-08-12T08:58:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\"},\"description\":\"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\",\"name\":\"\u79d1, \u9896\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u9896\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83 - Blog - Silicon Cloud","description":"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eetehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4-2\/","og_locale":"zh_CN","og_type":"article","og_title":"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83","og_description":"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eetehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-08T02:59:42+00:00","article_modified_time":"2025-08-12T08:58:56+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d052837434c4406bd837e\/11-0.\/attachments\/e33b6b72-869a-4058-9ebb-ab1bcfbdb4bc"}],"author":"\u79d1, \u9896","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u9896","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/","name":"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-08T02:59:42+00:00","dateModified":"2025-08-12T08:58:56+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e"},"description":"\u5173\u4e8eMongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"MongoDB\u5206\u7247\u7684\u5b9e\u4f8b\u5b9e\u65bd\uff0c\u4ee5\u53ca\u4e0eEtehreum\uff08\u4ee5\u592a\u574a\uff09\u5206\u7247\u7684\u6bd4\u8f83"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e","name":"\u79d1, \u9896","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","caption":"\u79d1, \u9896"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/mongodb%e5%88%86%e7%89%87%e7%9a%84%e5%ae%9e%e4%be%8b%e5%ae%9e%e6%96%bd%ef%bc%8c%e4%bb%a5%e5%8f%8a%e4%b8%8eetehreum%ef%bc%88%e4%bb%a5%e5%a4%aa%e5%9d%8a%ef%bc%89%e5%88%86%e7%89%87%e7%9a%84%e6%af%94-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=29998"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29998\/revisions"}],"predecessor-version":[{"id":111633,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/29998\/revisions\/111633"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=29998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=29998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=29998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}