负载平衡器在微服务体系结构中何处?

发布于 2025-01-28 07:04:45 字数 81 浏览 2 评论 0原文

我计划用微服务创建全新的后端。我一直在研究基础架构,但我不确定负载平衡器的进来。API网关会充当负载平衡器,还是他们坐在每个微服务后面。我很想知道。

I'm planning on creating a brand new backend with microservices. I've been looking into infrastructure and I'm unsure as to where load balancers come in. Does the API gateway act as a load balancer or do they sit behind each microservice. I'd love to know.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

饮湿 2025-02-04 07:04:45

您可以阅读一篇非常好的文章在这里 - 当您对应用程序有很多流量(即微服务)时,您可以做的一件事是将应用程序部署到多个服务器(甚至数百个服务器),以便在每个服务器中都可以访问。现在,您想在不同实例之间将请求传播到您的应用程序,以使一个或其他服务器上的负载不会太多。负载平衡器位于应用程序的客户端和应用程序的服务器库之间,并在不同实例之间巧妙地路由请求,以防止(或分发)负载。

You can read a really nice article about it here, but in simple words - when you have a lot of traffic to your application (i.e. your microservice), one thing you can do is to deploy your application to more than one server (even hundreds of servers), such that it's accessible in each of these servers. Now, you'd like to spread the requests to your application between the different instances such that there won't be too much load on one or other servers. Load Balancer sits between the clients of your application and the servers pool of your application, and routes the requests cleverly between the different instances, to prevent (or distribute) the load.

香草可樂 2025-02-04 07:04:45

@idanz有一个很好的简洁答案,但是如果您正在寻找有关API网关角色的更多信息,那么与负载平衡器相比,您可能会发现本文有用。它简要强调了API网关和负载平衡器之间的区别,并显示了一种不同的方法来改善潜伏期的过程间负载:

https://www.architect.io/blog/2022-03-21/production-environment-environment-environment-anvironment-anvironment-anvironment-at-different-siess/

披露:我是作者。

@idanz has a nice, concise answer, but if you're looking for more info on the role of an API gateway as compared to load balancers you might find this article useful. It briefly highlights the difference between an API gateway and a load balancer and shows a different approach to inter-process load balancing that improves latency:

https://www.architect.io/blog/2022-03-21/production-environment-at-different-sizes/

Disclosure: I'm the author.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文