Ocelot 和 YARP 有什么区别?

问题描述 投票:0回答:1

我知道 Ocelot 是 Api 网关,YARP i 是反向代理。微服务架构使用每个功能来处理请求重定向、缓存、身份验证等。

假设我们有 3 个小鼠服务(A、B、C),通过使用 YARP,我们可以使用不同的算法将客户的请求重定向到这些服务,例如Round RobinLeast ConnectionsIP Hash 等。这部分也和负载均衡逻辑有点类似。

我想知道何时为什么我可以使用其中哪一个?

我读过很多关于它们的文章,但它们似乎有点接近,比如逻辑、配置方式、优点等等。

c# microservices reverse-proxy ocelot yarp
1个回答
0
投票

Ocelot:

Ocelot
中可以通过特殊的方式将
authentication
authorization
应用于多个微服务。

YARP:

yarp
中,您可以实现
custom routing algorithms
,如
Round Robin
Least Connections
IP Hash
load balancing

使用

ocelot
YARP
取决于您需要的功能。如果
authentication
对您很重要,ocelot是更好的选择。如果您想同时拥有
complex routing
use different algorithms
YARP 是更好的选择。

© www.soinside.com 2019 - 2024. All rights reserved.