-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
binghe001
committed
Jul 14, 2024
1 parent
9a9d9f9
commit 2edd6e6
Showing
6 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: 第04节:高性能Polaris网关技术流程梳理 | ||
pay: https://articles.zsxq.com/id_ftp3p72whut2.html | ||
--- | ||
|
||
# 《高性能Polaris网关》需求设计-第04节:高性能Polaris网关技术流程梳理 | ||
|
||
作者:冰河 | ||
<br/>星球:[http://m6z.cn/6aeFbs](http://m6z.cn/6aeFbs) | ||
<br/>博客:[https://binghe.gitcode.host](https://binghe.gitcode.host) | ||
<br/>文章汇总:[https://binghe.gitcode.host/md/all/all.html](https://binghe.gitcode.host/md/all/all.html) | ||
<br/>源码获取地址:[https://t.zsxq.com/0dhvFs5oR](https://t.zsxq.com/0dhvFs5oR) | ||
|
||
> 沉淀,成长,突破,帮助他人,成就自我。 | ||
|
||
* 本章难度:★★☆☆☆ | ||
* 本章重点:从技术角度梳理高性能Polaris网关的流程,网关接收请求、限流、熔断、流控、鉴权、协议转换、转发请求等功能的技术梳理,对有无网关请求的流程进行简单的对比,使研发人员能够从技术角度理解高性能Polaris网关的整个技术流程与技术交互过程。 | ||
|
||
**大家好,我是冰河~~** | ||
|
||
在前面的文章中,我们对建设高性能Polaris网关过程中要实现的目标与存在的挑战有了大致的了解。并且大致梳理了分布式IM即时通讯系统的功能需求和业务流程,相信小伙伴们心中大概明确了要开发哪些功能。除此之外,作为技术人员,我们还要从技术的角度梳理下高性能Polaris网关的整体交互流程。 | ||
|
||
## 一、前言 | ||
|
||
运营或产品经理从实际场景和业务角度提出对应的业务需求后,作为架构师或者研发人员,不仅需要理解业务场景和业务需求,还需要将这些场景和业务需求转化成技术实现方案。从技术的角度出发,来梳理需要实现的逻辑与交互流程。如果你是一名基础框架或中间件的架构师或者研发人员,除了要深刻的理解领域场景外,还需要具备将这些领域场景进行高度抽象的能力,并且要关注你所做的基础框架或中间件的各种性能指标。 | ||
|
||
## 二、本节诉求 | ||
|
||
在正式设计和编码实现高性能Polaris网关之前,除了要理解网关的需求和交互流程外,作为技术人员,还有一项非常重要的事情,那就是从技术角度好好梳理下高性能Polaris网关的请求链路,交互逻辑和技术流程,以便更好的设计和高性能Polaris网关。 | ||
|
||
本章,就从技术的角度出发,对有无网关请求的流程进行简单的对比,并且梳理下高性能Polaris网关的请求交互链路、交互逻辑和技术流程。 | ||
|
||
## 三、有无网关流程对比 | ||
|
||
通过前面章节的学习,我们已经了解到API网关是一种用于管理、控制和保护API(应用程序编程接口)的中间层服务。它位于客户端和后端服务之间,充当了一个统一的入口点,处理所有进出系统的请求,实现对外部请求的协议转换、参数校验、鉴权、切量、熔断、限流、监控、风控等各种共性的通用服务。 | ||
|
||
另外,各大厂做网关,其实做的就是一套统一方案。将分布式微服务下的RPC到HTTP通信的同类共性的需求,凝练成通用的组件服务,减少在业务需求场景开发下,非业务需求的同类技术诉求的开发成本。 | ||
|
||
### 3.1 未引入API网关 | ||
|
||
如果在项目开发过程中,不引入API网关的话,最基本的做法就是在各个服务之上再开发一个对应的Web服务,这些Web服务可以是SprongMVC工程,也可以是SpringBoot工程,最终会通过SpringMVC或者SpringBoot工程对外提供HTTP接口供客户端调用,如图4-1所示。 | ||
|
||
<div align="center"> | ||
<img src="https://binghe.gitcode.host/images/project/gateway/2024-07-14-001.png?raw=true" width="70%"> | ||
<br/> | ||
</div> | ||
|
||
可以看到,在未引入API网关之前,一般会在服务之上开发一套Web应用,由这个Web应用最终向客户端提供HTTP接口。并且会在这个Web应用内部实现限流、熔断、参数校验、鉴权、风控、切量、监控、路由转发等功能。 | ||
|
||
### 3.2 引入API网关 | ||
|
||
引入API网关后,流量的管理和转发就变得比较简单了,也不再需要对各个服务再开发一套Web应用进行维护。引入API网关的流程如图4-2所示。 | ||
|
||
## 查看完整文章 | ||
|
||
加入[冰河技术](https://public.zsxq.com/groups/48848484411888.html)知识星球,解锁完整技术文章、小册、视频与完整代码 |