{"id":26514,"date":"2012-09-18T20:09:28","date_gmt":"2012-09-18T12:09:28","guid":{"rendered":"http:\/\/www.yankay.com\/?p=26514"},"modified":"2012-09-18T20:09:28","modified_gmt":"2012-09-18T12:09:28","slug":"google-spanner%e5%8e%9f%e7%90%86-%e5%85%a8%e7%90%83%e7%ba%a7%e7%9a%84%e5%88%86%e5%b8%83%e5%bc%8f%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"http:\/\/yankay.com\/google-spanner%e5%8e%9f%e7%90%86-%e5%85%a8%e7%90%83%e7%ba%a7%e7%9a%84%e5%88%86%e5%b8%83%e5%bc%8f%e6%95%b0%e6%8d%ae%e5%ba%93\/","title":{"rendered":"Google Spanner\u539f\u7406- \u5168\u7403\u7ea7\u7684\u5206\u5e03\u5f0f\u6570\u636e\u5e93"},"content":{"rendered":"
Spanner \u662fGoogle\u7684\u5168\u7403\u7ea7\u7684\u5206\u5e03\u5f0f\u6570\u636e\u5e93 (Globally-Distributed Database) \u3002Spanner\u7684\u6269\u5c55\u6027\u8fbe\u5230\u4e86\u4ee4\u4eba\u548b\u820c\u7684\u5168\u7403\u7ea7\uff0c\u53ef\u4ee5\u6269\u5c55\u5230\u6570\u767e\u4e07\u7684\u673a\u5668\uff0c\u6570\u5df2\u767e\u8ba1\u7684\u6570\u636e\u4e2d\u5fc3\uff0c\u4e0a\u4e07\u4ebf\u7684\u884c\u3002\u66f4\u7ed9\u529b\u7684\u662f\uff0c\u9664\u4e86\u5938\u5f20\u7684\u6269\u5c55\u6027\u4e4b\u5916\uff0c\u4ed6\u8fd8\u80fd\u540c\u65f6\u901a\u8fc7\u540c\u6b65\u590d\u5236\u548c\u591a\u7248\u672c\u6765\u6ee1\u8db3\u5916\u90e8\u4e00\u81f4\u6027\uff0c\u53ef\u7528\u6027\u4e5f\u662f\u5f88\u597d\u7684\u3002\u51b2\u7834CAP\u7684\u67b7\u9501\uff0c\u5728\u4e09\u8005\u4e4b\u95f4\u5b8c\u7f8e\u5e73\u8861\u3002<\/p>\n
<\/a><\/p>\n Spanner\u662f\u4e2a\u53ef\u6269\u5c55\uff0c\u591a\u7248\u672c\uff0c\u5168\u7403\u5206\u5e03\u5f0f\u8fd8\u652f\u6301\u540c\u6b65\u590d\u5236\u7684\u6570\u636e\u5e93\u3002\u4ed6\u662fGoogle\u7684\u7b2c\u4e00\u4e2a\u53ef\u4ee5\u5168\u7403\u6269\u5c55\u5e76\u4e14\u652f\u6301\u5916\u90e8\u4e00\u81f4\u7684\u4e8b\u52a1\u3002Spanner\u80fd\u505a\u5230\u8fd9\u4e9b\uff0c\u79bb\u4e0d\u5f00\u4e00\u4e2a\u7528GPS\u548c\u539f\u5b50\u949f\u5b9e\u73b0\u7684\u65f6\u95f4API\u3002\u8fd9\u4e2aAPI\u80fd\u5c06\u6570\u636e\u4e2d\u5fc3\u4e4b\u95f4\u7684\u65f6\u95f4\u540c\u6b65\u7cbe\u786e\u523010ms\u4ee5\u5185\u3002\u56e0\u6b64\u6709\u51e0\u4e2a\u7ed9\u529b\u7684\u529f\u80fd\uff1a\u65e0\u9501\u8bfb\u4e8b\u52a1\uff0c\u539f\u5b50schema\u4fee\u6539\uff0c\u8bfb\u5386\u53f2\u6570\u636e\u65e0block\u3002<\/p>\n EMC\u4e2d\u56fd\u7814\u7a76\u9662<\/a>\u5b9e\u65f6\u7d27\u76ef\u4e1a\u754c\u52a8\u6001\uff0cGoogle\u6700\u8fd1\u53d1\u5e03\u7684\u4e00\u7bc7\u8bba\u6587\u300aSpanner: Google’s Globally-Distributed Database<\/a>\u300b, \u7b14\u8005\u975e\u5e38\u611f\u5174\u8da3\uff0c\u5bf9Spanner\u8fdb\u884c\u4e86\u4e00\u4e9b\u8c03\u7814\uff0c\u5e76\u5728\u8fd9\u91cc\u5206\u4eab\u3002\u7531\u4e8eSpanner\u5e76\u4e0d\u662f\u5f00\u6e90\u4ea7\u54c1\uff0c\u7b14\u8005\u7684\u77e5\u8bc6\u4e3b\u8981\u6765\u6e90\u4e8eGoogle\u7684\u516c\u5f00\u8d44\u6599\uff0c\u901a\u8fc7\u73b0\u6709\u516c\u5f00\u8d44\u6599\u4ec5\u4ec5\u53ea\u80fd\u7aa5\u5f97Spanner\u7684\u6ca7\u6d77\u4e00\u7c9f\uff0cSpanner\u80cc\u540e\u8fd8\u4f9d\u8d56\u6709\u5927\u91cfGoogle\u7684\u4e13\u6709\u6280\u672f\u3002\u7814\u7a76\u9662\u539f\u6587<\/a>\u3002<\/p>\n \u4e0b\u6587\u4e3b\u8981\u662fSpanner\u7684\u80cc\u666f\uff0c\u8bbe\u8ba1\u548c\u5e76\u53d1\u63a7\u5236\u3002<\/p>\n \u8981\u641e\u6e05\u695aSpanner\u539f\u7406\uff0c\u5148\u5f97\u4e86\u89e3Spanner\u5728Google\u7684\u5b9a\u4f4d\u3002<\/p>\n <\/a><\/p>\n \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u5230\u3002Spanner\u4f4d\u4e8eF1\u548cGFS\u4e4b\u95f4\uff0c\u627f\u4e0a\u542f\u4e0b\u3002\u6240\u4ee5\u5148\u63d0\u4e00\u63d0F1\u548cGFS\u3002<\/p>\n \u548c\u4f17\u591a\u4e92\u8054\u7f51\u516c\u53f8\u4e00\u6837\uff0c\u5728\u65e9\u671fGoogle\u5927\u91cf\u4f7f\u7528\u4e86Mysql\u3002Mysql\u662f\u5355\u673a\u7684\uff0c\u53ef\u4ee5\u7528Master-Slave\u6765\u5bb9\u9519\uff0c\u5206\u533a\u6765\u6269\u5c55\u3002\u4f46\u662f\u9700\u8981\u5927\u91cf\u7684\u624b\u5de5\u8fd0\u7ef4\u5de5\u4f5c\uff0c\u6709\u5f88\u591a\u7684\u9650\u5236\u3002\u56e0\u6b64Google\u5f00\u53d1\u4e86\u4e00\u4e2a\u53ef\u5bb9\u9519\u53ef\u6269\u5c55\u7684RDBMS\u2014\u2014F1\u3002\u548c\u4e00\u822c\u7684\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u4e0d\u540c\uff0cF1\u5bf9\u5e94RDMS\u5e94\u6709\u7684\u529f\u80fd\uff0c\u6beb\u4e0d\u59a5\u534f\u3002\u8d77\u521dF1\u662f\u57fa\u4e8eMysql\u7684\uff0c\u4e0d\u8fc7\u4f1a\u9010\u6e10\u8fc1\u79fb\u5230Spannerr\u3002<\/p>\n F1\u6709\u5982\u4e0b\u7279\u70b9\uff1a<\/p>\n \u4f17\u6240\u5468\u77e5Google BigTable\u662f\u91cd\u8981\u7684Nosql\u4ea7\u54c1\uff0c\u63d0\u4f9b\u5f88\u597d\u7684\u6269\u5c55\u6027\uff0c\u5f00\u6e90\u4e16\u754c\u6709HBase\u4e0e\u4e4b\u5bf9\u5e94\u3002\u4e3a\u4ec0\u4e48Google\u8fd8\u9700\u8981F1\uff0c\u800c\u4e0d\u662f\u90fd\u4f7f\u7528BigTable\u5462\uff1f\u56e0\u4e3aBigTable\u63d0\u4f9b\u7684\u6700\u7ec8\u4e00\u81f4\u6027\uff0c\u4e00\u4e9b\u9700\u8981\u4e8b\u52a1\u7ea7\u522b\u7684\u5e94\u7528\u65e0\u6cd5\u4f7f\u7528\u3002\u540c\u65f6BigTable\u8fd8\u662fNoSql\uff0c\u800c\u5927\u91cf\u7684\u5e94\u7528\u573a\u666f\u9700\u8981\u6709\u5173\u7cfb\u6a21\u578b\u3002\u5c31\u50cf\u73b0\u5728\u5927\u91cf\u7684\u4e92\u8054\u7f51\u4f01\u4e1a\u90fd\u4f7f\u7528Mysql\u800c\u4e0d\u613f\u610f\u4f7f\u7528HBase\uff0c\u56e0\u6b64Google\u624d\u6709\u8fd9\u4e2a\u53ef\u6269\u5c55\u6570\u636e\u5e93\u7684F1\u3002\u800cSpanner\u5c31\u662fF1\u7684\u81f3\u5173\u91cd\u8981\u7684\u5e95\u5c42\u5b58\u50a8\u6280\u672f\u3002<\/p>\n Colossus\u4e5f\u662f\u4e00\u4e2a\u4e0d\u5f97\u4e0d\u63d0\u8d77\u7684\u6280\u672f\u3002\u4ed6\u662f\u7b2c\u4e8c\u4ee3GFS\uff0c\u5bf9\u5e94\u5f00\u6e90\u4e16\u754c\u7684\u65b0HDFS\u3002GFS\u662f\u8457\u540d\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u3002<\/p>\n <\/a><\/p>\n \u521d\u4ee3GFS\u662f\u4e3a\u6279\u5904\u7406\u8bbe\u8ba1\u7684\u3002\u5bf9\u4e8e\u5927\u6587\u4ef6\u5f88\u53cb\u597d\uff0c\u541e\u5410\u91cf\u5f88\u5927\uff0c\u4f46\u662f\u5ef6\u8fdf\u8f83\u9ad8\u3002\u6240\u4ee5\u4f7f\u7528\u4ed6\u7684\u7cfb\u7edf\u4e0d\u5f97\u4e0d\u5bf9GFS\u505a\u5404\u79cd\u4f18\u5316\uff0c\u624d\u80fd\u83b7\u5f97\u826f\u597d\u7684\u6027\u80fd\u3002\u90a3\u4e3a\u4ec0\u4e48Google\u6ca1\u6709\u8003\u8651\u5230\u8fd9\u4e9b\u95ee\u9898\uff0c\u8bbe\u8ba1\u51fa\u66f4\u5b8c\u7f8e\u7684GFS ? \u56e0\u4e3a\u90a3\u4e2a\u65f6\u5019\u662f2001\u5e74\uff0cHadoop\u51fa\u751f\u662f\u57282007\u5e74\u3002\u5982\u679cHadoop\u662f\u4e16\u754c\u9886\u5148\u6c34\u5e73\u7684\u8bdd\uff0cGFS\u6bd4\u4e16\u754c\u9886\u5148\u6c34\u5e73\u8fd8\u9886\u5148\u4e866\u5e74\u3002\u540c\u6837\u7684Spanner\u51fa\u751f\u5927\u6982\u662f2009\u5e74\uff0c\u73b0\u5728\u6211\u4eec\u770b\u5230\u4e86\u8bba\u6587\uff0c\u4f30\u8ba1Spanner\u5728Google\u5df2\u7ecf\u5f88\u5b8c\u5584\uff0c\u540c\u65f6Google\u5185\u90e8\u5df2\u7ecf\u6709\u66f4\u5148\u8fdb\u7684\u66ff\u4ee3\u6280\u672f\u5728\u915d\u917f\u4e86\u3002\u7b14\u8005\u9884\u6d4b\uff0c\u6700\u65e9\u57282015\u5e74\u624d\u4f1a\u51fa\u73b0Spanner\u548cF1\u7684\u5c71\u5be8\u5f00\u6e90\u4ea7\u54c1\u3002<\/p>\n Colossus\u662f\u7b2c\u4e8c\u4ee3GFS\u3002Colossus\u662fGoogle\u91cd\u8981\u7684\u57fa\u7840\u8bbe\u65bd\uff0c\u56e0\u4e3a\u4ed6\u53ef\u4ee5\u6ee1\u8db3\u4e3b\u6d41\u5e94\u7528\u5bf9FS\u7684\u8981\u6c42\u3002Colossus\u7684\u91cd\u8981\u6539\u8fdb\u6709\uff1a<\/p>\n Colossus\u53ef\u4ee5\u81ea\u52a8\u5206\u533aMetadata\u3002\u4f7f\u7528Reed-Solomon\u7b97\u6cd5\u6765\u590d\u5236\uff0c\u53ef\u4ee5\u5c06\u539f\u5148\u76843\u4efd\u51cf\u5c0f\u52301.5\u4efd\uff0c\u63d0\u9ad8\u5199\u7684\u6027\u80fd\uff0c\u964d\u4f4e\u5ef6\u8fdf\u3002\u5ba2\u6237\u7aef\u6765\u590d\u5236\u6570\u636e\u3002\u5177\u4f53\u7ec6\u8282\u7b14\u8005\u4e5f\u731c\u4e0d\u51fa\u3002<\/p>\n Spanner\u4e3b\u8981\u81f4\u529b\u4e8e\u8de8\u6570\u636e\u4e2d\u5fc3\u7684\u6570\u636e\u590d\u5236\u4e0a\uff0c\u540c\u65f6\u4e5f\u80fd\u63d0\u4f9b\u6570\u636e\u5e93\u529f\u80fd\u3002\u5728Google\u7c7b\u4f3c\u7684\u7cfb\u7edf\u6709BigTable\u548cMegastore\u3002\u548c\u8fd9\u4e24\u8005\u76f8\u6bd4\uff0cSpanner\u53c8\u6709\u4ec0\u4e48\u4f18\u52bf\u5462\u3002<\/p>\n BigTable\u5728Google\u5f97\u5230\u4e86\u5e7f\u6cdb\u7684\u4f7f\u7528\uff0c\u4f46\u662f\u4ed6\u4e0d\u80fd\u63d0\u4f9b\u8f83\u4e3a\u590d\u6742\u7684Schema\uff0c\u8fd8\u6709\u5728\u8de8\u6570\u636e\u4e2d\u5fc3\u73af\u5883\u4e0b\u7684\u5f3a\u4e00\u81f4\u6027\u3002Megastore\u6709\u7c7bRDBMS\u7684\u6570\u636e\u6a21\u578b\uff0c\u540c\u65f6\u4e5f\u652f\u6301\u540c\u6b65\u590d\u5236\uff0c\u4f46\u662f\u4ed6\u7684\u541e\u5410\u91cf\u592a\u5dee\uff0c\u4e0d\u80fd\u9002\u5e94\u5e94\u7528\u8981\u6c42\u3002Spanner\u4e0d\u518d\u662f\u7c7b\u4f3cBigTable\u7684\u7248\u672c\u5316 key-value\u5b58\u50a8\uff0c\u800c\u662f\u4e00\u4e2a\u201c\u4e34\u65f6\u591a\u7248\u672c\u201d\u7684\u6570\u636e\u5e93\u3002\u4f55\u4e3a\u201c\u4e34\u65f6\u591a\u7248\u672c\u201d\uff0c\u6570\u636e\u662f\u5b58\u50a8\u5728\u4e00\u4e2a\u7248\u672c\u5316\u7684\u5173\u7cfb\u8868\u91cc\u9762\uff0c\u5b58\u50a8\u7684\u65f6\u95f4\u6570\u636e\u4f1a\u6839\u636e\u5176\u63d0\u4ea4\u7684\u65f6\u95f4\u6253\u4e0a\u65f6\u95f4\u6233\uff0c\u5e94\u7528\u53ef\u4ee5\u8bbf\u95ee\u5230\u8f83\u8001\u7684\u7248\u672c\uff0c\u53e6\u5916\u8001\u7684\u7248\u672c\u4e5f\u4f1a\u88ab\u5783\u573e\u56de\u6536\u6389\u3002<\/p>\n Google\u5b98\u65b9\u8ba4\u4e3a Spanner\u662f\u4e0b\u4e00\u4ee3BigTable\uff0c\u4e5f\u662fMegastore\u7684\u7ee7\u4efb\u8005\u3002<\/p>\n \u4ece\u9ad8\u5c42\u770bSpanner\u662f\u901a\u8fc7Paxos\u72b6\u6001\u673a\u5c06\u5206\u533a\u597d\u7684\u6570\u636e\u5206\u5e03\u5728\u5168\u7403\u7684\u3002\u6570\u636e\u590d\u5236\u5168\u7403\u5316\u7684\uff0c\u7528\u6237\u53ef\u4ee5\u6307\u5b9a\u6570\u636e\u590d\u5236\u7684\u4efd\u6570\u548c\u5b58\u50a8\u7684\u5730\u70b9\u3002Spanner\u53ef\u4ee5\u5728\u96c6\u7fa4\u6216\u8005\u6570\u636e\u53d1\u751f\u53d8\u5316\u7684\u65f6\u5019\u5c06\u6570\u636e\u8fc1\u79fb\u5230\u5408\u9002\u7684\u5730\u70b9\uff0c\u505a\u8d1f\u8f7d\u5747\u8861\u3002\u7528\u6237\u53ef\u4ee5\u6307\u5b9a\u5c06\u6570\u636e\u5206\u5e03\u5728\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\uff0c\u4e0d\u8fc7\u66f4\u591a\u7684\u6570\u636e\u4e2d\u5fc3\u5c06\u9020\u6210\u66f4\u591a\u7684\u5ef6\u8fdf\u3002\u7528\u6237\u9700\u8981\u5728\u53ef\u9760\u6027\u548c\u5ef6\u8fdf\u4e4b\u95f4\u505a\u6743\u8861\uff0c\u4e00\u822c\u6765\u8bf4\u590d\u52361\uff0c2\u4e2a\u6570\u636e\u4e2d\u5fc3\u8db3\u4ee5\u4fdd\u8bc1\u53ef\u9760\u6027\u3002<\/p>\n \u4f5c\u4e3a\u4e00\u4e2a\u5168\u7403\u5316\u5206\u5e03\u5f0f\u7cfb\u7edf\uff0cSpanner\u63d0\u4f9b\u4e00\u4e9b\u6709\u8da3\u7684\u7279\u6027\u3002<\/p>\n \u8fd9\u5199\u7279\u6027\u90fd\u5f97\u76ca\u6709Spanner\u6709\u4e00\u4e2a\u5168\u7403\u65f6\u95f4\u540c\u6b65\u673a\u5236\uff0c\u53ef\u4ee5\u5728\u6570\u636e\u63d0\u4ea4\u7684\u65f6\u5019\u7ed9\u51fa\u4e00\u4e2a\u65f6\u95f4\u6233\u3002\u56e0\u4e3a\u65f6\u95f4\u662f\u7cfb\u5217\u5316\u7684\uff0c\u6240\u4ee5\u624d\u6709\u5916\u90e8\u4e00\u81f4\u6027\u3002\u8fd9\u4e2a\u5f88\u5bb9\u6613\u7406\u89e3\uff0c\u5982\u679c\u6709\u4e24\u4e2a\u63d0\u4ea4\uff0c\u4e00\u4e2a\u5728T1,\u4e00\u4e2a\u5728T2\u3002\u90a3\u6709\u66f4\u665a\u7684\u65f6\u95f4\u6233\u90a3\u4e2a\u63d0\u4ea4\u662f\u6b63\u786e\u7684\u3002<\/p>\n \u8fd9\u4e2a\u5168\u7403\u65f6\u95f4\u540c\u6b65\u673a\u5236\u662f\u7528\u4e00\u4e2a\u5177\u6709GPS\u548c\u539f\u5b50\u949f\u7684TrueTime API\u63d0\u4f9b\u4e86\u3002\u8fd9\u4e2aTrueTime API\u80fd\u591f\u5c06\u4e0d\u540c\u6570\u636e\u4e2d\u5fc3\u7684\u65f6\u95f4\u504f\u5dee\u7f29\u77ed\u572810ms\u5185\u3002\u8fd9\u4e2aAPI\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u7cbe\u786e\u7684\u65f6\u95f4\uff0c\u540c\u65f6\u7ed9\u51fa\u8bef\u5dee\u8303\u56f4\u3002Google\u5df2\u7ecf\u6709\u4e86\u4e00\u4e2aTrueTime API\u7684\u5b9e\u73b0\u3002\u7b14\u8005\u89c9\u5f97\u8fd9\u4e2aTrueTime API \u975e\u5e38\u6709\u610f\u4e49\uff0c\u5982\u679c\u80fd\u5355\u72ec\u5f00\u6e90\u8fd9\u90e8\u5206\u7684\u8bdd\uff0c\u5f88\u591a\u6570\u636e\u5e93\u5982MongoDB\u90fd\u53ef\u4ee5\u4ece\u4e2d\u53d7\u76ca\u3002<\/p>\n Spanner\u7531\u4e8e\u662f\u5168\u7403\u5316\u7684\uff0c\u6240\u4ee5\u6709\u4e24\u4e2a\u5176\u4ed6\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u6ca1\u6709\u7684\u6982\u5ff5\u3002<\/p>\n <\/a><\/p>\n \u5982\u56fe\u6240\u793a\u3002\u4e00\u4e2aSpanner\u6709\u4e0a\u9762\u4e00\u4e9b\u7ec4\u4ef6\u3002\u5b9e\u9645\u7684\u7ec4\u4ef6\u80af\u5b9a\u4e0d\u6b62\u8fd9\u4e9b\uff0c\u6bd4\u5982TrueTime API Server\u3002\u5982\u679c\u4ec5\u4ec5\u77e5\u9053\u8fd9\u4e9b\u77e5\u8bc6\uff0c\u6765\u6784\u5efaSpanner\u662f\u8fdc\u8fdc\u4e0d\u591f\u7684\u3002\u4f46Google\u90fd\u7565\u53bb\u4e86\u3002\u90a3\u7b14\u8005\u5c31\u7b80\u8981\u4ecb\u7ecd\u4e00\u4e0b\u3002<\/p>\n <\/p>\n \u672c\u7ae0\u8be6\u7ec6\u4ecb\u7ecdSpanserver\u7684\u8bbe\u8ba1\u5b9e\u73b0\u3002Spanserver\u7684\u8bbe\u8ba1\u548cBigTable\u975e\u5e38\u7684\u76f8\u4f3c\u3002\u53c2\u7167\u4e0b\u56fe<\/p>\n <\/a><\/p>\n \u4ece\u4e0b\u5f80\u4e0a\u770b\u3002\u6bcf\u4e2a\u6570\u636e\u4e2d\u5fc3\u4f1a\u8fd0\u884c\u4e00\u5957Colossus (GFS II) \u3002\u6bcf\u4e2a\u673a\u5668\u6709100-1000\u4e2atablet\u3002Tablet\u6982\u5ff5\u4e0a\u5c06\u76f8\u5f53\u4e8e\u6570\u636e\u5e93\u4e00\u5f20\u8868\u91cc\u7684\u4e00\u4e9b\u884c\uff0c\u7269\u7406\u4e0a\u662f\u6570\u636e\u6587\u4ef6\u3002\u6253\u4e2a\u6bd4\u65b9\uff0c\u4e00\u5f201000\u884c\u7684\u8868\uff0c\u670910\u4e2atablet\uff0c\u7b2c1-100\u884c\u662f\u4e00\u4e2atablet\uff0c\u7b2c101-200\u662f\u4e00\u4e2atablet\u3002\u4f46\u548cBigTable\u4e0d\u540c\u7684\u662fBigTable\u91cc\u9762\u7684tablet\u5b58\u50a8\u7684\u662fKey-Value\u90fd\u662fstring\uff0cSpanner\u5b58\u50a8\u7684Key\u591a\u4e86\u4e00\u4e2a\u65f6\u95f4\u6233\uff1a<\/p>\n (Key: string, timestamp: int64) -> string\u3002<\/p>\n \u56e0\u6b64spanner\u5929\u751f\u5c31\u652f\u6301\u591a\u7248\u672c\uff0ctablet\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u662f\u4e00\u4e2aB-tree-like\u7684\u6587\u4ef6\u548c\u4e00\u4e2awrite-ahead\u65e5\u5fd7\u3002<\/p>\n \u6bcf\u4e2aTablet\u4e0a\u4f1a\u6709\u4e00\u4e2aPaxos\u72b6\u6001\u673a\u3002Paxos\u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u534f\u8bae\u3002Table\u7684\u5143\u6570\u636e\u548clog\u90fd\u5b58\u50a8\u5728\u4e0a\u9762\u3002Paxos\u4f1a\u9009\u51fa\u4e00\u4e2areplica\u505aleader\uff0c\u8fd9\u4e2aleader\u7684\u5bff\u547d\u9ed8\u8ba4\u662f10s,10s\u540e\u91cd\u9009\u3002Leader\u5c31\u76f8\u5f53\u4e8e\u590d\u5236\u6570\u636e\u7684master\uff0c\u5176\u4ed6replica\u7684\u6570\u636e\u90fd\u662f\u4ece\u4ed6\u90a3\u91cc\u590d\u5236\u7684\u3002\u8bfb\u8bf7\u6c42\u53ef\u4ee5\u8d70\u4efb\u610f\u7684replica\uff0c\u4f46\u662f\u5199\u8bf7\u6c42\u53ea\u6709\u53bbleader\u3002\u8fd9\u4e9breplica\u7edf\u79f0\u4e3a\u4e00\u4e2apaxos group\u3002<\/p>\n \u6bcf\u4e2aleader replica\u7684spanserver\u4e0a\u4f1a\u5b9e\u73b0\u4e00\u4e2alock table\u8fd8\u7ba1\u7406\u5e76\u53d1\u3002Lock table\u8bb0\u5f55\u4e86\u4e24\u9636\u6bb5\u63d0\u4ea4\u9700\u8981\u7684\u9501\u4fe1\u606f\u3002\u4f46\u662f\u4e0d\u8bba\u662f\u5728Spanner\u8fd8\u662f\u5728BigTable\u4e0a\uff0c\u4f46\u9047\u5230\u51b2\u7a81\u7684\u65f6\u5019\u957f\u65f6\u95f4\u4e8b\u52a1\u4f1a\u5c06\u6027\u80fd\u5f88\u5dee\u3002\u6240\u4ee5\u6709\u4e00\u4e9b\u64cd\u4f5c\uff0c\u5982\u4e8b\u52a1\u8bfb\u53ef\u4ee5\u8d70lock table\uff0c\u5176\u4ed6\u7684\u64cd\u4f5c\u53ef\u4ee5\u7ed5\u5f00lock table\u3002<\/p>\n \u6bcf\u4e2aleader replica\u7684spanserver\u4e0a\u8fd8\u6709\u4e00\u4e2atransaction manager\u3002\u5982\u679c\u4e8b\u52a1\u5728\u4e00\u4e2apaxos group\u91cc\u9762\uff0c\u53ef\u4ee5\u7ed5\u8fc7transaction manager\u3002\u4f46\u662f\u4e00\u65e6\u4e8b\u52a1\u8de8\u591a\u4e2apaxos group\uff0c\u5c31\u9700\u8981transaction manager\u6765\u534f\u8c03\u3002\u5176\u4e2d\u4e00\u4e2aTransaction manager\u88ab\u9009\u4e3aleader\uff0c\u5176\u4ed6\u7684\u662fslave\u542c\u4ed6\u6307\u6325\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u3002<\/p>\n \u4e4b\u6240\u4ee5Spanner\u6bd4BigTable\u6709\u66f4\u5f3a\u7684\u6269\u5c55\u6027\uff0c\u5728\u4e8eSpanner\u8fd8\u6709\u4e00\u5c42\u62bd\u8c61\u7684\u6982\u5ff5directory, directory\u662f\u4e00\u4e9bkey-value\u7684\u96c6\u5408\uff0c\u4e00\u4e2adirectory\u91cc\u9762\u7684key\u6709\u4e00\u6837\u7684\u524d\u7f00\u3002\u66f4\u59a5\u5f53\u7684\u53eb\u6cd5\u662fbucketing\u3002Directory\u662f\u5e94\u7528\u63a7\u5236\u6570\u636e\u4f4d\u7f6e\u7684\u6700\u5c0f\u5355\u5143\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c28\u614e\u7684\u9009\u62e9Key\u7684\u524d\u7f00\u6765\u63a7\u5236\u3002\u636e\u6b64\u7b14\u8005\u53ef\u4ee5\u731c\u51fa\uff0c\u5728\u8bbe\u8ba1\u521d\u671f\uff0cSpanner\u662f\u4f5c\u4e3aF1\u7684\u5b58\u50a8\u7cfb\u7edf\u800c\u8bbe\u7acb\uff0c\u751a\u81f3\u8fd8\u8bbe\u8ba1\u6709\u7c7b\u4f3cdirectory\u7684\u5c42\u6b21\u7ed3\u6784\uff0c\u8fd9\u6837\u7684\u5c42\u6b21\u6709\u5f88\u591a\u597d\u5904\uff0c\u4f46\u662f\u5b9e\u73b0\u592a\u590d\u6742\u88ab\u6452\u5f03\u4e86\u3002<\/p>\n Directory\u4f5c\u4e3a\u6570\u636e\u653e\u7f6e\u7684\u6700\u5c0f\u5355\u5143\uff0c\u53ef\u4ee5\u5728paxos group\u91cc\u9762\u79fb\u6765\u79fb\u53bb\u3002Spanner\u79fb\u52a8\u4e00\u4e2adirectory\u4e00\u822c\u51fa\u4e8e\u5982\u4e0b\u51e0\u4e2a\u539f\u56e0\uff1a<\/p>\n Directory\u53ef\u4ee5\u5728\u4e0d\u5f71\u54cdclient\u7684\u524d\u63d0\u4e0b\uff0c\u5728\u540e\u53f0\u79fb\u52a8\u3002\u79fb\u52a8\u4e00\u4e2a50MB\u7684directory\u5927\u6982\u9700\u8981\u7684\u51e0\u79d2\u949f\u3002<\/p>\n \u90a3\u4e48directory\u548ctablet\u53c8\u662f\u4ec0\u4e48\u5173\u7cfb\u5462\u3002\u53ef\u4ee5\u7406\u89e3\u4e3aDirectory\u662f\u4e00\u4e2a\u62bd\u8c61\u7684\u6982\u5ff5\uff0c\u7ba1\u7406\u6570\u636e\u7684\u5355\u5143\uff1b\u800ctablet\u662f\u7269\u7406\u7684\u4e1c\u897f\uff0c\u6570\u636e\u6587\u4ef6\u3002\u7531\u4e8e\u4e00\u4e2aPaxos group\u53ef\u80fd\u4f1a\u6709\u591a\u4e2adirectory\uff0c\u6240\u4ee5spanner\u7684tablet\u5b9e\u73b0\u548cBigTable\u7684tablet\u5b9e\u73b0\u6709\u4e9b\u4e0d\u540c\u3002BigTable\u7684tablet\u662f\u5355\u4e2a\u987a\u5e8f\u6587\u4ef6\u3002Google\u6709\u4e2a\u9879\u76ee\uff0c\u540d\u4e3aLevel DB\uff0c\u662fBigTable\u7684\u5e95\u5c42\uff0c\u53ef\u4ee5\u770b\u5230\u5176\u5b9e\u73b0\u7ec6\u8282\u3002\u800cSpanner\u7684tablet\u53ef\u4ee5\u7406\u89e3\u662f\u4e00\u4e9b\u57fa\u4e8e\u884c\u7684\u5206\u533a\u7684\u5bb9\u5668\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5c06\u4e00\u4e9b\u7ecf\u5e38\u540c\u65f6\u8bbf\u95ee\u7684directory\u653e\u5728\u4e00\u4e2atablet\u91cc\u9762\uff0c\u800c\u4e0d\u7528\u592a\u5728\u610f\u987a\u5e8f\u5173\u7cfb\u3002<\/p>\n \u5728paxos group\u4e4b\u95f4\u79fb\u52a8directory\u662f\u540e\u53f0\u4efb\u52a1\u3002\u8fd9\u4e2a\u64cd\u4f5c\u8fd8\u88ab\u7528\u6765\u79fb\u52a8replicas\u3002\u79fb\u52a8\u64cd\u4f5c\u8bbe\u8ba1\u7684\u65f6\u5019\u4e0d\u662f\u4e8b\u52a1\u7684\uff0c\u56e0\u4e3a\u8fd9\u6837\u4f1a\u9020\u6210\u5927\u91cf\u7684\u8bfb\u5199block\u3002\u64cd\u4f5c\u7684\u65f6\u5019\u662f\u5148\u5c06\u5b9e\u9645\u6570\u636e\u79fb\u52a8\u5230\u6307\u5b9a\u4f4d\u7f6e\uff0c\u7136\u540e\u518d\u7528\u4e00\u4e2a\u539f\u5b50\u7684\u64cd\u4f5c\u66f4\u65b0\u5143\u6570\u636e\uff0c\u5b8c\u6210\u6574\u4e2a\u79fb\u52a8\u8fc7\u7a0b\u3002<\/p>\n Directory\u8fd8\u662f\u8bb0\u5f55\u5730\u7406\u4f4d\u7f6e\u7684\u6700\u5c0f\u5355\u5143\u3002\u6570\u636e\u7684\u5730\u7406\u4f4d\u7f6e\u662f\u7531\u5e94\u7528\u51b3\u5b9a\u7684\uff0c\u914d\u7f6e\u7684\u65f6\u5019\u9700\u8981\u6307\u5b9a\u590d\u5236\u6570\u76ee\u548c\u7c7b\u578b\uff0c\u8fd8\u6709\u5730\u7406\u7684\u4f4d\u7f6e\u3002\u6bd4\u5982(\u4e0a\u6d77\uff0c\u590d\u52362\u4efd\uff1b\u5357\u4eac\u590d\u52361\u5206) \u3002\u8fd9\u6837\u5e94\u7528\u5c31\u53ef\u4ee5\u6839\u636e\u7528\u6237\u6307\u5b9a\u7ec8\u7aef\u7528\u6237\u5b9e\u9645\u60c5\u51b5\u51b3\u5b9a\u7684\u6570\u636e\u5b58\u50a8\u4f4d\u7f6e\u3002\u6bd4\u5982\u4e2d\u56fd\u961f\u7684\u6570\u636e\u5728\u4e9a\u6d32\u67093\u4efd\u62f7\u8d1d, \u65e5\u672c\u961f\u7684\u6570\u636e\u5168\u7403\u90fd\u6709\u62f7\u8d1d\u3002<\/p>\n \u524d\u9762\u5bf9directory\u8fd8\u662f\u88ab\u7b80\u5316\u8fc7\u7684\uff0c\u8fd8\u6709\u5f88\u591a\u65e0\u6cd5\u8be6\u8ff0\u3002<\/p>\n Spanner\u7684\u6570\u636e\u6a21\u578b\u6765\u81ea\u4e8eGoogle\u5185\u90e8\u7684\u5b9e\u8df5\u3002\u5728\u8bbe\u8ba1\u4e4b\u521d\uff0cSpanner\u5c31\u51b3\u5fc3\u6709\u4ee5\u4e0b\u7684\u7279\u6027\uff1a<\/p>\n \u4e3a\u4f55\u4f1a\u8fd9\u6837\u51b3\u5b9a\u5462\uff1f\u5728Google\u5185\u90e8\u8fd8\u6709\u4e00\u4e2aMegastore\uff0c\u5c3d\u7ba1\u8981\u5fcd\u53d7\u6027\u80fd\u4e0d\u591f\u7684\u6298\u78e8\uff0c\u4f46\u662f\u5728Google\u6709300\u591a\u4e2a\u5e94\u7528\u5728\u7528\u5b83\uff0c\u56e0\u4e3aMegastore\u652f\u6301\u4e00\u4e2a\u7c7b\u4f3c\u5173\u7cfb\u6570\u636e\u5e93\u7684schema\uff0c\u800c\u4e14\u652f\u6301\u540c\u6b65\u590d\u5236 (BigTable\u53ea\u652f\u6301\u6700\u7ec8\u4e00\u81f4\u7684\u590d\u5236) \u3002\u4f7f\u7528Megastore\u7684\u5e94\u7528\u6709\u5927\u540d\u9f0e\u9f0e\u7684Gmail, Picasa, Calendar, Android Market\u548cAppEngine\u3002 \u800c\u5fc5\u987b\u5bf9Query\u8bed\u53e5\u7684\u652f\u6301\uff0c\u6765\u81ea\u4e8e\u5e7f\u53d7\u6b22\u8fce\u7684Dremel\uff0c\u7b14\u8005\u4e0d\u4e45\u524d\u5199\u4e86\u7bc7\u6587\u7ae0\u6765\u4ecb\u7ecd\u4ed6\u3002 \u6700\u540e\u5bf9\u4e8b\u52a1\u7684\u652f\u6301\u662f\u6bd4\u4e0d\u53ef\u5c11\u4e86\uff0cBigTable\u5728Google\u5185\u90e8\u88ab\u62b1\u6028\u7684\u6700\u591a\u7684\u5c31\u662f\u5176\u53ea\u80fd\u652f\u6301\u884c\u4e8b\u52a1\uff0c\u518d\u5927\u7c92\u5ea6\u7684\u4e8b\u52a1\u5c31\u65e0\u80fd\u4e3a\u529b\u4e86\u3002Spanner\u7684\u5f00\u53d1\u8005\u8ba4\u4e3a\uff0c\u8fc7\u5ea6\u4f7f\u7528\u4e8b\u52a1\u9020\u6210\u7684\u6027\u80fd\u4e0b\u964d\u7684\u6076\u679c\uff0c\u5e94\u8be5\u7531\u5e94\u7528\u7684\u5f00\u53d1\u8005\u627f\u62c5\u3002\u5e94\u7528\u5f00\u53d1\u8005\u5728\u4f7f\u7528\u4e8b\u52a1\u7684\u65f6\u5019\uff0c\u5fc5\u987b\u8003\u8651\u5230\u6027\u80fd\u95ee\u9898\u3002\u800c\u6570\u636e\u5e93\u5fc5\u987b\u63d0\u4f9b\u4e8b\u52a1\u673a\u5236\uff0c\u800c\u4e0d\u662f\u56e0\u4e3a\u6027\u80fd\u95ee\u9898\uff0c\u5c31\u5e72\u8106\u4e0d\u63d0\u4f9b\u4e8b\u52a1\u652f\u6301\u3002<\/p>\n \u6570\u636e\u6a21\u578b\u662f\u5efa\u7acb\u5728directory\u548ckey-value\u6a21\u578b\u7684\u62bd\u8c61\u4e4b\u4e0a\u7684\u3002\u4e00\u4e2a\u5e94\u7528\u53ef\u4ee5\u5728\u4e00\u4e2auniverse\u4e2d\u5efa\u7acb\u4e00\u4e2a\u6216\u591a\u4e2adatabase\uff0c\u5728\u6bcf\u4e2adatabase\u4e2d\u5efa\u7acb\u4efb\u610f\u7684table\u3002Table\u770b\u8d77\u6765\u5c31\u50cf\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u8868\u3002\u6709\u884c\uff0c\u6709\u5217\uff0c\u8fd8\u6709\u7248\u672c\u3002Query\u8bed\u53e5\u770b\u8d77\u6765\u662f\u591a\u4e86\u4e00\u4e9b\u6269\u5c55\u7684SQL\u8bed\u53e5\u3002<\/p>\n Spanner\u7684\u6570\u636e\u6a21\u578b\u4e5f\u4e0d\u662f\u7eaf\u6b63\u7684\u5173\u7cfb\u6a21\u578b\uff0c\u6bcf\u4e00\u884c\u90fd\u5fc5\u987b\u6709\u4e00\u5217\u6216\u591a\u5217\u7ec4\u4ef6\u3002\u770b\u8d77\u6765\u8fd8\u662fKey-value\u3002\u4e3b\u952e\u7ec4\u6210Key,\u5176\u4ed6\u7684\u5217\u662fValue\u3002\u4f46\u8fd9\u6837\u7684\u8bbe\u8ba1\u5bf9\u5e94\u7528\u4e5f\u662f\u5f88\u6709\u88e8\u76ca\u7684\uff0c\u5e94\u7528\u53ef\u4ee5\u901a\u8fc7\u4e3b\u952e\u6765\u5b9a\u4f4d\u5230\u67d0\u4e00\u884c\u3002<\/p>\n <\/a><\/p>\n \u4e0a\u56fe\u662f\u4e00\u4e2a\u4f8b\u5b50\u3002\u5bf9\u4e8e\u4e00\u4e2a\u5178\u578b\u7684\u76f8\u518c\u5e94\u7528\uff0c\u9700\u8981\u5b58\u50a8\u5176\u7528\u6237\u548c\u76f8\u518c\u3002\u53ef\u4ee5\u7528\u4e0a\u9762\u7684\u4e24\u4e2aSQL\u6765\u521b\u5efa\u8868\u3002Spanner\u7684\u8868\u662f\u5c42\u6b21\u5316\u7684\uff0c\u6700\u9876\u5c42\u7684\u8868\u662fdirectory table\u3002\u5176\u4ed6\u7684\u8868\u521b\u5efa\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u7528 interleave in parent\u6765\u4ec0\u4e48\u5c42\u6b21\u5173\u7cfb\u3002\u8fd9\u6837\u7684\u7ed3\u6784\uff0c\u5728\u5b9e\u73b0\u7684\u65f6\u5019\uff0cSpanner\u53ef\u4ee5\u5c06\u5d4c\u5957\u7684\u6570\u636e\u653e\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u5728\u5206\u533a\u7684\u65f6\u5019\u6027\u80fd\u4f1a\u63d0\u5347\u5f88\u591a\u3002\u5426\u5219Spanner\u65e0\u6cd5\u83b7\u77e5\u6700\u91cd\u8981\u7684\u8868\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\nSpanner\u80cc\u666f<\/h5>\n
F1<\/h6>\n
\n
Colossus\uff08GFS II\uff09<\/h6>\n
\n
\u4e0eBigTable\uff0c Megastore\u5bf9\u6bd4<\/h6>\n
Google Spanner\u8bbe\u8ba1<\/h5>\n
\u529f\u80fd<\/h6>\n
\n
\u4f53\u7cfb\u7ed3\u6784<\/h6>\n
\n
\n
Spanserver<\/h6>\n
Directories and Placement<\/h6>\n
\n
\u6570\u636e\u6a21\u578b<\/h6>\n
\n
TrueTime<\/h6>\n