没有合适的资源?快使用搜索试试~ 我知道了~
Microservice API Gateway Patterns
需积分: 10 10 下载量 137 浏览量
2018-12-28
10:22:21
上传
评论
收藏 945KB PDF 举报
温馨提示
API Gateway Patterns for microservice. describe the API gateway pattern. I discuss its bene ts and drawbacks. I also describe various design issues that you must address when developing an API gateway
资源推荐
资源详情
资源评论




















10/9/2018 The API Gateway Pattern | Manning
https://freecontent.manning.com/the-api-gateway-pattern/ 1/14
From Microservices Patterns by Chris Richardson
In this article, I describe the API gateway pattern. I
discuss its benets and drawbacks. I also describe
various design issues that you must address when
developing an API gateway.
Save 37% on
Microservice Patterns
. Just enter code fccrichardson into the discount
code box at checkout at manning.com.
As you may know, there are numerous drawbacks with services accessing services
directly. It’s often impractical for a client to perform API composition over the
Internet. The lack of encapsulation makes it difcult for developers to change
service decomposition and APIs. Services sometimes use communication protocols
that aren’t suitable outside of the rewall. Consequently, a much better approach is
to use what’s known as an API gateway.
Pattern: API gateway
The API Gateway Pattern

10/9/2018 The API Gateway Pattern | Manning
https://freecontent.manning.com/the-api-gateway-pattern/ 2/14
Implement a service which is the entry point into the microservices-based
application from external API clients. See:
http://microservices.io/patterns/apigateway.html.
An API gateway is a service which is the entry point into the application from the
outside world. It’s responsible for request routing, API composition, and other
functions, such as authentication. Let’s take a look at the API gateway pattern.
Overview of the API gateway pattern
The drawbacks of clients making multiple requests in order to display information
to the user are well known (I describe them in my book!). A much better approach is
for a client to make a single request to what’s known as an API gateway. An API
gateway is a service which is the single entry-point for API requests into an
application from outside the rewall. It’s similar to the Facade pattern from object-
oriented design. Like a facade, an API gateway encapsulates the application’s
internal architecture and provides an API to its clients. It might also have other
responsibilities, such authentication, monitoring, and rate limiting. Figure 1 shows
the relationship between the clients, the API gateway, and the services.

10/9/2018 The API Gateway Pattern | Manning
https://freecontent.manning.com/the-api-gateway-pattern/ 3/14
Figure 1. The API gateway is the single entry-point into the application for API calls
from outside the rewall
The API gateway is responsible for request routing, API composition, and protocol
translation. All API requests from external clients rst go to the API gateway. The
API gateway routes some requests to the appropriate service. The gateway handles
other requests using the API Composition pattern and invoking multiple services
and aggregating the results. It might also translate between client-friendly
protocols such as HTTP and WebSockets and client-unfriendly protocols which are
used by the services.
Request routing
One of the key functions of an API gateway is request routing. An API gateway
implements some API operations by routing requests to the corresponding service.
When it receives a request, the API gateway consults a routing map that species
which service to route the request to. A routing map might, for example, map an
HTTP method and path to the HTTP URL of a service. This function is identical to
the reverse proxying features provided by web servers such as NGINX.
API Composition
An API gateway typically does more than reverse proxying. It might also implement
some API operations using API composition. In my book, I use an example
application called FTGO to teach how to move from monolithic architecture to
microservices. The FTGO API gateway, for example, implements the Get Order
Details API operation using API composition. As gure 2 shows, the mobile
application makes one request to the API gateway, which fetches the order details
from multiple services.
剩余13页未读,继续阅读
资源评论


itd018
- 粉丝: 4
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- aspmaker7.0
- aspmaker7.0
- matlab 解码 NMEA0183格式GGA数据
- matlab 解码 NMEA0183格式GGA数据
- matlab 解码 NMEA0183格式GGA数据
- 基于 InternLM2 的王者荣耀角色扮演项目:融合多模态技术的峡谷小狐仙妲己聊天机器人
- 为学习目的从零开始编写大语言模型(LLM)相关全部代码
- Single novel 单本小说系统,基于python爬虫+flask(新版),旧版生成html静态文件.zip
- Selenium UI 自动化测试框架(基于 python 3+selenium).zip
- SimpleChinese2 集成了包括拼音汉字转换、近义词、繁简转换等在内的许多基本的中文自然语言处理功能,使基于 Python 的中文文字处理和信息提取变得简单方便。.zip
- superman是套基于Python unitest框架开发的一套实用于API测试和WEB UI测试自动化框架.zip
- Ubuntu安装pyhton3、pip3,并且部署python web项目(基于django).zip
- Stock Backtrader Web App 是一个基于 Python 的项目,旨在简化股票回测和分析
- WeChatAI 是一款基于 Python 开发的微信群聊_个人智能助手,支持多种大语言模型,可以实现智能对话、自动回复等功能。采用现代化的界面设计,操作简单直观。.zip
- Wagtail是一套基于Python Django的内容管理系统,为很多大型机构,比如NASA、Google、MIT、Mizilla等所使用,本项目旨在将其官方文档翻译整理为中文语言。.zip
- Web接口开发与自动化测试 基于Python语言.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
