{"id":81398,"date":"2024-10-16T15:28:19","date_gmt":"2024-10-16T07:28:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/81398\/"},"modified":"2024-10-16T15:28:19","modified_gmt":"2024-10-16T07:28:19","slug":"nosql%e7%94%9f%e6%85%8b%e7%b3%bb%e7%b5%b1%e5%a4%a7%e6%aa%a2%e9%96%b1-%e4%b8%8d%e5%90%8c%e7%89%b9%e6%80%a7%e5%a4%a7%e6%af%94%e6%8b%bc","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/81398\/","title":{"rendered":"NoSQL\u751f\u614b\u7cfb\u7d71\u5927\u6aa2\u95b1 \u4e0d\u540c\u7279\u6027\u5927\u6bd4\u62fc"},"content":{"rendered":"<h1 id=\"nosql%e7%94%9f%e6%85%8b%e7%b3%bb%e7%b5%b1%e5%a4%a7%e6%aa%a2%e9%96%b1-%e4%b8%8d%e5%90%8c%e7%89%b9%e6%80%a7%e5%a4%a7%e6%af%94%e6%8b%bc-BDPrGWhLoG\">NoSQL\u751f\u614b\u7cfb\u7d71\u5927\u6aa2\u95b1 \u4e0d\u540c\u7279\u6027\u5927\u6bd4\u62fc<\/h1>\n<p>\u96a8\u8457\u6578\u64da\u91cf\u7684\u6025\u5287\u589e\u9577\uff0c\u50b3\u7d71\u7684\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u5728\u8655\u7406\u5927\u898f\u6a21\u6578\u64da\u6642\u9762\u81e8\u8457\u6311\u6230\u3002\u9019\u4fc3\u4f7f\u4e86NoSQL\u6578\u64da\u5eab\u7684\u8208\u8d77\uff0c\u9019\u985e\u6578\u64da\u5eab\u4ee5\u5176\u9748\u6d3b\u6027\u548c\u53ef\u64f4\u5c55\u6027\u800c\u53d7\u5230\u5ee3\u6cdb\u95dc\u6ce8\u3002\u672c\u6587\u5c07\u5c0dNoSQL\u751f\u614b\u7cfb\u7d71\u9032\u884c\u5168\u9762\u6aa2\u95b1\uff0c\u4e26\u6bd4\u8f03\u4e0d\u540c\u985e\u578b\u7684NoSQL\u6578\u64da\u5eab\u7279\u6027\u3002<\/p>\n<h2 id=\"nosql%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e9%a1%9e%e5%9e%8b-BDPrGWhLoG\">NoSQL\u6578\u64da\u5eab\u7684\u985e\u578b<\/h2>\n<p>NoSQL\u6578\u64da\u5eab\u4e3b\u8981\u53ef\u4ee5\u5206\u70ba\u4ee5\u4e0b\u5e7e\u7a2e\u985e\u578b\uff1a<\/p>\n<ul>\n<li><strong>\u9375\u503c\u5b58\u5132\uff08Key-Value Stores\uff09<\/strong><\/li>\n<li><strong>\u6587\u6a94\u5b58\u5132\uff08Document Stores\uff09<\/strong><\/li>\n<li><strong>\u5217\u65cf\u5b58\u5132\uff08Column Family Stores\uff09<\/strong><\/li>\n<li><strong>\u5716\u5f62\u6578\u64da\u5eab\uff08Graph Databases\uff09<\/strong><\/li>\n<\/ul>\n<h2 id=\"%e9%8d%b5%e5%80%bc%e5%ad%98%e5%84%b2-BDPrGWhLoG\">\u9375\u503c\u5b58\u5132<\/h2>\n<p>\u9375\u503c\u5b58\u5132\u662f\u6700\u7c21\u55ae\u7684NoSQL\u6578\u64da\u5eab\u985e\u578b\uff0c\u6578\u64da\u4ee5\u9375\u503c\u5c0d\u7684\u5f62\u5f0f\u5b58\u5132\u3002\u9019\u985e\u6578\u64da\u5eab\u7684\u512a\u52e2\u5728\u65bc\u5176\u9ad8\u6548\u7684\u67e5\u8a62\u6027\u80fd\u548c\u7c21\u55ae\u7684\u6578\u64da\u6a21\u578b\u3002<\/p>\n<pre><code>\n# Redis\u793a\u4f8b\nSET user:1000 \"John Doe\"\nGET user:1000\n<\/code><\/pre>\n<p>Redis\u548cDynamoDB\u662f\u5169\u500b\u6d41\u884c\u7684\u9375\u503c\u5b58\u5132\u7cfb\u7d71\u3002Redis\u4ee5\u5176\u9ad8\u6027\u80fd\u548c\u8c50\u5bcc\u7684\u6578\u64da\u7d50\u69cb\u800c\u805e\u540d\uff0c\u800cDynamoDB\u5247\u63d0\u4f9b\u4e86\u81ea\u52d5\u64f4\u5c55\u548c\u9ad8\u53ef\u7528\u6027\u3002<\/p>\n<h2 id=\"%e6%96%87%e6%aa%94%e5%ad%98%e5%84%b2-BDPrGWhLoG\">\u6587\u6a94\u5b58\u5132<\/h2>\n<p>\u6587\u6a94\u5b58\u5132\u6578\u64da\u5eab\u4ee5\u6587\u6a94\u7684\u5f62\u5f0f\u5b58\u5132\u6578\u64da\uff0c\u901a\u5e38\u4f7f\u7528JSON\u6216XML\u683c\u5f0f\u3002\u9019\u4f7f\u5f97\u6578\u64da\u7d50\u69cb\u66f4\u52a0\u9748\u6d3b\uff0c\u9069\u5408\u8655\u7406\u975e\u7d50\u69cb\u5316\u6578\u64da\u3002<\/p>\n<pre><code>\n# MongoDB\u793a\u4f8b\ndb.users.insert({ \"name\": \"John Doe\", \"age\": 30 })\ndb.users.find({ \"name\": \"John Doe\" })\n<\/code><\/pre>\n<p>MongoDB\u548cCouchDB\u662f\u5e38\u898b\u7684\u6587\u6a94\u5b58\u5132\u6578\u64da\u5eab\u3002MongoDB\u4ee5\u5176\u5f37\u5927\u7684\u67e5\u8a62\u529f\u80fd\u548c\u9748\u6d3b\u7684\u6578\u64da\u6a21\u578b\u800c\u53d7\u5230\u9752\u775e\uff0c\u800cCouchDB\u5247\u5c08\u6ce8\u65bc\u9ad8\u53ef\u7528\u6027\u548c\u5206\u4f48\u5f0f\u67b6\u69cb\u3002<\/p>\n<h2 id=\"%e5%88%97%e6%97%8f%e5%ad%98%e5%84%b2-BDPrGWhLoG\">\u5217\u65cf\u5b58\u5132<\/h2>\n<p>\u5217\u65cf\u5b58\u5132\u6578\u64da\u5eab\u5c07\u6578\u64da\u6309\u5217\u800c\u975e\u884c\u9032\u884c\u5b58\u5132\uff0c\u9019\u4f7f\u5f97\u5b83\u5011\u5728\u8655\u7406\u5927\u898f\u6a21\u6578\u64da\u6642\u5177\u6709\u512a\u52e2\u3002\u9019\u985e\u6578\u64da\u5eab\u7279\u5225\u9069\u5408\u5206\u6790\u548c\u67e5\u8a62\u5927\u91cf\u6578\u64da\u3002<\/p>\n<pre><code>\n# Apache Cassandra\u793a\u4f8b\nCREATE TABLE users (user_id UUID PRIMARY KEY, name TEXT, age INT);\n<\/code><\/pre>\n<p>Apache Cassandra\u548cHBase\u662f\u5169\u500b\u8457\u540d\u7684\u5217\u65cf\u5b58\u5132\u7cfb\u7d71\u3002Cassandra\u4ee5\u5176\u9ad8\u53ef\u7528\u6027\u548c\u53ef\u64f4\u5c55\u6027\u800c\u805e\u540d\uff0c\u800cHBase\u5247\u662f\u57fa\u65bcHadoop\u7684\u6578\u64da\u5eab\uff0c\u9069\u5408\u5927\u6578\u64da\u8655\u7406\u3002<\/p>\n<h2 id=\"%e5%9c%96%e5%bd%a2%e6%95%b8%e6%93%9a%e5%ba%ab-BDPrGWhLoG\">\u5716\u5f62\u6578\u64da\u5eab<\/h2>\n<p>\u5716\u5f62\u6578\u64da\u5eab\u5c08\u6ce8\u65bc\u5b58\u5132\u548c\u67e5\u8a62\u5716\u5f62\u7d50\u69cb\u7684\u6578\u64da\uff0c\u7279\u5225\u9069\u5408\u793e\u4ea4\u7db2\u7d61\u548c\u63a8\u85a6\u7cfb\u7d71\u7b49\u61c9\u7528\u3002<\/p>\n<pre><code>\n# Neo4j\u793a\u4f8b\nMATCH (a:Person)-[:KNOWS]-&gt;(b:Person) RETURN a, b\n<\/code><\/pre>\n<p>Neo4j\u548cArangoDB\u662f\u6d41\u884c\u7684\u5716\u5f62\u6578\u64da\u5eab\u3002Neo4j\u4ee5\u5176\u5f37\u5927\u7684\u67e5\u8a62\u8a9e\u8a00Cypher\u800c\u53d7\u5230\u5ee3\u6cdb\u4f7f\u7528\uff0c\u800cArangoDB\u5247\u652f\u6301\u591a\u7a2e\u6578\u64da\u6a21\u578b\u3002<\/p>\n<h2 id=\"nosql%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e9%81%b8%e6%93%87%e8%80%83%e9%87%8f-BDPrGWhLoG\">NoSQL\u6578\u64da\u5eab\u7684\u9078\u64c7\u8003\u91cf<\/h2>\n<p>\u5728\u9078\u64c7NoSQL\u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u9700\u8981\u8003\u616e\u4ee5\u4e0b\u5e7e\u500b\u56e0\u7d20\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u6a21\u578b<\/strong>\uff1a\u6839\u64da\u61c9\u7528\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u6a21\u578b\u3002<\/li>\n<li><strong>\u67e5\u8a62\u6027\u80fd<\/strong>\uff1a\u4e0d\u540c\u985e\u578b\u7684NoSQL\u6578\u64da\u5eab\u5728\u67e5\u8a62\u6027\u80fd\u4e0a\u6709\u6240\u4e0d\u540c\u3002<\/li>\n<li><strong>\u53ef\u64f4\u5c55\u6027<\/strong>\uff1a\u8003\u616e\u672a\u4f86\u6578\u64da\u589e\u9577\u7684\u9700\u6c42\u3002<\/li>\n<li><strong>\u793e\u7fa4\u652f\u6301<\/strong>\uff1a\u9078\u64c7\u6709\u6d3b\u8e8d\u793e\u7fa4\u548c\u826f\u597d\u6587\u6a94\u7684\u6578\u64da\u5eab\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-BDPrGWhLoG\">\u7e3d\u7d50<\/h2>\n<p>NoSQL\u6578\u64da\u5eab\u63d0\u4f9b\u4e86\u591a\u6a23\u5316\u7684\u9078\u64c7\uff0c\u9069\u5408\u4e0d\u540c\u7684\u61c9\u7528\u5834\u666f\u3002\u7121\u8ad6\u662f\u9375\u503c\u5b58\u5132\u3001\u6587\u6a94\u5b58\u5132\u3001\u5217\u65cf\u5b58\u5132\u9084\u662f\u5716\u5f62\u6578\u64da\u5eab\uff0c\u5404\u81ea\u90fd\u6709\u5176\u7368\u7279\u7684\u512a\u52e2\u548c\u9069\u7528\u5834\u666f\u3002\u9078\u64c7\u5408\u9069\u7684NoSQL\u6578\u64da\u5eab\u53ef\u4ee5\u5e6b\u52a9\u4f01\u696d\u66f4\u6709\u6548\u5730\u7ba1\u7406\u548c\u5206\u6790\u6578\u64da\uff0c\u63d0\u5347\u696d\u52d9\u6548\u7387\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc\u65bc<em><a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a><\/em>\u548c<em><a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a><\/em>\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22NoSQL\u751f\u614b\u7cfb\u7d71\uff0c\u6df1\u5165\u6bd4\u8f03\u4e0d\u540c\u7279\u6027\uff0c\u52a9\u60a8\u9078\u64c7\u6700\u9069\u5408\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-81398","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/81398","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=81398"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/81398\/revisions"}],"predecessor-version":[{"id":81399,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/81398\/revisions\/81399"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=81398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=81398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=81398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}