{"id":4992,"date":"2020-05-05T15:12:16","date_gmt":"2020-05-05T07:12:16","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=4992"},"modified":"2020-05-05T15:12:16","modified_gmt":"2020-05-05T07:12:16","slug":"api%e7%bd%91%e5%85%b3%ef%bc%9akong%e3%80%81gravitee%e3%80%81tyk%e3%80%81haproxy%e5%a4%a7pk","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4992","title":{"rendered":"API\u7f51\u5173\uff1aKong\u3001Gravitee\u3001Tyk\u3001HAProxy\u5927PK"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u968f\u7740\u5fae\u670d\u52a1\u7684\u5174\u8d77\uff0c\u7f51\u5173\u5df2\u6210\u4e3a\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u90e8\u5206\u3002\u4f17\u591a\u7684 Api \u7f51\u5173\u7684\u4ea7\u751f\uff0c\u4f7f\u4e0d\u5c11\u4eba\u9762\u4e34\u7740 2 \u4e2a\u6bd4\u8f83\u5c16\u9510\u7684\u95ee\u9898\u3002\u4e00\u4e2a\u662f\u589e\u52a0\u4e86\u9762\u8bd5\u7684\u96be\u5ea6\uff0c\u53e6\u5916\u4e00\u4e2a\u662f\u9009\u62e9\u4e00\u4e2a\u6700\u9002\u5408\u81ea\u5df1\u7684\u7f51\u5173\u5e76\u975e\u6613\u4e8b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u57fa\u4e8e\u6b64\uff0c\u6211\u7b80\u5355\u7684\u6bd4\u8f83\u4e86 4 \u79cd API \u7f51\u5173\uff1aKong\uff0cGravitee\uff0cTyk\u548cHAProxy\u3002\u5e0c\u671b\u80fd\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kong<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Kong \u662f\u81ea 2017 \u5e74\u4ee5\u6765\u7531 Kong Inc \u7528 Lua \u548c Perl \u7f16\u7801\u7684\u5f00\u6e90 API \u7f51\u5173\u3002\u5f00\u6e90\u89e3\u51b3\u65b9\u6848\u662f Kong API Gateway\uff0c\u800c\u4f01\u4e1a\u7248 Kong Enterprise \u5728\u7f51\u5173\u5468\u56f4\u6536\u96c6\u4e86\u66f4\u591a\u5de5\u5177\uff0c\u4f8b\u5982\u4eea\u8868\u677f\u6216\u76d1\u89c6\u5de5\u5177\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/API-Gateway-kong-architecture.png\" alt=\"\" \/><figcaption>API \u7f51\u5173 Kong<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Kong \u53ea\u9700\u8981\u4e00\u4e2a PostgreSQL \u6765\u4fdd\u5b58\u5176\u914d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u5b89\u88c5\u5728\u8bb8\u591a\u73af\u5883\u548c OS \u4e2d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u67b6\u6784\u84dd\u56fe\u53ef\u4ee5\u770b\u51fa\uff0cKong \u5305\u542b\u4e86\u4e00\u4e2a\u63d2\u4ef6\u90e8\u5206\u3002Kong Inc \u53ca\u5176\u793e\u533a\u76ee\u524d\u62e5\u6709\u975e\u5e38\u591a\u7684\u63d2\u4ef6\uff0c\u5305\u62ec\uff1a\u8eab\u4efd\u9a8c\u8bc1\uff0c\u65e5\u5fd7\uff0c\u76d1\u63a7\uff0c\u901f\u7387\u9650\u5236\u7b49\u3002Kong \u7684\u793e\u533a\u6d3b\u8dc3\u4e14\u53d1\u5c55\u8fc5\u901f\u3002\u6b64\u5916\uff0cKong \u6613\u4e8e\u7406\u89e3\u548c\u90e8\u7f72\uff1a\u5927\u591a\u521d\u5b66\u8005\u53ea\u9700\u8981 1 \u5c0f\u65f6\uff0c\u4fbf\u53ef\u638c\u63e1\uff0c\u800c\u81ea\u5b9a\u4e49\u5b89\u88c5\u811a\u672c\u53ea\u9700\u51e0\u5206\u949f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kong \u8fd8\u975e\u5e38\u7684\u8f7b\u91cf\u7ea7\uff0c\u5927\u6982\u53ea\u9700\u8981\u4e0d\u5230 300MB \u7684\u5185\u5b58\u5c31\u53ef\u4ee5\u8fd0\u884c\u3002\u5b83\u9700\u8981CPU\uff0c\u589e\u52a0 CPU \u6570\u91cf\u5c06\u63d0\u9ad8\u5176\u6027\u80fd\u3002Kong \u53ef\u4ee5\u6c34\u5e73\u6269\u5c55\uff1aAPI \u7f51\u5173\u662f\u65e0\u72b6\u6001\u7684\uff0c\u6570\u636e\u5e93\u662f\u552f\u4e00\u7684\u3002\u8fd9\u610f\u5473\u7740\u6211\u4eec\u8fdb\u884c\u66f4\u6539\u65f6\uff0c\u6c34\u5e73\u7f29\u653e\u5c06\u4f1a\u53d8\u5f97\u975e\u5e38\u7684\u7b80\u5355\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gravitee<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Gravitee \u662f Gravitee Source \u81ea 2015 \u5e74 1 \u6708\u4ee5\u6765\u4f7f\u7528 Java \u5f00\u53d1\u7684\u5f00\u6e90 API \u7f51\u5173\u3002\u8be5\u7cfb\u7edf\u6bd4 Kong \u66f4\u590d\u6742\uff1a\u5b83\u4f9d\u8d56\u4e8e 3 \u4e2a\u5e94\u7528\u7a0b\u5e8f\u3002\u524d\u4e24\u4e2a\u662f Management \u5757\u7684\u4e00\u90e8\u5206\uff1a\u95e8\u6237\u662f Angular Front\uff0c\u5b83\u4e0e Management API \u4ea4\u4e92\u4ee5\u7ba1\u7406\u7f51\u5173\u7684\u6240\u6709\u914d\u7f6e\u3002\u5b83\u7684\u914d\u7f6e\u4fdd\u5b58\u5728 MongoDB\u4e2d\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/API-Gateway-haproxy-architecture.png\" alt=\"\" \/><figcaption>Gravitee<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Gravitee \u7684\u4f18\u70b9\u4e4b\u4e00\u662f\u4eea\u8868\u677f\uff1a\u5b83\u6e05\u6670\uff0c\u6613\u4e8e\u5f00\u53d1\u4eba\u5458\u7406\u89e3\uff0c\u5e76\u4e14\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 Gravitee \u8fdb\u884c\u7684\u6240\u6709\u64cd\u4f5c\uff08\u8def\u7531\uff0c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u8b66\u62a5\u7b49\uff09\u3002Gravitee \u63d0\u4f9b\u7684\u529f\u80fd\u5c11\u4e8e Kong\uff0c\u4f46\u5982\u679c\u60a8\u6ca1\u6709\u7279\u6b8a\u9700\u6c42\uff0c\u5b83\u5c06\u4ee4\u4eba\u6ee1\u610f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e Gravitee\uff0c\u75db\u82e6\u7684\u662f\u5b89\u88c5\u548c\u6587\u6863\u3002\u56e0\u4e3a\u6211\u4eec\u5b89\u88c5\u5b83\u65f6\uff0c\u81f3\u5c11\u8981\u5b89\u88c5 3 \u4e2a\u7ec4\u4ef6\u548c\u4e00\u4e2a MongoDB\uff0c\u5e76\u4e14\u53ef\u80fd\u9700\u8981 ElasticSearch\u3002\u76f8\u5173\u7684\u5b66\u4e60\u6587\u6863\u4e5f\u6bd4\u8f83\u5c11\uff0c\u5e76\u4e14\u793e\u533a\u4e0d\u5927\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gravitee \u5bf9\u5185\u5b58\u8981\u6c42\u8f83\u9ad8\uff0c\u5b66\u4e60\u6210\u672c\u4e5f\u6bd4 Kong \u9ad8\uff0c\u56e0\u6b64\u6211\u4e00\u822c\u4e0d\u5efa\u8bae\u5927\u5bb6\u4f7f\u7528\u5b83\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tyk<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tyk.io \u662f\u81ea 2014 \u5e74\u4ee5\u6765\u7531 Tyk Technologie \u7528 Go \u7f16\u5199\u7684\u5f00\u6e90 API \u7f51\u5173\u3002Tyk \u4e5f\u6bd4\u8f83\u9ebb\u70e6\uff0c\u5b83\u9700\u8981 Redis \u548c MongoDB\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/API-Gateway-tyk-architecture.png\" alt=\"\" \/><figcaption>API \u7f51\u5173 Tyk<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Tyk \u7684\u4f18\u70b9\u662f\u4eea\u8868\u76d8\uff0c\u6587\u6863\u4e5f\u6bd4\u8f83\u4e30\u5bcc\u3002Tyk \u4e0d\u9700\u8981\u592a\u591a\u7684\u5185\u5b58\uff0c\u4f46\u662f\u4f1a\u5360\u7528\u5927\u91cfCPU\u3002Tyk \u7684\u6027\u80fd\u4e5f\u4e0d\u5360\u636e\u4f18\u52bf\uff0c\u793e\u533a\u6d3b\u8dc3\u5ea6\u4e5f\u4e0d\u5982 Kong\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HAProxy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">HAProxy \u662f\u7528 Lua \u548c C \u5f00\u53d1\u7684\u5f00\u6e90\u89e3\u51b3\u65b9\u6848\u3002HAProxy \u4e0e\u5176\u4ed6\u89e3\u51b3\u65b9\u6848\u6709\u5f88\u5927\u4e0d\u540c\uff0c\u56e0\u4e3a\u5b83\u7684\u9996\u6b21\u4f7f\u7528\u662f\u4f5c\u4e3a\u8d1f\u8f7d\u5747\u8861\u5668\u800c\u4e0d\u662f API Gateway\u3002\u5b83\u7684\u4f53\u7cfb\u7ed3\u6784\u5f88\u7b80\u5355\uff1a\u53ea\u6709\u4e00\u4e2a\u542f\u52a8\u8fc7\u7a0b\uff0c\u542f\u52a8\u65f6\u4f1a\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/API-Gateway-gravitee-architecture.png\" alt=\"\" \/><figcaption>HAProxy<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e HAProxy \u5e76\u4e0d\u662f API \u7f51\u5173\u7684\u4e3b\u8981\u7528\u9014\uff0c\u56e0\u6b64\u5b83\u7f3a\u5c11\u4e86\u7528\u4e8e\u7ba1\u7406API\u7f51\u5173\u529f\u80fd\u7684\u5b8c\u6574\u63a5\u53e3\u3002\u4f46\u662f\uff0cHAProxy \u4f18\u52bf\u662f\u6027\u80fd\u3002\u5b83\u53ef\u4ee5\u4f7f\u7528\u66f4\u5c11\u7684\u8d44\u6e90\uff08CPU \u548c\u5185\u5b58\uff09\u5c31\u53ef\u4ee5\u83b7\u5f97\u6bd4\u8f83\u597d\u7684\u6027\u80fd\u3002\u53e6\u5916\u4e00\u4e2a\u4f18\u52bf\u662f\uff0c\u5982\u679c\u4f60\u7528\u5b83\u505a\u4e86\u8d1f\u8f7d\u5747\u8861\uff0c\u90a3\u4e48\u628a\u5b83\u6269\u5c55\u6210\u7f51\u5173\u5c31\u663e\u5f97\u975e\u5e38\u7684\u7b80\u5355\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9e\u9645\u4e0a\uff0cAPI \u7f51\u5173\u8fd8\u6709\u5f88\u591a\uff0c\u6211\u5c31\u4e0d\u5728\u5217\u4e3e\u4e86\uff0c\u770b\u4e0b\u9762\u7684\u56fe\uff0c\u57fa\u672c\u4e0a\u5217\u4e3e\u7684\u6bd4\u8f83\u5168\u4e86\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/niABZ3R.jpg\" alt=\"\" \/><figcaption>\u7f51\u5173 API \u6bd4\u62fc<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/gitee.com\/xmtblog\/img\/raw\/master\/rMr6naM.jpg\" alt=\"\" \/><figcaption>\u7f51\u5173 API \u5168\u65b9\u4f4d\u6bd4\u8f83<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\uff0c\u53ea\u4f5c\u4e3a\u5927\u5bb6\u6280\u672f\u9009\u578b\u7684\u53c2\u8003\uff0c\u4e0d\u6784\u6210\u4f7f\u7528\u5efa\u8bae\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4992\">API\u7f51\u5173\uff1aKong\u3001Gravitee\u3001Tyk\u3001HAProxy\u5927PK<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u5fae\u670d\u52a1\u7684\u5174\u8d77\uff0c\u7f51\u5173\u5df2\u6210\u4e3a\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u90e8\u5206\u3002\u4f17\u591a\u7684 Api \u7f51\u5173\u7684\u4ea7\u751f\uff0c\u4f7f\u4e0d\u5c11\u4eba\u9762\u4e34\u7740 2 \u4e2a\u6bd4\u8f83\u5c16\u9510\u7684\u95ee\u9898 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[606,605,806,1033,1005],"class_list":["post-4992","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-apiimplicitparam","tag-apioperation","tag-rest-api","tag-webmagic-api","tag-api"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4992"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4992\/revisions"}],"predecessor-version":[{"id":4993,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4992\/revisions\/4993"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}