{"id":554,"date":"2009-02-16T00:00:00","date_gmt":"2009-02-16T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=554"},"modified":"2011-03-16T00:30:01","modified_gmt":"2011-03-15T16:30:01","slug":"couchdb%e4%ba%86%e8%a7%a3-%e7%89%b9%e6%80%a7%e5%8f%8a%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=554","title":{"rendered":"CouchDB\u4e86\u89e3(-) \u7279\u6027\u53ca\u5b9e\u73b0"},"content":{"rendered":"<p><span style=\"word-spacing: 0px; font: 12px\/18px Tahoma; text-transform: none; color: #000000; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2;\"><br \/>\n<\/span><\/p>\n<div class=\"section\">\n<h1 style=\"font-size: 2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"id1\" style=\"color: #006699; text-decoration: underline;\" name=\"id1\">\u6982\u8ff0<\/a><\/h1>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\uff0c\u5927\u5bb6\u6216\u591a\u6216\u5c11\u90fd\u542c\u8bf4\u8fc7\u3002\u5b83\u5230\u5e95\u6709\u4ec0\u4e48\u7279\u6027\uff0c\u9002\u5408\u54ea\u4e9b\u5e94\u7528\u573a\u666f\uff0c\u548c\u6211\u4eec\u5e38\u7528\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u6709\u4ec0\u4e48\u533a\u522b\uff1f \u8fd9\u4e9b\u95ee\u9898\uff0c\u53ef\u80fd\u6211\u4eec\u5fc3\u91cc\u90fd\u4e0d\u662f\u975e\u5e38\u6e05\u695a\u3002\u5728\u4ee5\u524d\u7684Blog\u4e2d(PS,\u4e0d\u662f\u5728javaeye\u54e6\uff09\uff0c\u6211\u63d0\u53ca\u4e86\u51e0\u6b21CouchDB,\u4f46\u662f\u4ec5\u4ec5 \u9650\u4e8e\u7f16\u8bd1\uff0c\u5b89\u88c5\u8fd9\u4e9b\u6d6e\u5728\u6c34\u9762\u4e0a\u7684\u5de5\u4f5c\u3002\u4eca\u5929\u62bd\u51fa\u65f6\u95f4\u628a\u6700\u8fd1\u5173\u4e8eCouchDB\u7684\u4e00\u4e9b\u4e86\u89e3\u6574\u7406\u4e00\u4e0b\u3002<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"section\">\n<h1 style=\"font-size: 2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"id2\" style=\"color: #006699; text-decoration: underline;\" name=\"id2\">CouchDB\u662f\u4ec0\u4e48<\/a><\/h1>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\u4e00\u79cd\u534a\u7ed3\u6784\u5316\u9762\u5411\u6587\u6863\u7684\u5206\u5e03\u5f0f\uff0c\u9ad8\u5bb9\u9519\u7684\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5176\u63d0\u4f9bRESTFul HTTP\/JSON\u63a5\u53e3\u3002\u5176\u62e5\u6709MVCC\u7279\u6027\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49Map\/Reduce\u51fd\u6570\u751f\u6210\u5bf9\u5e94\u7684View\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u5728CouchDB\u4e2d\uff0c\u6570\u636e\u662f\u4ee5JSON\u5b57\u7b26\u7684\u65b9\u5f0f\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"section\">\n<h1 style=\"font-size: 2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"id3\" style=\"color: #006699; text-decoration: underline;\" name=\"id3\">\u7279\u6027<\/a><\/h1>\n<ul class=\"simple\" style=\"margin: 0px 0px 1.5em; padding: 0px;\">\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">RESTFul API\uff1aHTTP GET\/PUT\/POST\/DELETE + JSON<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u57fa\u4e8e\u6587\u6863\u5b58\u50a8\uff0c\u6570\u636e\u4e4b\u95f4\u6ca1\u6709\u5173\u7cfb\u8303\u5f0f\u8981\u6c42<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u6bcf\u4e2a\u6570\u636e\u5e93\u5bf9\u5e94\u5355\u4e2a\u4e2a\u6587\u4ef6(\u4ee5JSON\u4fdd\u5b58),Hot backup<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">MVCC\uff08Multi-Version-Concurrency-Control\uff09\uff0c\u8bfb\u5199\u5747\u4e0d\u9501\u5b9a\u6570\u636e\u5e93<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u7528\u6237\u81ea\u5b9a\u4e49View<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u5185\u5efa\u5907\u4efd\u673a\u5236<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u652f\u6301\u9644\u4ef6<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u4f7f\u7528Erlang\u5f00\u53d1\uff08\u66f4\u591a\u7684\u7279\u6027\uff09<\/li>\n<\/ul>\n<p style=\"margin: 0px; padding: 0px;\">\u5e94\u7528\u573a\u666f \u5728\u6211\u4eec\u7684\u751f\u6d3b\u4e2d\uff0c\u6709\u5f88\u591adocument\uff0c\u6bd4\u5982\u4fe1\u4ef6\uff0c\u8d26\u5355\uff0c\u7b14\u8bb0\u7b49\uff0c\u4ed6\u4eec\u53ea\u662f\u7b80\u5355\u7684\u4fe1\u606f\uff0c\u6ca1\u6709\u5173\u7cfb\u7684\u9700\u6c42\uff0c\u6211\u4eec\u53ef\u80fd\u4ec5\u4ec5\u9700\u8981\u5b58\u50a8\u8fd9\u4e9b\u6570\u636e\u3002 \u8fd9\u6837\u7684\u60c5\u51b5\u4e0b\uff0cCouchDB\u5e94\u8be5\u662f\u5f88\u597d\u7684\u9009\u62e9\u3002\u5f53\u7136\u5176\u4ed6\u4f7f\u7528\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u73af\u5883\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528CouchDB\u6765\u89e3\u51b3\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u6839\u636eCouchDB\u7684\u7279\u6027\uff0c\u5728\u67d0\u4e9b\u5076 \u5c14\u8fde\u63a5\u7f51\u7edc\u7684\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u7528CouchDB\u6682\u5b58\u6570\u636e\uff0c\u968f\u540e\u8fdb\u884c\u540c\u6b65\u3002\u4e5f\u53ef\u4ee5\u5728Cloud\u73af\u5883\u4e2d\uff0c\u4f5c\u4e3a\u5206\u5e03\u5f0f\u7684\u6570\u636e\u5b58\u50a8\u3002CouchDB\u63d0\u4f9b\u7ed9\u4e88 HTTP\u7684API\uff0c\u8fd9\u6837\u6240\u6709\u7684\u5e38\u89c1\u8bed\u8a00\u90fd\u53ef\u4ee5\u4f7f\u7528CouchDB\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u4f7f\u7528CouchDB\uff0c\u610f\u5473\u7740\u6211\u4eec\u4e0d\u9700\u8981\u5728\u50cf\u4f7f\u7528RMDBS\u4e00\u6837\uff0c\u5728\u8bbe\u8ba1\u5e94\u7528\u524d\u9996\u5148\u8bbe\u8ba1\u8d1f\u8d23\u6570\u636eTable\u3002\u6211\u4eec\u7684\u5f00\u53d1\u66f4\u52a0\u5feb\u901f\uff0c\u7075\u6d3b\u3002<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h1 style=\"font-size: 2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"id4\" style=\"color: #006699; text-decoration: underline;\" name=\"id4\">\u5b9e\u73b0<\/a><\/h1>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u5728CouchDB\u4e2d\uff0cDatabase\u8868\u793a\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u6bcf\u4e2aDatabase\u5bf9\u5e94\u4e00\u4e2a&#8221;Storage&#8221;\uff08\u540e\u7f00\u4e3a.couch\uff09\u4ee5\u53ca\u591a\u4e2aView Index(\u7528\u6765\u5b58\u50a8View\u7ed3\u679c\u652f\u6301query\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">Database Storage\u4e2d\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7684Document\uff0c\u7528\u6237\u53ef\u4ee5\u5728Database\u4e2d\u81ea\u5b9a\u4e49View\uff0c\u65b9\u4fbf\u5bf9\u6570\u636e\u8fdb\u884c\u67e5\u8be2, View \u9ed8\u8ba4\u4f7f\u7528JavaScript\u8fdb\u884c\u5b9a\u4e49\uff0c\u5b9a\u4e49\u597d\u7684\u76f8\u5173\u51fd\u6570\u4fdd\u5b58\u5728 design document\u4e2d\uff0c\u800cView\u5bf9\u5e94\u7684\u5177\u4f53\u6570\u636e\u662f\u4fdd\u5b58\u5728View Index\u6587\u4ef6\u4e2d\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7HTTP API\u8bf7\u6c42Database\uff0cDocument\uff0cView\uff0c\u53ef\u4ee5\u8fdb\u884c\u7b80\u5355\u7684Query\uff0c\u4ee5\u53ca\u5176\u4ed6\u5404\u79cd\u7cfb\u7edf\u76f8\u5173\u7684\u4fe1\u606f\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class=\"section\">\n<h2 style=\"font-size: 1.5em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"storage-file\" style=\"color: #006699; text-decoration: underline;\" name=\"storage-file\">Storage File\u7ed3\u6784<\/a><\/h2>\n<p style=\"margin: 0px; padding: 0px;\">\u6570\u636e\u5e93\u6587\u4ef6\u7684\u540e\u7f00\u4e3a.couch\uff0c\u7531Header\u548cBody\u7ec4\u6210\u3002<\/p>\n<dl class=\"docutils\" style=\"margin: 0px 0px 1.5em; line-height: 1.4em; padding: 0px;\">\n<dt style=\"margin: 0.25em 0px; padding: 0px;\"><em style=\"font-style: italic;\">Header<\/em><\/dt>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">\u5305\u542b\u4e24\u4e2a\u5b8c\u5168\u76f8\u540c\u7684Header\u4fe1\u606f\uff0c\u6bcf\u4e2aHeader\u7684Size\u4e3a2048<\/dd>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">Header\u4e2d\u524d4\u5b57\u8282\u4e3amagic code:$g, $m, $k, 0<\/dd>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">\u968f\u540e\u4e3aheader\u7684payload\uff0c\u901a\u8fc7term_to_binary(db_header_record)\u4ea7\u751f<\/dd>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">\u63a5\u4e0b\u6765\u662f\u586b\u5145padding<\/dd>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">\u6700\u540e\u662f16\u5b57\u8282\u7684\u6458\u8981\u4fe1\u606f(md5(payload+padding)\u4ea7\u751f)<\/dd>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">Header\u603b\u957f\u5ea6\u4e3a\uff1a\u5355\u4e2aHeader * 2 = 2048<\/dd>\n<dt style=\"margin: 0.25em 0px; padding: 0px;\"><em style=\"font-style: italic;\">Body<\/em><\/dt>\n<dd style=\"margin: 0px 0px 0px 30px; padding: 0px;\">\u7531\u4e24\u4e2aB+Tree\u7ec4\u6210\uff0c\u5176\u4e2d\u4e00\u4e2aB+Tree\u6839\u636eDocument id\u8fdb\u884c\u7ec4\u7ec7\uff0c\u53e6\u4e00\u4e2aB+Tree\u4ee5 seqnum\uff08CouchDB\u5185\u90e8\u4f7f\u7528\u7684\u5e8f\u53f7\uff0c\u7528\u6765\u6307\u793a\u6700\u65b0Revision\u7684\u6587\u6863\uff09\u4e3akey\u3002<\/dd>\n<\/dl>\n<ul style=\"margin: 0px 0px 1.5em; padding: 0px;\">\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\n<p class=\"first\" style=\"margin: 0px; padding: 0px;\">fulldocinfo_by_id_btree<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u4f7f\u7528Document id\u4f5c\u4e3akey\uff0c\u5e38\u7528\u6765\u6839\u636eid\u6765\u67e5\u627e\u5bf9\u5e94\u7684document\uff0cfull_doc_info\u4e2d\u5305\u542b\u5bf9\u5e94document\u7684\u6240\u6709\u7684Revision\u4fe1\u606f\uff0c\u901a\u8fc7\u8fd9\u4e9b\u4fe1\u606f\uff0c\u6211\u4eec\u53ef\u4ee5\u83b7\u53d6\u6307\u5b9aRevision\u7684document<\/p>\n<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\n<p class=\"first\" style=\"margin: 0px; padding: 0px;\">docinfo_by_seq_btree<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u4f7f\u7528seq\u4f5c\u4e3akey\uff0c\u5f53document\u88ab\u66f4\u65b0\u65f6\uff0c\u5bf9\u5e94\u7684seq\u4f1a\u589e\u52a0\u3002 \u5177\u4f53\u7684document\u6570\u636e\uff08json\u683c\u5f0f\uff09\uff0c\u4ee5\u53caB+Tree\u6df7\u5408\u5b58\u50a8\u4e0e\u8fd9\u4e2a.couch\u6587\u4ef6\u4e4b\u4e2d\u3002\u901a\u8fc7B+Tree\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u7684\u5b9a\u4f4d\u5230\u6307\u5b9a\u7684document\u3002<\/p>\n<\/li>\n<\/ul>\n<p><span style=\"word-spacing: 0px; font: 12px\/18px Tahoma; text-transform: none; color: #000000; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2;\"><img loading=\"lazy\" decoding=\"async\" style=\"width: 400px; height: 541px; border-width: 0px;\" src=\"http:\/\/strongd.net\/upload\/attachment\/70706\/710dac68-774f-3b40-8f05-fdd726591c0f.jpg\" alt=\"\u6587\u4ef6\u7ed3\u6784\u793a\u610f\u56fe\" width=\"531\" height=\"718\" \/><\/span><\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u6240\u6709\u7684\u66f4\u65b0\u64cd\u4f5c\uff08\u5305\u62ecdocument\u7684\u521b\u5efa\uff0c\u4fee\u6539\u548c\u5220\u9664\uff09\u90fd\u662f\u4ee5\u5728couch\u6587\u4ef6\u5c3e\u90e8\u8ffd\u52a0\u7684\u65b9\u5f0f\uff08\u5373Append\u65b9\u5f0f\uff09\u8fdb\u884c\u3002\u6211\u4eec\u8fdb\u884c\u66f4\u65b0\u65f6\uff0c\u9996 \u5148\u62f7\u8d1d\u539f\u6709\u7684\u6570\u636e\u4fe1\u606f\uff08\u4ec5\u4ec5\u9488\u5bf9\u4fee\u6539\uff0c\u5982\u679c\u662fCreate\u90a3\u4e48\u5c31\u6ca1\u6709copy\u53ef\u8a00\u4e86\uff09\uff0c\u968f\u540e\u5c06\u5176\u8ffd\u52a0\u5230\u6587\u4ef6\u7684\u7ed3\u5c3e\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u6fc0\u53d1B+Tree\u4eceleaf \u5230root\u7684\u66f4\u65b0\u8fc7\u7a0b\uff0c\u66f4\u65b0\u7684Node\u4fe1\u606f\u4e5f\u662f\u91c7\u7528Append\u7684\u65b9\u5f0f\u5199\u5165\u5230\u6587\u4ef6\u7684\u7ed3\u5c3e\uff0c\u5230\u8fbe\u6839\u8282\u70b9\u65f6\uff0c\u6211\u4eec\u5c06\u6839\u8282\u70b9\u4fe1\u606f\u5199\u5165\u5230Header\u4e2d\u3002\u8fd9\u6837\u4e00\u6b21 \u66f4\u65b0\u64cd\u4f5c\u6d89\u53ca1\u6b21\u6570\u636e\u5199\u5165\uff0c\u4ee5\u53caLogN\u6b21\u8282\u70b9\u66f4\u65b0\uff0c\u6240\u4ee5\u5176\u590d\u6742\u5ea6\u4e3aO(logN)<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u56e0\u6b64\u91c7\u7528\u8ffd\u52a0\u7684\u65b9\u5f0f\uff0c\u6240\u4ee5\u5728\u6570\u636e\u5e93\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u201c\u7626\u8eab\u201d\uff0c\u60c5\u7406\u90a3\u4e9b\u65e7\u7684Document\u6570\u636e\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u6210\u4e3a Compaction\u3002\u5728Compation\u7684\u8fc7\u7a0b\uff0c\u6570\u636e\u5e93\u4ecd\u7136\u53ef\u7528\uff0c\u53ea\u662f\u8bf7\u6ce8\u610f\uff0c\u5728Compation\u7684\u65f6\u5019\uff0c\u662f\u901a\u8fc7\u904d\u5386DBName.couch\u6587 \u4ef6\uff0c\u5c06\u6700\u65b0\u7684\u6570\u636e\u62f7\u8d1d\u5230\u4e00\u4e2aDBName.compat\u6587\u4ef6\u4e2d\uff0c\u56e0\u6b64\u8fd9\u4e2a\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u8017\u8d39\u5f88\u5927\u7684\u5b58\u50a8\u7a7a\u95f4\uff0c\u5982\u679c\u60a8\u5728\u7cfb\u7edf\u7e41\u5fd9\uff08\u4e3b\u8981\u662fwrite\uff09\u7684\u60c5\u51b5\u4e0b\u8fdb \u884cCompation\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4f60\u7684\u786c\u76d8\u7a7a\u95f4\u8017\u5c3d\uff0c\u4e00\u5b9a\u6ce8\u610f\u54e6\uff01<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"section\">\n<h2 style=\"font-size: 1.5em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"acid\" style=\"color: #006699; text-decoration: underline;\" name=\"acid\">ACID<\/a><\/h2>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\u652f\u6301ACID\u7279\u6027\u3002Document\u7684\u66f4\u65b0\uff08add\uff0cedit\uff0cdelete\uff09\u662f\u987a\u5e8f\u8fdb\u884c\u7684\uff0c\u4f46\u662fDatabase\u7684read\u4e3a\u5e76\u53d1 \u6267\u884c\uff0c\u5176\u4e0d\u5fc5\u7b49\u5f85\u4efb\u4f55\u5176\u4ed6\u7684read\uff0cwrite\u7684\u5b8c\u6210\u3002\u8fd9\u6837\u7684\u7279\u6027\u4e0eCouchDB\u5b58\u50a8\u6587\u4ef6\u7684Append\u589e\u52a0\u65b9\u5f0f\u5173\u7cfb\u5bc6\u5207\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u5f53CouchDB\u7684\u6587\u6863\u66f4\u65b0\u65f6\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0cCommit\u5206\u4e3a\u4ee5\u4e0b\u4e24\u6b65\uff1a<\/p>\n<ol class=\"arabic simple\" style=\"font-size: 1em; margin: 0px 0px 1.5em; line-height: 1.4em; padding: 0px;\">\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\">Document\u6570\u636e\u548cindex\u6570\u636e\u9996\u5148\u5199\u5165\u5230disk\u6570\u636e\u5e93\u6587\u4ef6<\/li>\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\">\u751f\u6210\u4e24\u4e2a\u8fde\u7eed\u7684\u5934\u4fe1\u606f\uff084kb),\u968f\u540e\u5199\u5165\u6570\u636e\u5e93\u6587\u4ef6<\/li>\n<\/ol>\n<p style=\"margin: 0px; padding: 0px;\">\u5728\u4e0a\u9762\u4e24\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u5728\u8fc7\u7a0b1\uff0c\u53d1\u751f\u5f02\u5e38\uff08\u7cfb\u7edf\u5d29\u6e83\u6216\u65ad\u7535\uff09\uff0c\u90a3\u4e48couch\u6587\u4ef6\u7684\u5934\u4fe1\u606f\u6ca1\u6709\u53d1\u751f\u53d8\u5316\uff0c\u90a3\u4e48\u6240\u6709Append\u7684\u6570\u636e\u90fd\u4f1a\u88ab\u5ffd\u7565\uff1b \u5982\u679c\u5728\u8fc7\u7a0b2\u53d1\u751f\u5f02\u5e38\uff0c\u6b64\u65f6Header\u53ef\u80fd\u4f1a\u53d1\u751f\u635f\u574f\uff0c\u6211\u4eec\u9a8c\u8bc1\u7b2c\u4e00\u4e2aHeader\u548c\u7b2c\u4e8c\u4e2aHeader\uff0c\u5982\u679c\u4efb\u610f\u4e00\u4e2aHeader\u53ef\u7528\uff0c\u90a3\u4e48\u6570\u636e\u5e93\u6587 \u4ef6\u53ef\u7528\u3002\u5982\u679c\u4e24\u4e2aHeader\u90fd\u4e0d\u53ef\u7528\uff0c\u5219\u5bf9\u5e94\u6570\u636e\u5e93\u6587\u4ef6\u635f\u574f\uff0c\u629b\u51fa\u5f02\u5e38\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u4e00\u4e9b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u4e3a\u4e86\u5b9e\u73b0 Atomic Commit \uff0c\u63d0\u4ea4\u6570\u636e\u524d\uff0c\u5c06\u5185\u5bb9\u5199\u5165\u5230\u4e00\u4e2arollback log\u6587\u4ef6\uff0c\u7b49\u63d0\u4ea4\u5b8c\u6210\u540e\uff0c\u5220\u9664log\u6587\u4ef6\u3002<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"section\">\n<h2 style=\"font-size: 1.5em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"view-server\" style=\"color: #006699; text-decoration: underline;\" name=\"view-server\">View Server<\/a><\/h2>\n<p style=\"margin: 0px; padding: 0px;\">\u9664\u4e86\u5b58\u50a8\u6570\u636e\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u4f9d\u636e\u6211\u4eec\u7684\u8981\u6c42\u5c55\u73b0\u6570\u636e\uff0c\u4e43\u81f3\u4e00\u4e9b\u7edf\u8ba1\uff0c\u56e0\u6b64CouchDB\u4e2d\u5f15\u5165\u4e86View\u7684\u6982\u5ff5\u3002View\u7684\u5f15\u5165\u8ba9CouchDB\u4ece\u4e00\u4e2a\u6709\u8da3\u7684\u6587\u4ef6\u5b58\u50a8\u7cfb\u7edf\uff0c\u6b65\u5165\u4e86\u6570\u636e\u5e93\u7684\u6bbf\u5802\u3002\u4e5f\u4f7fCouchDB\u80fd\u591f\u878d\u5165\u5230\u771f\u6b63\u7684\u5e94\u7528\u73af\u5883\u4e2d\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\u4e2d\u6240\u6709\u7684Document\u90fd\u53ef\u4ee5\u5177\u6709\u81ea\u5df1\u4e0d\u540c\u7684\u7ed3\u6784\uff0c\u6570\u636e\uff0c\u8fd9\u548c\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\uff0c\u4e25\u683c\u7684\u8868\u7ed3\u6784\uff0c\u4e25\u683c\u7684\u5173\u8054\u5b8c\u5168\u4e0d\u540c\u3002\u8fd9\u6837\u7684\u7279\u70b9\u5bf9\u4e8e\u6570\u636e\u7684\u5907\u4efd\u540c\u6b65\u5374\u975e\u5e38\u6709\u597d\u5904\uff01<\/p>\n<div class=\"section\">\n<h3 style=\"font-size: 1.2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"view-model\" style=\"color: #006699; text-decoration: underline;\" name=\"view-model\">View Model<\/a><\/h3>\n<p style=\"margin: 0px; padding: 0px;\">\u901a\u8fc7\u7528\u6237\u81ea\u5b9a\u4e49View\uff0c\u6211\u4eec\u53ef\u4ee5\u6c47\u96c6\uff0c\u7edf\u8ba1\u6570\u636e\uff0c\u91c7\u7528\u4e00\u4e2a\u7c7b\u4f3cMap\/Reduce\u7684\u8fc7\u7a0b\u3002\u8fd9\u91cc\u7684Map\u5c06\u539f\u59cb\u7684Document\u8fdb\u884c\u6620\u5c04\u5904\u7406\uff0cReduce\u5c06Map\u7684\u4e2d\u95f4\u7ed3\u679c\u8fdb\u884c\u91cd\u65b0\u5f52\u5e76\u7edf\u8ba1\uff0c\u603b\u800c\u751f\u6210\u6700\u7ec8\u7ed3\u679c\u3002\u8fd9\u91cc\u548c\u5e76\u884c\u8ba1\u7b97\u4e2d\u7684Map\/Reduce\u6709\u4e9b\u4e0d\u540c\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\u7684View\u9488\u5bf9\u6bcf\u4e2aDatabase\uff0c\u4f46\u662f\u5176\u4e0eDatabase\u5173\u8054\u6027\u4e0d\u662f\u5f88\u5927\uff0cView\u662f\u4e00\u4e9b\u7528\u6237\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5904\u7406\u4ece\u6570\u636e\u5e93\u7684 Document\u8f93\u5165\uff0c\u4ea7\u751f\u4e2d\u95f4\u6570\u636e\uff08\u5982\u679c\u6ca1\u6709reduce\u8fc7\u7a0b\u5219\u4e3a\u6700\u7ec8\u6570\u636e\uff09\uff0c\u7136\u540e\u518d\u901a\u8fc7Reduce\u5904\u7406\u4e2d\u95f4\u8f93\u51fa\uff0c\u4ea7\u751f\u6700\u7ec8\u7ed3\u679c\u3002\u540c\u6837\u7684View\u53ef\u4ee5 \u4f7f\u7528\u5728\u4e0d\u540c\u7684Database\u4e0a\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<p style=\"margin: 0px; padding: 0px;\">View\u5b58\u50a8\u5728design Document\u4e2d\uff0c\u8bf7\u6ce8\u610f\u8fd9\u91ccdesign Document\u548cView Index\u662f\u4e0d\u540c\u7684\u3002design Document\u4fdd\u5b58\u7684\u662fview\u7684\u5b9a\u4e49\uff0cView Index\u4fdd\u5b58\u7684\u662f\u9488\u5bf9\u67d0\u4e2aDatabase\u8fdb\u884cView\u64cd\u4f5c\uff0c\u4ea7\u751f\u7684\u7ed3\u679c\u3002<\/p>\n<\/div>\n<div class=\"section\">\n<h3 style=\"font-size: 1.2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"javascript-view-function\" style=\"color: #006699; text-decoration: underline;\" name=\"javascript-view-function\">JavaScript View Function<\/a><\/h3>\n<p style=\"margin: 0px; padding: 0px;\">CouchDB\u5185\u90e8\u9ed8\u8ba4\u4f7f\u7528JavaScript\u4f5c\u4e3aView\u7684\u7f16\u5199\u8bed\u8a00\uff0c\u4e4b\u6240\u4ee5\u91c7\u7528Javascript\uff0c\u662f\u548cCouchDB\u9762\u5411Web\u5f00\u53d1\u76f8\u5173 \u7684\u3002CouchDB\u4f7f\u7528Mozilla\u7684spidermonkey\u4f5c\u4e3aJavaScript\u7684\u89e3\u6790\u8fd0\u884c\u5e73\u53f0\uff0c\u4e3a\u4e86\u548cErlang\u8fdb\u884c\u4ea4\u4e92\uff0c\u5176\u4f7f\u7528c\u4e66\u5199\u4e86 \u4e00\u4e2aPort\u7a0b\u5e8fcouchjs\uff0c\/server\/main.js\u4f5c\u4e3aView Server\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">\u5728\u542f\u52a8CouchDB\u65f6\uff0c\u901a\u8fc7Command\uff1acouchjs main.js\u5373\u53ef\u542f\u52a8\u57fa\u4e8eJavaScript\u7684View Server\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">View\u4e2d\u5305\u542b\u4e24\u4e2a\u51fd\u6570:<\/p>\n<pre class=\"literal-block\" style=\"font-size: 1em; font-family: monospace;\">(map\u51fd\u6570\uff0c\u5fc5\u987b\uff09\r\nfunction(doc) {\r\n  emit(null, doc);\r\n}\r\n(reduce\u51fd\u6570\uff0c\u53ef\u9009\uff09\r\nfunction (key, values, rereduce) {\r\n   return sum(values);\r\n}\r\n<\/pre>\n<p style=\"margin: 0px; padding: 0px;\"><cite style=\"font-weight: bold; margin-left: 3px;\">doc<\/cite><span> <\/span>,\u4e3a\u6211\u4eec\u6570\u636e\u5e93\u5bf9\u5e94\u7684Document\uff0c\u56e0\u4e3a\u6211\u4eec\u91c7\u7528JSON\u683c\u5f0f\u5b58\u50a8\u6570\u636e\uff0c\u6240\u4ee5Document\u5728 JavaScript\u4e2d\u8f6c\u5316\u4e3aObject\u3002`emit(null, doc)`\u7528\u6765\u751f\u6210map\u7684\u4e2d\u95f4\u7ed3\u679c\uff0c\u5176\u4e2d\u7b2c\u4e00\u4e2a\u53c2\u6570null\u8868\u793a\u7ed3\u679c\u7684key\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u4e3a\u7ed3\u679c\u7684value\uff0c\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u6211\u4eec\u7684\u7ed3\u679c\u4e3a:<\/p>\n<pre class=\"literal-block\" style=\"font-size: 1em; font-family: monospace;\">null, value1\r\n...\r\nnull, valueN\r\n<\/pre>\n<p style=\"margin: 0px; padding: 0px;\">function (key, values, rereduce)\u4e2d\uff0c\u6839\u636erereduce\u53d8\u91cf\u4e0d\u540c\u8fd9\u91cc\u6709\u4e24\u79cd\u60c5\u51b5:<\/p>\n<ol class=\"arabic simple\" style=\"font-size: 1em; margin: 0px 0px 1.5em; line-height: 1.4em; padding: 0px;\">\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\">rereduce\u4e3afalse<\/li>\n<\/ol>\n<blockquote style=\"margin-left: 10px; background-color: #fafafa; border: #cccccc 1px solid;\">\n<ul class=\"simple\" style=\"margin: 0px 0px 1.5em; padding: 0px;\">\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">key\u4e3aarray\uff0celement\u4e3a\uff1a[key,id]\uff0ckey\u4e3amap function\u4ea7\u751f\u7684key\uff0cid\u4e3aDocument\u5bf9\u5e94id<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">values\u4e3aarray\uff0celements\u4e3amap function\u4ea7\u751f\u7684\u7ed3\u679c<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u6bd4\u5982 reduce([ [key1,id1], [key2,id2], [key3,id3] ], [value1,value2,value3], false)<\/li>\n<\/ul>\n<\/blockquote>\n<ol class=\"arabic simple\" style=\"font-size: 1em; margin: 0px 0px 1.5em; line-height: 1.4em; padding: 0px;\">\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\">rereduce\u4e3atrue<\/li>\n<\/ol>\n<blockquote style=\"margin-left: 10px; background-color: #fafafa; border: #cccccc 1px solid;\">\n<ul class=\"simple\" style=\"margin: 0px 0px 1.5em; padding: 0px;\">\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">key\u4e3anull<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">values\u4e3aarray\uff0celement\u4e3a\u524d\u4e00\u6b21reduce\u8fd4\u56de\u7684\u7ed3\u679c<\/li>\n<li style=\"margin: 0px 0px 0.25em 30px; padding: 0px;\">\u6bd4\u5982reduce(null, [intermediate1,intermediate2,intermediate3], true)<\/li>\n<\/ul>\n<\/blockquote>\n<p style=\"margin: 0px; padding: 0px;\">\u5f88\u591a\u65f6\u5019\uff0c\u6211\u4eec\u4e00\u6b21\u8c03\u7528reduce\u5c31\u53ef\u4ee5\u751f\u6210\u6700\u7ec8\u7ed3\u679c\uff0c\u6211\u4eec\u4f1a\u5ffd\u7565rereduce\u53c2\u6570\u3002<\/p>\n<p style=\"margin: 0px; padding: 0px;\">&nbsp;<\/p>\n<div class=\"section\">\n<h1 style=\"font-size: 2em; margin: 0px 0px 0.5em; color: black; line-height: 1.5em; padding: 0px;\"><a id=\"id5\" style=\"color: #006699; text-decoration: underline;\" name=\"id5\">\u53c2\u8003<\/a><\/h1>\n<ol class=\"arabic simple\" style=\"font-size: 1em; margin: 0px 0px 1.5em; line-height: 1.4em; padding: 0px;\">\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\"><a class=\"reference\" style=\"color: #006699; text-decoration: underline;\" href=\"http:\/\/couchdb.apache.org\/\">couchdb<\/a><\/li>\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\"><a class=\"reference\" style=\"color: #006699; text-decoration: underline;\" href=\"http:\/\/horicky.blogspot.com\/2008\/10\/couchdb-implementation.html\">horicky<\/a><\/li>\n<li style=\"font-size: 1em; margin: 0px 0px 0.25em 30px; padding: 0px;\"><a class=\"reference\" style=\"color: #006699; text-decoration: underline;\" href=\"http:\/\/ayende.com\/Blog\/archive\/2008\/10\/04\/reading-erlang-couchdb-from-rest-to-disk-in-a.aspx\">ayende<\/a><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 CouchDB\uff0c\u5927\u5bb6\u6216\u591a\u6216\u5c11\u90fd\u542c\u8bf4\u8fc7\u3002\u5b83\u5230\u5e95\u6709\u4ec0\u4e48\u7279\u6027\uff0c\u9002\u5408\u54ea\u4e9b\u5e94\u7528\u573a\u666f\uff0c\u548c\u6211\u4eec\u5e38\u7528\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u6709\u4ec0\u4e48\u533a\u522b\uff1f \u8fd9\u4e9b\u95ee\u9898\uff0c\u53ef\u80fd\u6211\u4eec\u5fc3\u91cc\u90fd\u4e0d\u662f\u975e\u5e38\u6e05\u695a\u3002\u5728\u4ee5\u524d\u7684Blog\u4e2d(PS,\u4e0d\u662f\u5728javaeye\u54e6\uff09\uff0c\u6211\u63d0\u53ca\u4e86\u51e0\u6b21CouchDB,\u4f46\u662f\u4ec5\u4ec5 \u9650\u4e8e\u7f16\u8bd1\uff0c\u5b89\u88c5\u8fd9\u4e9b\u6d6e\u5728\u6c34\u9762\u4e0a\u7684\u5de5\u4f5c\u3002\u4eca\u5929\u62bd\u51fa\u65f6\u95f4\u628a\u6700\u8fd1\u5173\u4e8eCouchDB\u7684\u4e00\u4e9b\u4e86\u89e3\u6574\u7406\u4e00\u4e0b\u3002 &nbsp; CouchDB\u662f\u4ec0\u4e48 CouchDB\u4e00\u79cd\u534a\u7ed3\u6784\u5316\u9762\u5411\u6587\u6863\u7684\u5206\u5e03\u5f0f\uff0c\u9ad8\u5bb9\u9519\u7684\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5176\u63d0\u4f9bRESTFul HTTP\/JSON\u63a5\u53e3\u3002\u5176\u62e5\u6709MVCC\u7279\u6027\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49Map\/Reduce\u51fd\u6570\u751f\u6210\u5bf9\u5e94\u7684View\u3002 \u5728CouchDB\u4e2d\uff0c\u6570\u636e\u662f\u4ee5JSON\u5b57\u7b26\u7684\u65b9\u5f0f\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\u3002 &nbsp; \u7279\u6027 RESTFul API\uff1aHTTP GET\/PUT\/POST\/DELETE + JSON \u57fa\u4e8e\u6587\u6863\u5b58\u50a8\uff0c\u6570\u636e\u4e4b\u95f4\u6ca1\u6709\u5173\u7cfb\u8303\u5f0f\u8981\u6c42 \u6bcf\u4e2a\u6570\u636e\u5e93\u5bf9\u5e94\u5355\u4e2a\u4e2a\u6587\u4ef6(\u4ee5JSON\u4fdd\u5b58),Hot backup MVCC\uff08Multi-Version-Concurrency-Control\uff09\uff0c\u8bfb\u5199\u5747\u4e0d\u9501\u5b9a\u6570\u636e\u5e93 \u7528\u6237\u81ea\u5b9a\u4e49View \u5185\u5efa\u5907\u4efd\u673a\u5236 \u652f\u6301\u9644\u4ef6 \u4f7f\u7528Erlang\u5f00\u53d1\uff08\u66f4\u591a\u7684\u7279\u6027\uff09 \u5e94\u7528\u573a\u666f \u5728\u6211\u4eec\u7684\u751f\u6d3b\u4e2d\uff0c\u6709\u5f88\u591adocument\uff0c\u6bd4\u5982\u4fe1\u4ef6\uff0c\u8d26\u5355\uff0c\u7b14\u8bb0\u7b49\uff0c\u4ed6\u4eec\u53ea\u662f\u7b80\u5355\u7684\u4fe1\u606f\uff0c\u6ca1\u6709\u5173\u7cfb\u7684\u9700\u6c42\uff0c\u6211\u4eec\u53ef\u80fd\u4ec5\u4ec5\u9700\u8981\u5b58\u50a8\u8fd9\u4e9b\u6570\u636e\u3002 \u8fd9\u6837\u7684\u60c5\u51b5\u4e0b\uff0cCouchDB\u5e94\u8be5\u662f\u5f88\u597d\u7684\u9009\u62e9\u3002\u5f53\u7136\u5176\u4ed6\u4f7f\u7528\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u73af\u5883\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528CouchDB\u6765\u89e3\u51b3\u3002 &nbsp; \u6839\u636eCouchDB\u7684\u7279\u6027\uff0c\u5728\u67d0\u4e9b\u5076 \u5c14\u8fde\u63a5\u7f51\u7edc\u7684\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u7528CouchDB\u6682\u5b58\u6570\u636e\uff0c\u968f\u540e\u8fdb\u884c\u540c\u6b65\u3002\u4e5f\u53ef\u4ee5\u5728Cloud\u73af\u5883\u4e2d\uff0c\u4f5c\u4e3a\u5206\u5e03\u5f0f\u7684\u6570\u636e\u5b58\u50a8\u3002CouchDB\u63d0\u4f9b\u7ed9\u4e88 HTTP\u7684API\uff0c\u8fd9\u6837\u6240\u6709\u7684\u5e38\u89c1\u8bed\u8a00\u90fd\u53ef\u4ee5\u4f7f\u7528CouchDB\u3002 &nbsp; \u4f7f\u7528CouchDB\uff0c\u610f\u5473\u7740\u6211\u4eec\u4e0d\u9700\u8981\u5728\u50cf\u4f7f\u7528RMDBS\u4e00\u6837\uff0c\u5728\u8bbe\u8ba1\u5e94\u7528\u524d\u9996\u5148\u8bbe\u8ba1\u8d1f\u8d23\u6570\u636eTable\u3002\u6211\u4eec\u7684\u5f00\u53d1\u66f4\u52a0\u5feb\u901f\uff0c\u7075\u6d3b\u3002 &nbsp; \u5b9e\u73b0 &nbsp; \u5728CouchDB\u4e2d\uff0cDatabase\u8868\u793a\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u6bcf\u4e2aDatabase\u5bf9\u5e94\u4e00\u4e2a&#8221;Storage&#8221;\uff08\u540e\u7f00\u4e3a.couch\uff09\u4ee5\u53ca\u591a\u4e2aView Index(\u7528\u6765\u5b58\u50a8View\u7ed3\u679c\u652f\u6301query\uff09\u3002 &nbsp; &nbsp; &nbsp; Database Storage\u4e2d\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7684Document\uff0c\u7528\u6237\u53ef\u4ee5\u5728Database\u4e2d\u81ea\u5b9a\u4e49View\uff0c\u65b9\u4fbf\u5bf9\u6570\u636e\u8fdb\u884c\u67e5\u8be2, View \u9ed8\u8ba4\u4f7f\u7528JavaScript\u8fdb\u884c\u5b9a\u4e49\uff0c\u5b9a\u4e49\u597d\u7684\u76f8\u5173\u51fd\u6570\u4fdd\u5b58\u5728 design document\u4e2d\uff0c\u800cView\u5bf9\u5e94\u7684\u5177\u4f53\u6570\u636e\u662f\u4fdd\u5b58\u5728View Index\u6587\u4ef6\u4e2d\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7HTTP API\u8bf7\u6c42Database\uff0cDocument\uff0cView\uff0c\u53ef\u4ee5\u8fdb\u884c\u7b80\u5355\u7684Query\uff0c\u4ee5\u53ca\u5176\u4ed6\u5404\u79cd\u7cfb\u7edf\u76f8\u5173\u7684\u4fe1\u606f\u3002 &nbsp; Storage File\u7ed3\u6784 \u6570\u636e\u5e93\u6587\u4ef6\u7684\u540e\u7f00\u4e3a.couch\uff0c\u7531Header\u548cBody\u7ec4\u6210\u3002 Header \u5305\u542b\u4e24\u4e2a\u5b8c\u5168\u76f8\u540c\u7684Header\u4fe1\u606f\uff0c\u6bcf\u4e2aHeader\u7684Size\u4e3a2048 &hellip; <a href=\"https:\/\/www.strongd.net\/?p=554\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CouchDB\u4e86\u89e3(-) \u7279\u6027\u53ca\u5b9e\u73b0<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-554","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=554"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}