TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: API gateway

2 点作者 Kpourdeilami超过 7 年前
Hello HN,<p>I was considering putting my API behind a gateway to:<p>1) block malicious IPs, CORS headers, etc.<p>2) monitor the load from different users (a metric used to calculate their bill)<p>3) route requests from certain IPs to different application servers<p>I thought maybe I should use an API gateway instead of implementing those things on the application level because it would just add unnecessary bloat.<p>AWS[0], GCP[1], and Azure[2] all have API gateway offerings. I&#x27;m currently leaning towards using Kong[3] because it is open-source and wouldn&#x27;t come with a vendor lock-in. I was wondering if anyone has experience with using any of those services or any other API gateways that would recommend?<p>0: https:&#x2F;&#x2F;aws.amazon.com&#x2F;api-gateway&#x2F;<p>1: https:&#x2F;&#x2F;cloud.google.com&#x2F;endpoints&#x2F;<p>2: https:&#x2F;&#x2F;azure.microsoft.com&#x2F;en-us&#x2F;services&#x2F;api-management&#x2F;<p>3: https:&#x2F;&#x2F;getkong.org<p>Thanks

1 comment

mtmail超过 7 年前
If you&#x27;re familiar nodejs then <a href="http:&#x2F;&#x2F;apiaxle.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;apiaxle.com&#x2F;</a> might be an option.<p>Redhat&#x27;s offering is <a href="https:&#x2F;&#x2F;www.3scale.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.3scale.net&#x2F;</a> which is expensive but comes with end-user registration and billing.<p>We (<a href="https:&#x2F;&#x2F;geocoder.opencagedata.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;geocoder.opencagedata.com&#x2F;</a>) went with kong and I know others in the 100s of million requests&#x2F;day who use it. Hardware requirements are tiny. You will have to take care of redundancy yourself though (Postgres multimaster or Cassandra data store). Kong doesn&#x27;t give you per-user metrics: in its datastore it keeps a count that resets every period (e.g. every day). So you will have to use one the logging plugins (can be text-file even) and query a separate system. We don&#x27;t like the error pages: The HTTP codes and content are fine, but you can&#x27;t for example return a XML data structure, so it lacks customization. That said with apiaxle and kong open source we could change it if we want. Support was great and the lua code is well written and documented.