{"id":86426,"date":"2024-01-04T05:15:05","date_gmt":"2024-01-03T21:15:05","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=86426"},"modified":"2024-01-04T05:15:05","modified_gmt":"2024-01-03T21:15:05","slug":"sql-vs-nosql","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sql-vs-nosql.html","title":{"rendered":"\u6570\u636e\u7684\u672a\u6765\uff1aSQL\u6b63\u5728\u51fb\u8d25NoSQL\uff1f"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u968f\u7740\u8ba1\u7b97\u673a\u7684\u65e5\u76ca\u666e\u53ca\uff0c\u5404\u79cd\u5e94\u7528\u6bcf\u5929\u4ea7\u751f\u7684\u6570\u636e\u91cf\u5448\u6307\u6570\u7ea7\u589e\u957f\u3002\u5982\u4f55\u5b58\u50a8\u8fd9\u4e9b\u6570\u636e\uff0c\u6709\u6548\u5904\u7406\u5206\u6790\u8fd9\u4e9b\u6570\u636e,\u5e76\u4ece\u4e2d\u63d0\u53d6\u6709\u4ef7\u503c\u7684\u4fe1\u606f,\u662f\u5f53\u4e0b\u8feb\u5207\u9700\u8981\u89e3\u51b3\u7684\u95ee\u9898\u3002\u5728\u8fc7\u53bb\u7684\u5341\u5e74\u91cc\uff0cNoSQL\u5728\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u9635\u8425\u91cc\u8d8a\u6765\u8d8a\u53d7\u6b22\u8fce\uff0c\u5176\u4e2d\u6700\u91cd\u8981\u7684\u5b9e\u73b0\u662fMapReduce \uff0cBigtable,Cassandra\uff0cMongoDB,\u7b49\u4ea7\u54c1\u3002 \u5b83\u4e3b\u8981\u7528\u4e8e\u89e3\u51b3SQL\u7684\u53ef\u6269\u5c55\u6027\u95ee\u9898\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u7136\u800c\u4eca\u5929SQL\u5f00\u59cb\u56de\u5f52\u3002\u51e0\u4e4e\u6240\u6709\u7684\u4e91\u8ba1\u7b97\u670d\u52a1\u63d0\u4f9b\u5546\u90fd\u5728\u63d0\u4f9b\u5907\u53d7\u9752\u7750\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u670d\u52a1\uff1a\u4f8b\u5982Amazon RDS\uff0cGoogle Cloud SQL\uff0cAzure \u7684PostgreSQL\u6570\u636e\u5e93\uff08Azure\u4eca\u5e74\u63a8\u51fa\uff09\u3002\u5728\u4e9a\u9a6c\u900a\u770b\u6765\uff0c\u5176PostgreSQL\u548cMySQL\u517c\u5bb9\u7684\u6570\u636e\u5e93\u4ea7\u54c1Aurora\u4e00\u76f4\u662fAWS\u5386\u53f2\u4e0a\u589e\u957f\u6700\u5feb\u7684\u670d\u52a1\u3002Hadoop\u548cSpark\u4e4b\u4e0a\u7684SQL\u63a5\u53e3\u7ee7\u7eed\u8fc5\u731b\u53d1\u5c55\u3002\u5c31\u5728\u4e0a\u4e2a\u6708\uff0cKafka\u63a8\u51fa\u4e86SQL\u652f\u6301\u3002<\/p>\n \u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u7814\u7a76SQL\u5907\u53d7\u9752\u7750\u7684\u539f\u56e0\u4ee5\u53ca\u8fd9\u5bf9\u672a\u6765\u7684\u6570\u636e\u793e\u533a\u5de5\u7a0b\u548c\u5206\u6790\u610f\u5473\u7740\u4ec0\u4e48\u3002<\/p>\n \u7b2c1\u90e8\u5206\uff1a\u65b0\u5e0c\u671b\u7684\u5d1b\u8d77<\/strong><\/div>\n \u60f3\u8981\u4e86\u89e3SQL\u4e3a\u4ec0\u4e48\u56de\u5f52\uff0c\u8ba9\u6211\u4eec\u5148\u4e86\u89e3\u4ed6\u6700\u521d\u7684\u8bbe\u8ba1\u521d\u8877\u3002<\/p>\n \u6545\u4e8b\u59cb\u4e8e20\u4e16\u7eaa70\u5e74\u4ee3\u521d\u7684IBM\u7814\u7a76\u9662\uff0c\u5176\u4e2d\u5173\u7cfb\u578b\u6570\u636e\u5e93\u8bde\u751f\u4e86\u3002\u90a3\u65f6\u5019\uff0c\u67e5\u8be2\u8bed\u8a00\u4f9d\u8d56\u4e8e\u590d\u6742\u7684\u6570\u5b66\u903b\u8f91\u548c\u7b26\u53f7\u3002Donald Chamberlin\u548cRaymond Boyce\u4e24\u4f4d\u535a\u58eb\u5bf9\u5173\u7cfb\u578b\u6570\u636e\u6a21\u578b\u9020\u8be3\u9887\u6df1\uff0c\u770b\u5230\u67e5\u8be2\u8bed\u8a00\u5c06\u6210\u4e3a\u5176\u4e3b\u8981\u74f6\u9888\u3002\u4ed6\u4eec\u5f00\u59cb\u8bbe\u8ba1\u4e00\u79cd\u65b0\u7684\u67e5\u8be2\u8bed\u8a00\uff08\u4ee5\u4ed6\u4eec\u81ea\u5df1\u7684\u8bdd\u6765\u8bf4\uff09\uff1a\u201c \u7528\u6237\u4f7f\u7528\u66f4\u5bb9\u6613\uff0c\u4e0d\u9700\u8981\u518d\u53c2\u52a0\u6570\u5b66\u6216\u8ba1\u7b97\u673a\u7a0b\u5e8f\u8bbe\u8ba1\u65b9\u9762\u7684\u6b63\u89c4\u57f9\u8bad \u201d\u3002<\/p>\n \u56de\u60f3\u5728\u4e92\u8054\u7f51\u4e4b\u524d\uff0c\u5728PC\u51fa\u73b0\u4ee5\u524d\uff0c\u5f53\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00C\u9996\u6b21\u88ab\u5f15\u5165\u4e16\u754c\u65f6\uff0c\u4e24\u540d\u5e74\u8f7b\u7684\u8ba1\u7b97\u673a\u79d1\u5b66\u5bb6\u610f\u8bc6\u5230\uff0c\u201c\u8ba1\u7b97\u673a\u884c\u4e1a\u7684\u6210\u529f\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e\u57f9\u517b\u4e00\u79cd\u9664\u4e86\u8bad\u7ec3\u6709\u7d20\u7684\u8ba1\u7b97\u673a\u4e13\u5bb6\u4ee5\u5916\u7684\u7528\u6237\u3002\u201c\u4ed6\u4eec\u6e34\u671b\u4e00\u79cd\u4e0e\u82f1\u6587\u4e00\u6837\u5bb9\u6613\u9605\u8bfb\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u5305\u62ec\u6570\u636e\u5e93\u7ba1\u7406\u548c\u64cd\u4f5c\u3002<\/p>\n \u7ed3\u679c\u662fSQL\u57281974\u5e74\u9996\u6b21\u88ab\u5f15\u5165\u4e16\u754c\uff0c\u6210\u4e86\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u6700\u4e3b\u8981\u8bed\u8a00\u3002\u5728\u63a5\u4e0b\u6765\u7684\u51e0\u5341\u5e74\u91cc\uff0cSQL\u88ab\u8bc1\u660e\u4e5f\u662f\u5f88\u53d7\u6b22\u8fce\u7684\u3002\u4f5c\u4e3a\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u5982System R\uff0cIngres\uff0cDB2\uff0cOracle\uff0cSQL Server\uff0cPostgreSQL\uff0cMySQL\uff08\u7b49\u7b49\uff09\u5728\u8f6f\u4ef6\u884c\u4e1a\u91cc\u7684\u53d1\u5c55\u58ee\u5927\uff0cSQL\u4e5f\u6210\u4e3a\u4e86\u4e0e\u6570\u636e\u5e93\u8fdb\u884c\u4ea4\u4e92\u7684\u9996\u9009\u8bed\u8a00\uff0c\u6210\u4e3a\u4e86\u4e00\u4e2a\u65e5\u76ca\u62e5\u6324\u3001\u7ade\u4e89\u6fc0\u70c8\u7684\u751f\u6001\u7cfb\u7edf\u7684\u901a\u7528\u8bed\u8a00\u3002\u3002<\/p>\n \uff08\u4e0d\u5e78\u7684\u662f\uff0cRaymond Boyce\u4ece\u6765\u6ca1\u6709\u673a\u4f1a\u89c1\u8bc1SQL\u7684\u6210\u529f\uff0c\u4ed6\u53ea\u505a\u4e86\u4e00\u4e2a\u65e9\u671f\u7684SQL\u6f14\u8bb2\uff0c1\u4e2a\u6708\u540e\u4ed6\u4fbf\u6b7b\u4e8e\u8111\u52a8\u8109\u7624\uff0c\u5f53\u65f6\u4ed6\u53ea\u670926\u5c81\uff0c\u7559\u4e0b\u4e86\u4e00\u4e2a\u59bb\u5b50\u548c\u4e00\u4e2a\u5e74\u8f7b\u7684\u5973\u513f\u3002\uff09<\/p>\n \u6709\u4e00\u6bb5\u65f6\u95f4\uff0c\u4f3c\u4e4eSQL\u5df2\u7ecf\u6210\u529f\u5730\u5c65\u884c\u4e86\u5b83\u7684\u4f7f\u547d\u3002\u63a5\u7740\u4e92\u8054\u7f51\u51fa\u73b0\u4e86\u3002<\/p>\n \u7b2c2\u90e8\u5206\uff1aNoSQL\u53cd\u51fb<\/strong><\/div>\n \u867d\u7136Chamberlin\u548cBoyce\u6b63\u5728\u5f00\u53d1SQL\uff0c\u4f46\u4ed6\u4eec\u6ca1\u6709\u610f\u8bc6\u5230\u7684\u662f\uff0c\u52a0\u5229\u798f\u5c3c\u4e9a\u5dde\u7684 \u53e6\u4e00\u6279\u5de5\u7a0b\u5e08\u6b63\u5728\u5f00\u5c55\u53e6\u4e00\u4e2a\u65b0\u5174\u9879\u76ee\uff0c\u8be5\u9879\u76ee\u9010\u6e10\u6210\u719f\u540e\uff0c\u660e\u663e\u5a01\u80c1\u5230SQL\u7684\u5b58\u5728\u3002\u8be5\u9879\u76ee\u5c31\u662f ARPANET\uff0c\u8bde\u751f\u4e8e1969\u5e7410\u670829\u65e5\u3002<\/p>\n \u4f46\u662f\u6b64\u524dSQL\u53d1\u5c55\u4e00\u76f4\u5f88\u597d\uff0c\u76f4\u52301989\u5e74\uff0c\u53e6\u4e00\u4f4d\u5de5\u7a0b\u5e08\u7684\u51fa\u73b0\u5e76\u53d1\u660e\u4e86\u4e07\u7ef4\u7f51\u3002<\/p>\n \u4e92\u8054\u7f51\u548cWeb\u7684\u84ec\u52c3\u53d1\u5c55\u6b63\u5728\u6539\u53d8\u7740\u6211\u4eec\u7684\u4e16\u754c\uff0c\u4f46\u662f\u5bf9\u4e8e\u6570\u636e\u793e\u533a\u6765\u8bf4\uff0c\u4e5f\u662f\u5f88\u8ba9\u4eba\u5934\u75db\u7684\uff1a\u6570\u636e\u4ee5\u5927\u7684\u91cf\u7ea7\u548c\u66f4\u5feb\u7684\u901f\u5ea6\u7206\u70b8\u5f0f\u589e\u957f\u3002<\/p>\n \u968f\u7740\u4e92\u8054\u7f51\u7684\u4e0d\u65ad\u53d1\u5c55\u548c\u58ee\u5927\uff0c\u8f6f\u4ef6\u793e\u533a\u53d1\u73b0\u5f53\u65f6\u7684\u5173\u7cfb\u6570\u636e\u5e93\u65e0\u6cd5\u5e94\u5bf9\u65b0\u7684\u8d1f\u8f7d\u538b\u529b\uff0c\u5c31\u597d\u50cf\u4e00\u767e\u4e07\u4e2a\u6570\u636e\u5e93\u7a81\u7136\u8fc7\u8f7d\u8ba9\u4eba\u6293\u72c2\u4e00\u822c\u3002<\/p>\n \u7136\u540e\u4e24\u5bb6\u65b0\u7684\u4e92\u8054\u7f51\u5de8\u5934\u53d6\u5f97\u7a81\u7834\uff0c\u5e76\u5f00\u53d1\u4e86\u81ea\u5df1\u7684\u975e\u5173\u7cfb\u578b\u5206\u5e03\u5f0f\u7cfb\u7edf\u6765\u5e94\u5bf9\u8fd9\u79cd\u65b0\u7684\u6570\u636e\u51b2\u51fb\uff1aGoogle\u7684MapReduce\uff082004\u5e74\u53d1\u5e03\uff09\u548cBigtable\uff082006\u5e74\u53d1\u5e03\uff09\u4ee5\u53ca\u4e9a\u9a6c\u900a\u7684Dynamo\uff082007\u5e74\u53d1\u5e03\uff09\u3002\u8fd9\u4e9b\u5f00\u521b\u6027\u8bba\u6587\u5bfc\u81f4\u51fa\u73b0\u4e86\u66f4\u591a\u7684\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u5305\u62ecHadoop\uff08\u57fa\u4e8eMapReduce\u8bba\u6587\uff0c2006\uff09\uff0cCassandra\uff08Bigtable\u548cDynamo\u7684\u6df1\u5ea6\u89e3\u6790\uff0c2008 \uff09\u548cMongoDB\uff082009\uff09\uff09\u3002\u56e0\u4e3a\u8fd9\u4e9b\u90fd\u662f\u4ece\u96f6\u5f00\u59cb\u5927\u91cf\u7f16\u5199\u7684\u65b0\u7cfb\u7edf\uff0c\u907f\u5f00\u4e86SQL\uff0c\u5bfc\u81f4\u4e86NoSQL\u8fd0\u52a8\u7684\u5174\u8d77\u3002<\/p>\n \u5f00\u53d1\u8005\u793e\u533a\u7684\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u4eec\u9010\u6e10\u5730\u4e5f\u63a5\u53d7\u4e86NoSQL\uff0c\u76f8\u8f83\u4e8eSQL\u5f53\u65f6\u7684\u51fa\u73b0\uff0c\u88ab\u8d8a\u6765\u8d8a\u591a\u7684\u5de5\u7a0b\u5e08\u6240\u63a5\u53d7\u3002\u8fd9\u4e2a\u539f\u56e0\u975e\u5e38\u5bb9\u6613\u7406\u89e3\uff1aNoSQL\u662f\u73b0\u5728\u6d41\u884c\u7684\uff1b\u5b83\u627f\u8bfa\u4e86\u89c4\u6a21\u548c\u6743\u529b\uff1b\u8fd9\u4f3c\u4e4e\u662f\u9879\u76ee\u901a\u5f80\u6210\u529f\u7684\u6377\u5f84\u3002\u4f46\u540e\u6765\u95ee\u9898\u51fa\u73b0\u4e86\u3002<\/p>\n \u5f00\u53d1\u4eba\u5458\u5f88\u5feb\u53d1\u73b0\uff0c\u4e0d\u7528SQL\u7684\u5c40\u9650\u6027\u3002\u6bcf\u4e2aNoSQL\u6570\u636e\u5e93\u90fd\u63d0\u4f9b\u4e86\u81ea\u5df1\u72ec\u7279\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u8fd9\u610f\u5473\u7740\uff1a\u8981\u5b66\u4e60\u66f4\u591a\u7684\u8bed\u8a00\uff08\u5e76\u5411\u540c\u4e8b\u6559\u6388\uff09; \u5c06\u8fd9\u4e9b\u6570\u636e\u5e93\u8fde\u63a5\u5230\u5e94\u7528\u7a0b\u5e8f\u7684\u96be\u5ea6\u589e\u52a0\uff0c\u5bfc\u81f4\u5927\u91cf\u80f6\u6c34\u4ee3\u7801\u7684\u51fa\u73b0\uff08\u4ee3\u7801\u4e4b\u95f4\u6709\u5f88\u5f3a\u7684\u8026\u5408\u6027\uff09;\u7f3a\u4e4f\u7b2c\u4e09\u65b9\u751f\u6001\u7cfb\u7edf\uff0c\u8981\u6c42\u4f01\u4e1a\u5fc5\u987b\u5f00\u53d1\u81ea\u5df1\u7684\u64cd\u4f5c\u548c\u53ef\u89c6\u5316\u5de5\u5177\u3002<\/p>\n \u8fd9\u4e9bNoSQL\u8bed\u8a00\u662f\u65b0\u7684\uff0c\u4e5f\u6ca1\u6709\u5b8c\u5168\u5f00\u53d1\u3002\u4f8b\u5982\uff0c\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5df2\u7ecf\u8fd0\u884c\u5f88\u591a\u5e74\u4e86\uff0c\u4e3aSQL\u6dfb\u52a0\u5fc5\u8981\u7684\u529f\u80fd\uff08\u4f8b\u5982JOIN\uff09\u4e5f\u65e9\u90fd\u5df2\u7ecf\u5b8c\u6210\u4e86\uff0cNoSQL\u8bed\u8a00\u7684\u4e0d\u6210\u719f\u610f\u5473\u7740\u5728\u5e94\u7528\u7a0b\u5e8f\u7ea7\u522b\u5c31\u4f1a\u6709\u66f4\u591a\u7684\u590d\u6742\u6027\u3002\u7f3a\u4e4fJOIN\u4e5f\u5bfc\u81f4\u4e86\u975e\u89c4\u8303\u5316\uff0c\u5bfc\u81f4\u6570\u636e\u81a8\u80c0\u548c\u50f5\u5316\u3002<\/p>\n \u4e00\u4e9bNoSQL\u6570\u636e\u5e93\u6dfb\u52a0\u4e86\u81ea\u5df1\u7684\u201c\u7c7bSQL\u201d\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u5982Cassandra\u7684CQL\u3002\u4f46\u8fd9\u5f80\u5f80\u4f7f\u95ee\u9898\u66f4\u7cdf\u3002\u4f7f\u7528\u51e0\u4e4e\u76f8\u540c\u7684\u754c\u9762\uff0c\u5374\u8ba9\u5185\u5fc3\u66f4\u7ea0\u7ed3\uff1a\u5de5\u7a0b\u5e08\u4e0d\u77e5\u9053\u4ec0\u4e48\u662f\u652f\u6301\u7684\uff0c\u4ec0\u4e48\u4e0d\u662f\u3002<\/p>\n \u793e\u533a\u4e2d\u7684\u4e00\u4e9b\u4eba\u5728\u65e9\u671f\u5c31\u770b\u5230\u4e86NoSQL\u7684\u95ee\u9898\uff08\u4f8b\u5982\uff0cDeWitt\u548cStonebraker\u57282008\u5e74\u5c31\u770b\u5230\u4e86\uff09\u3002\u7ecf\u8fc7\u65f6\u95f4\u7684\u5b9e\u6218\u68c0\u9a8c\uff0c\u4ee5\u53ca\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u7684\u7ecf\u9a8c\u79ef\u7d2f\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u8f6f\u4ef6\u5f00\u53d1\u4eba\u5458\u4e5f\u770b\u5230\u4e86\u8fd9\u4e00\u70b9\u3002<\/p>\n \u7b2c3\u90e8\u5206\uff1a\u56de\u5f52SQL<\/strong><\/div>\n \u7ecf\u5386\u4e86\u9ece\u660e\u524d\u7684\u9ed1\u6697\uff0c\u8f6f\u4ef6\u793e\u533a\u770b\u5230\u4e86\u66d9\u5149\uff0c\u90a3\u5c31\u662f\u56de\u5f52SQL\u3002<\/p>\n \u9996\u5148\u662fHadoop\uff08\u4e4b\u540e\u7684Spark\uff09\u4e4b\u4e0a\u7684SQL\u63a5\u53e3\uff0c\u5f15\u5bfc\u4e1a\u754c\u5174\u8d77\u4e86NoSQL ,NoSQL\u201c\u4e0d\u4ec5\u4ec5\u662fSQL\u201d\u3002<\/p>\n \u7136\u540e\uff0cNewSQL\u7684\u5174\u8d77\uff1a\u65b0\u7684\u53ef\u6269\u5c55\u6027\u6570\u636e\u5e93\uff0c\u5b8c\u5168\u652f\u6301SQL\u3002\u6765\u81ea\u4e8e\u9ebb\u7701\u7406\u5de5\u5b66\u9662(MIT)\u548c\u5e03\u6717\u5927\u5b66(Brown)\u7814\u7a76\u4eba\u5458\u7684H-Store \uff082008\u5e74\u53d1\u5e03\uff09\u662f\u7b2c\u4e00\u4e2a\u53ef\u6269\u5c55OLTP\u6570\u636e\u5e93\u4e4b\u4e00\u3002Google\u5728\u53d1\u5e03\u7684\u7b2c\u4e00\u4efdSpanner\u8bba\u6587\uff082012\u5e74\u53d1\u5e03\uff09\uff08\u5176\u4f5c\u8005\u5305\u62ec\u6700\u521d\u7684MapReduce\u4f5c\u8005\uff09\u4e2d\u63ed\u793a\u8fd9\u662f\u57fa\u4e8e SQL \u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u53ef\u4ee5\u5c06\u4e00\u4efd\u6570\u636e\u590d\u5236\u5230\u5168\u7403\u8303\u56f4\u7684\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\uff0c\u5e76\u4fdd\u8bc1\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u4ece\u800c\u5f00\u521b\u4e86\u53ef\u5730\u7406\u590d\u5236\u7684SQL\u754c\u9762\u7684\u6570\u636e\u5e93\uff0c\u63a5\u7740\u662fCockroachDB\uff082014\uff09\u8fd9\u6837\u7684\u5148\u9a71\u8005\u3002<\/p>\n \u4e0e\u6b64\u540c\u65f6\uff0cPostgreSQL\u793e\u533a\u5f00\u59cb\u590d\u82cf\uff0c\u589e\u52a0\u4e86JSON\u6570\u636e\u7c7b\u578b\uff082012\uff09\uff0c\u4ee5\u53caPostgreSQL 10 \u7684\u65b0\u7279\u6027\uff1a\u5bf9\u5206\u533a\u548c\u590d\u5236\u66f4\u597d\u7684\u672c\u5730\u652f\u6301\uff0cJSON\u7684\u5168\u6587\u641c\u7d22\u652f\u6301\u7b49\uff08\u4eca\u5e74\u665a\u4e9b\u65f6\u5019\u53d1\u5e03\uff09\u3002\u5176\u4ed6\u50cfCitusDB\uff082016\uff09\u548c\u5176\u4ed6\u7684\u516c\u53f8(\u4eca\u5e74\u53d1\u5e03\u7684TimescaleDB)\u53d1\u73b0\u4e86\u65b0\u7684\u65b9\u6cd5\u4ece\u800c\u9488\u5bf9\u7279\u5b9a\u6570\u636e\u5de5\u4f5c\u8d1f\u8f7d\u7684\u6269\u5c55PostgreSQL\u3002<\/p>\n \u4e8b\u5b9e\u4e0a\uff0c\u6211\u4eec\u5f00\u53d1TimescaleDB\u7684\u8fc7\u7a0b\u4e0e\u4e1a\u754c\u7684\u53d1\u5c55\u8f68\u8ff9\u5bc6\u5207\u76f8\u5173\u3002\u65e9\u671f\u7684TimescaleDB\u5185\u90e8\u7248\u672c\u4f7f\u7528\u4e86\u6211\u4eec\u81ea\u5df1\u7684\u7c7bsql\u67e5\u8be2\u8bed\u8a00\u201cioQL\u201d\u3002\u662f\u7684\uff0c\u6211\u4eec\u6b63\u662f\u88ab\u56f0\u96be\u9a71\u52a8\u7740\uff1a\u6784\u5efa\u6211\u4eec\u81ea\u5df1\u7684\u67e5\u8be2\u8bed\u8a00\u624d\u80fd\u66f4\u5f3a\u5927\u3002\u4f46\u662f\uff0c\u867d\u7136\u770b\u4f3c\u7b80\u5355\uff0c\u4f46\u6211\u4eec\u5f88\u5feb\u610f\u8bc6\u5230\uff0c\u6211\u4eec\u5fc5\u987b\u505a\u66f4\u591a\u7684\u5de5\u4f5c\uff1a\u4f8b\u5982\uff0c\u51b3\u5b9a\u8bed\u6cd5\uff0c\u6784\u5efa\u5404\u79cd\u8fde\u63a5\u5668\uff0c\u57f9\u8bad\u7528\u6237\u7b49\u3002\u6211\u4eec\u8fd8\u53d1\u73b0\u81ea\u5df1\u9700\u8981\u4e0d\u65ad\u5730\u53bb\u67e5\u627e\u5408\u9002\u7684\u8bed\u6cd5\uff0c\u53bb\u67e5\u8be2\u90a3\u4e9b\u5df2\u7ecf\u53ef\u4ee5\u7528SQL\u8fdb\u884c\u67e5\u8be2\u7684\u5185\u5bb9\u3002<\/p>\n \u6709\u4e00\u5929\uff0c\u6211\u4eec\u610f\u8bc6\u5230\u5efa\u7acb\u81ea\u5df1\u7684\u67e5\u8be2\u8bed\u8a00\u662f\u6ca1\u6709\u610f\u4e49\u7684\u3002\u5173\u952e\u8fd8\u662f\u8981\u62e5\u62b1SQL\u3002\u8fd9\u662f\u6211\u4eec\u505a\u51fa\u7684\u6700\u597d\u7684\u51b3\u7b56\u4e4b\u4e00\u3002\u540c\u65f6\u4e5f\u5f00\u542f\u4e86\u4e00\u4e2a\u5168\u65b0\u7684\u4e16\u754c\u3002\u4eca\u5929\uff0c\u5373\u4f7f\u6211\u4eec\u7684\u6570\u636e\u5e93\u624d\u95ee\u4e165\u4e2a\u6708\uff0c\u4f46\u6211\u4eec\u7684\u7528\u6237\u5b8c\u5168\u53ef\u4ee5\u4f7f\u7528\u6211\u4eec\u7684\u4ea7\u54c1\uff0c\u5e76\u83b7\u5f97\u5404\u79cd\u5404\u6837\u652f\u6301\uff1a\u53ef\u89c6\u5316\u5de5\u5177\uff08Tableau\uff09\uff0c\u901a\u7528ORM\u8fde\u63a5\u5668\uff0c\u5404\u79cd\u5de5\u5177\u548c\u5907\u4efd\u9009\u9879\uff0c\u5927\u91cf\u7684\u5728\u7ebf\u6559\u7a0b\u548c\u8bed\u6cd5\u8bf4\u660e\u7b49\u3002<\/p>\n \u4f46\u662f\u4e0d\u8981\u628a\u6211\u4eec\u7684\u8bdd\u653e\u5728\u5fc3\u4e0a\uff0c\u770b\u770b\u8c37\u6b4c<\/strong> \u770b\u770b\u8c37\u6b4c\u7684\u7b2c\u4e8c\u5927Spanner\u8bba\u6587\uff0c\u4ec5\u5728\u56db\u4e2a\u6708\u524d\u53d1\u5e03\uff08Spanner\uff1a\u6210\u4e3a\u4e00\u4e2aSQL\u7cfb\u7edf\uff0c2017\u5e745\u6708\uff09\uff0c\u4f60\u4f1a\u53d1\u73b0\u5b83\u652f\u6301\u6211\u4eec\u7684\u53d1\u73b0\u6210\u679c\u3002<\/p>\n \u4f8b\u5982\uff0cGoogle\u5f00\u59cb\u5728Bigtable\u4e4b\u4e0a\u5f00\u53d1\uff0c\u4f46\u662f\u540e\u6765\u53d1\u73b0\u7f3a\u5c11SQL\u4ea7\u751f\u4e86\u4e00\u7cfb\u5217\u95ee\u9898\uff08\u5728\u4e0b\u9762\u7684\u6240\u6709\u5f15\u53f7\u4e2d\u6709\u5f3a\u8c03\uff09\uff1a<\/p>\n \u201c\u867d\u7136\u8fd9\u4e9b\u7cfb\u7edf\u63d0\u4f9b\u4e86\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u4e00\u4e9b\u4f18\u52bf\uff0c\u4f46\u5b83\u4eec\u7f3a\u4e4f\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u4eba\u5458\u5e38\u5e38\u4f9d\u8d56\u7684\u8bb8\u591a\u4f20\u7edf\u6570\u636e\u5e93\u529f\u80fd\u3002\u4e00\u4e2a\u5173\u952e\u7684\u4f8b\u5b50\u662f\u5f3a\u5927\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u8fd9\u610f\u5473\u7740\u5f00\u53d1\u4eba\u5458\u5fc5\u987b\u7f16\u5199\u590d\u6742\u7684\u4ee3\u7801\u6765\u5904\u7406\u548c\u805a\u5408\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u6570\u636e\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u51b3\u5b9a\u5c06Spanner\u53d8\u6210\u4e00\u4e2a\u529f\u80fd\u9f50\u5168\u7684SQL\u7cfb\u7edf\uff0c\u5176\u67e5\u8be2\u6267\u884c\u4e0eSpanner\u7684\u5176\u4ed6\u67b6\u6784\u529f\u80fd\uff08\u5982\u5f3a\u4e00\u81f4\u6027\u548c\u5168\u5c40\u590d\u5236\uff09\u7d27\u5bc6\u96c6\u6210\u3002<\/p>\n \u5728\u672c\u6587\u7684\u540e\u9762\uff0c\u4ed6\u4eec\u8fdb\u4e00\u6b65\u4e86\u89e3\u4eceNoSQL\u8f6c\u6362\u5230SQL\u7684\u7406\u7531\uff1aSpanner\u7684\u539f\u59cbAPI\u63d0\u4f9b\u4e86\u4e3a\u5355\u4e2a\u548c\u4ea4\u53c9\u8868\u7684\u70b9\u67e5\u627e\u548c\u8303\u56f4\u626b\u63cf\u7684NoSQL\u65b9\u6cd5\u3002\u867d\u7136NoSQL\u65b9\u6cd5\u63d0\u4f9b\u4e86\u542f\u52a8Spanner\u7684\u7b80\u5355\u8def\u5f84\uff0c\u5e76\u4e14\u5728\u7b80\u5355\u7684\u68c0\u7d22\u65b9\u6848\u4e2d\u7ee7\u7eed\u6709\u7528\uff0c \u4f46SQL\u5728\u8868\u8fbe\u66f4\u590d\u6742\u7684\u6570\u636e\u8bbf\u95ee\u6a21\u5f0f\u5e76\u5c06\u8ba1\u7b97\u63a8\u9001\u5230\u6570\u636e\u65b9\u9762\u63d0\u4f9b\u4e86\u91cd\u8981\u7684\u9644\u52a0\u4ef7\u503c\u3002<\/p>\n \u672c\u6587\u8fd8\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Spanner\u4e0a\u4f7f\u7528SQL\u5e76\u4e0d\u4f1a\u505c\u6b62\uff0c\u54ea\u6015\u67d0\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u505c\u6b62\u8fd0\u8f6c,\u4ecd\u7136\u53ef\u7528\u3002\u4f46\u5b9e\u9645\u4e0a\u6269\u5c55\u5230Google\u7684\u5176\u4f59\u90e8\u5206\uff0c\u5176\u4e2d\u591a\u4e2a\u7cfb\u7edf\u5171\u4eab\u4e00\u4e2a\u901a\u7528\u7684SQL\u8bed\u8a00\uff1a<\/p>\n Spanner\u7684SQL\u5f15\u64ce\u4e0eGoogle\u7684\u5176\u4ed6\u51e0\u4e2a\u7cfb\u7edf\u5171\u4eab\u4e00\u4e2a\u79f0\u4e3a\u201c\u6807\u51c6SQL\u201d\u7684\u5e38\u89c1SQL\u8bed\u8a00\uff0c\u5305\u62ec\u5185\u90e8\u7cfb\u7edf\uff0c\u5982F1\u548cDremel\uff08\u4ee5\u53ca\u5176\u4ed6\uff09\u4ee5\u53ca\u5916\u90e8\u7cfb\u7edf\uff0c\u5982BigQuery \u3002<\/p>\n \u5bf9\u4e8eGoogle\u7528\u6237\uff0c\u8fd9\u4f1a\u964d\u4f4e\u8de8\u7cfb\u7edf\u7684\u5de5\u4f5c\u969c\u788d\u3002\u5bf9Spanner\u6570\u636e\u5e93\u7f16\u5199SQL\u7684\u5f00\u53d1\u4eba\u5458\u6216\u6570\u636e\u5206\u6790\u5e08\u53ef\u4ee5\u5c06\u4ed6\u4eec\u5bf9\u8bed\u8a00\u7684\u7406\u89e3\u8f6c\u79fb\u5230Dremel\uff0c\u800c\u4e0d\u7528\u62c5\u5fc3\u8bed\u6cd5\uff0cNULL\u5904\u7406\u7b49\u65b9\u9762\u7684\u5fae\u5999\u5dee\u5f02\u3002<\/p>\n \u8fd9\u5c31\u662f\u8fd9\u79cd\u65b9\u6cd5\u7684\u6210\u529f\u5965\u79d8\u3002\u5f53\u201c\u6f5c\u5728\u4e91\u5ba2\u6237\u5bf9SQL\u6709\u6d53\u539a\u5174\u8da3\u201d\u65f6\uff0cSpanner\u5df2\u7ecf\u6210\u4e3aGoogle\u4e3b\u8981\u7cfb\u7edf\u7684\u6839\u57fa\uff08\u5305\u62ecAdWords\u548cGoogle Play\uff09 \u3002<\/p>\n \u8003\u8651\u5230Google\u6700\u5148\u542f\u52a8\u4e86NoSQL\u7684\u8fd0\u52a8\uff0c\u8fd9\u662f\u975e\u5e38\u663e\u8457\u7684\uff0c\u5b83\u4eca\u5929\u6b63\u5728\u56de\u5f52SQL\u3002\uff08\u5f15\u8d77\u4e00\u4e9b\u4eba\u53cd\u601d\uff1a\u201c Google 10\u5e74\u524d\u633a\u8fdb\u5927\u6570\u636e\u5e02\u573a\u5c31\u662f\u4e2a\u5927\u5ffd\u60a0\u5417\u201d\uff1f\uff09<\/p>\n \u8fd9\u5bf9\u6570\u636e\u7684\u672a\u6765\u610f\u5473\u7740\u4ec0\u4e48\uff1aSQL\u5c06\u53d8\u6210\u7a84\u8170<\/p>\n \u5728\u8ba1\u7b97\u673a\u7f51\u7edc\u4e2d\uff0c\u6709\u4e00\u4e2a\u53eb\u505a\u201c\u7a84\u8170\u201d\u7684\u6982\u5ff5\u3002<\/p>\n \u8fd9\u4e2a\u6982\u5ff5\u7684\u51fa\u73b0\u89e3\u51b3\u4e86\u4e00\u4e2a\u5173\u952e\u95ee\u9898\uff1a\u5728\u4efb\u4f55\u7ed9\u5b9a\u7684\u7f51\u7edc\u8bbe\u5907\u4e0a\uff0c\u60f3\u8c61\u4e00\u4e2a\u5806\u6808\uff0c\u5e95\u5c42\u786c\u4ef6\u5c42\u548c\u9876\u5c42\u8f6f\u4ef6\u5c42\u3002\u4e2d\u95f4\u53ef\u80fd\u4f1a\u5b58\u5728\u5404\u79cd\u7f51\u7edc\u786c\u4ef6;\u7c7b\u4f3c\u5730\uff0c\u4e5f\u5b58\u5728\u5404\u79cd\u8f6f\u4ef6\u548c\u5e94\u7528\u7a0b\u5e8f\u3002\u9700\u8981\u4e00\u79cd\u65b9\u6cd5\u6765\u786e\u4fdd\u65e0\u8bba\u786c\u4ef6\u5982\u4f55\uff0c\u8f6f\u4ef6\u4ecd\u7136\u53ef\u4ee5\u8fde\u63a5\u5230\u7f51\u7edc; \u65e0\u8bba\u8f6f\u4ef6\u5982\u4f55\uff0c\u7f51\u7edc\u786c\u4ef6\u90fd\u77e5\u9053\u5982\u4f55\u5904\u7406\u7f51\u7edc\u8bf7\u6c42\u3002<\/p>\n <\/p>\n \u5728\u7f51\u7edc\u4e2d\uff0c\u7a84\u8170\u7684\u89d2\u8272\u7531\u4e92\u8054\u7f51\u534f\u8bae(IP)\u626e\u6f14\uff0c\u5b83\u662f\u4e3a\u5c40\u57df\u7f51\u8bbe\u8ba1\u7684\u5e95\u5c42\u8054\u7f51\u534f\u8bae\u548c\u66f4\u9ad8\u7ea7\u522b\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u4f20\u8f93\u534f\u8bae\u7684\u516c\u5171\u63a5\u53e3\u3002(\u8fd9\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u91ca\u3002)\u800c\u4e14\uff08\u5728\u4e00\u4e2a\u5e7f\u6cdb\u7684\u8fc7\u5ea6\u7b80\u5316\uff09\u4e2d\uff0c\u8fd9\u4e2a\u516c\u5171\u63a5\u53e3\u6210\u4e3a\u4e86\u8ba1\u7b97\u673a\u7684\u901a\u7528\u8bed\u8a00\uff0c\u4f7f\u7f51\u7edc\u4e92\u8fde\uff0c\u8bbe\u5907\u8fdb\u884c\u901a\u4fe1\uff0c\u800c\u8fd9\u4e2a\u201c\u7f51\u7edc\u7f51\u7edc\u201d\u53ef\u4ee5\u53d1\u5c55\u6210\u4e3a\u4eca\u5929\u4e30\u5bcc\u591a\u6837\u7684\u4e92\u8054\u7f51\u3002<\/p>\n \u6211\u4eec\u8ba4\u4e3a\uff0c\u8fd9\u7b49\u540c\u4e8eSQL\u5df2\u6210\u4e3a\u6570\u636e\u5206\u6790\u7684\u201c\u7a84\u8170\u3002<\/p>\n \u6211\u4eec\u751f\u6d3b\u5728\u4e00\u4e2a\u6570\u636e\u6b63\u5728\u6210\u4e3a\u201c\u4e16\u754c\u4e0a\u6700\u5b9d\u8d35\u8d44\u6e90\u201d\u7684\u65f6\u4ee3\uff08\u201d <\/p>\n \u50cf\u7f51\u7edc\u4e00\u6837\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u590d\u6742\u7684\u5806\u6808\uff0c\u5e95\u5c42\u7684\u57fa\u7840\u8bbe\u65bd\u548c\u9876\u90e8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u901a\u5e38\uff0c\u6211\u4eec\u6700\u7ec8\u7f16\u5199\u4e86\u5927\u91cf\u7684\u80f6\u6c34\u4ee3\u7801\uff0c\u4f7f\u6b64\u5806\u6808\u5de5\u4f5c\u3002\u4f46\u662f\u80f6\u6c34\u4ee3\u7801\u53ef\u80fd\u5f88\u8106\u5f31\uff1a\u9700\u8981\u7ef4\u62a4\u548c\u8d34\u5408\u3002<\/p>\n \u6211\u4eec\u9700\u8981\u7684\u662f\u4e00\u4e2a\u516c\u5171\u63a5\u53e3\uff0c\u5141\u8bb8\u8fd9\u4e2a\u5806\u6808\u7684\u5404\u4e2a\u90e8\u5206\u76f8\u4e92\u901a\u4fe1\u3002\u8fd9\u4e2a\u884c\u4e1a\u5df2\u7ecf\u6807\u51c6\u5316\u4e86\u3002\u5b83\u80fd\u8ba9\u4e0d\u540c\u5c42\u7ea7\u4e4b\u95f4\u7684\u901a\u4fe1\u963b\u788d\u964d\u5230\u6700\u5c0f\u3002<\/p>\n \u8fd9\u5c31\u662fSQL\u7684\u529b\u91cf\u3002\u548cIP\u4e00\u6837\uff0cSQL\u4e5f\u662f\u4e00\u4e2a\u516c\u5171\u63a5\u53e3\u3002<\/p>\n \u4f46\u4e8b\u5b9e\u4e0a\uff0cSQL \u6bd4 IP \u590d\u6742\u7684\u591a\u3002\u56e0\u4e3a\u6570\u636e\u8fd8\u9700\u8981\u88ab\u4eba\u7c7b\u5206\u6790\u3002\u800c\u4e14SQL\u521b\u5efa\u8005\u6700\u521d\u7ed9\u5b83\u8bbe\u5b9a\u7684\u76ee\u6807\u5c31\u662f\u53ef\u8bfb\u6027\u8981\u9ad8\u3002<\/p>\n SQL\u5b8c\u7f8e\u5417\uff1f\u4e0d\uff0c\u4f46\u8fd9\u662f\u793e\u533a\u4e2d\u7684\u5927\u591a\u6570\u4eba\u90fd\u5df2\u7ecf\u4e86\u89e3\u4e86\u8fd9\u8bed\u8a00\u3002\u867d\u7136\u5df2\u7ecf\u6709\u5de5\u7a0b\u5e08\u5728\u5f00\u53d1\u66f4\u548c\u8c10\u7684\u8bed\u8a00\u754c\u9762\uff0c\u4f46\u8fd9\u4e9b\u7cfb\u7edf\u6700\u7ec8\u4f1a\u8fde\u63a5\u5230\u54ea\u91cc?\u8fd8\u662fSQL\u3002<\/p>\n \u6240\u4ee5\u5728\u5806\u6808\u7684\u9876\u90e8\u8fd8\u6709\u4e00\u5c42\u3002\u90a3\u4e00\u5c42\u5c31\u662f\u6211\u4eec\u3002<\/p>\n SQL\u5df2\u7ecf\u56de\u6765\u4e86\u3002\u4e0d\u4ec5\u4ec5\u662f\u56e0\u4e3a\u4f7f\u7528NoSQL\u5de5\u5177\u7f16\u5199\u80f6\u6c34\u4ee3\u7801\u662f\u607c\u4eba\u7684\u3002\u4e0d\u4ec5\u4ec5\u662f\u56e0\u4e3a\u57f9\u8bad\u5927\u5bb6\u5b66\u4e60\u65e0\u6570\u65b0\u7684\u8bed\u8a00\u6210\u672c\u662f\u5de8\u5927\u7684\uff0c\u4e0d\u53ea\u662f\u56e0\u4e3a\u7edf\u4e00\u6807\u51c6\u7684\u91cd\u8981\u6027\u3002<\/p>\n \u800c\u4e14\u4e5f\u56e0\u4e3a\u4e16\u754c\u5145\u6ee1\u4e86\u6570\u636e\u3002\u5b83\u56f4\u7ed5\u7740\u6211\u4eec\uff0c\u675f\u7f1a\u7740\u6211\u4eec\u3002\u9996\u5148\uff0c\u6211\u4eec\u4f9d\u9760\u6211\u4eec\u7684\u4eba\u7c7b\u611f\u5b98\u548c\u611f\u89c9\u795e\u7ecf\u7cfb\u7edf\u6765\u5904\u7406\u5b83\u3002\u73b0\u5728\u6211\u4eec\u7684\u8f6f\u4ef6\u548c\u786c\u4ef6\u7cfb\u7edf\u4e5f\u8d8a\u6765\u8d8a\u667a\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u3002\u968f\u7740\u6211\u4eec\u6536\u96c6\u7684\u6570\u636e\u8d8a\u6765\u8d8a\u591a\uff0c\u53ef\u4ee5\u66f4\u597d\u7684\u8ba9\u6211\u4eec\u4e86\u89e3\u8fd9\u4e2a\u4e16\u754c\uff0c\u7cfb\u7edf\u7684\u590d\u6742\u6027\uff0c\u5b58\u50a8\uff0c\u5904\u7406\uff0c\u5206\u6790\u548c\u53ef\u89c6\u5316\u7684\u9700\u6c42\u53ea\u4f1a\u7ee7\u7eed\u589e\u957f\u3002<\/p>\n \u6211\u4eec\u751f\u6d3b\u5728\u4e00\u4e2a\u8106\u5f31\u7684\u4e16\u754c\u548c\u4e00\u767e\u4e07\u4e2a\u4e0d\u540c\u754c\u9762\u7684\u4e16\u754c\u3002\u6216\u8bb8\u6211\u4eec\u53ef\u4ee5\u7ee7\u7eed\u62e5\u62b1SQL\u3002\u4e00\u5207\u90fd\u9075\u5faa\u80fd\u91cf\u5b88\u6052\u5b9a\u5f8b\u3002<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.infoq.com\/cn\/news\/2017\/10\/SQL-NoSQL-mean-what?utm_source=infoq&utm_medium=popular_widget&utm_campaign=popular_content_list&utm_content=homepage<\/a><\/p>\n |