Google Cloud Endpoints 相当于 API 网关,还是 Endpoints 相当于微服务?

Posted

技术标签:

【中文标题】Google Cloud Endpoints 相当于 API 网关,还是 Endpoints 相当于微服务?【英文标题】:Is Google Cloud Endpoints equivalent to an API Gateway, or are Endpoints equivalent to a microservice? 【发布时间】:2018-03-10 15:03:57 【问题描述】:

使用 App Engine 灵活环境,我正准备部署一个 Angular 4 客户端,并正在研究 Cloud Endpoints 来处理我的 node.js/express 微服务,因为它似乎可以简化端点请求的保护和身份验证,我想澄清几点:

    我是使用云端点作为 API 网关,将请求路由到单个微服务后端,还是应该将微服务构建为单个端点应用程序本身?

    我是静态托管 Angular 4 应用程序(与服务器无关),并从 ng 客户端直接向网关/微服务发出端点请求,还是通过服务器框架托管应用程序(例如 node.js/express ) 然后将请求传递给网关/微服务

【问题讨论】:

【参考方案1】:

    结合dispatch.yaml 指令来处理路由,您可以将 GCE 用作在给定项目中作为服务运行的多个微服务的网关。

    可以直接调用服务,也可以通过服务器代理。

【讨论】:

【参考方案2】:

Endpoints 是一个 API 网关,但它目前仅路由到单个后端。在 Flex 上,它是您部署的任何应用程序。 Endpoints 代理位于您的后端前面,对客户端透明,客户端请求将通过网关。请参阅the docs,了解如何设置您的柔性环境。

【讨论】:

那么,要拥有一个带端点的微服务架构,我需要创建多个端点应用程序,每个应用程序都充当自己的网关来提供自己的后端服务?

以上是关于Google Cloud Endpoints 相当于 API 网关,还是 Endpoints 相当于微服务?的主要内容,如果未能解决你的问题,请参考以下文章

没有 Google 帐户的 Google Cloud Endpoints

使用 Google Cloud Endpoints 时如何重启 Flask 服务器?

Google Cloud Endpoints:身份验证问题(错误 403)

如何在 Google Cloud Endpoints 中允许 CORS?

GWT 和 Google Cloud Endpoints

使用 Google Endpoints 在 Google Cloud Storage 上上传图片