微服务架构最佳实践

huangapple go评论88阅读模式
英文:

Microservices Architecture Best Practice

问题

如果每个服务都需要独立的端口,按照微服务架构,那么如何设计一个拥有数百个服务的系统呢?我的意思是,为了实现这个目标,在操作系统上开放数百个端口是否是一个好的做法?

最好的问候。

英文:

I will be appritiated if anyone answer to below quesion.

How a system will be designed with hundreds of services if each and every service has to be independent with a dedicated port as per microservices architecture? i mean is it a good practice to open hundreds of ports on OS for example?

Best Regards.

答案1

得分: 1

1.出于安全原因,微服务托管在私有虚拟私有云中,即节点(运行微服务的地方)没有公共IP。而且唯一访问它们的方式是通过网关API(见下文)。此外,“每个服务都必须是独立的”应该是指领域的意思链接1 链接2

2.使用API网关模式来暴露服务:“为某些微服务提供单一入口点的服务”链接1 链接2。请注意,API网关是针对一组微服务的,也就是说可能会有几个不同组的服务网关(一个用于公共API,一个用于移动API等)。

3.只有您才能回答这个问题,因为只有您知道您要解决的问题是什么。在做决定之前,我建议您阅读关于MonolithFirst方法的内容。

英文:
  1. For security reasons microservices are hosted in private vpc, i.e. the nodes (where the microservices are run) does not have public ip. And the only way to get access to them is via a gateway api (see below). Also "each and every services has to be independent" should be in the means of domain link1 link2.

  2. To expose services use the API gateway pattern: "a service that provides a single-entry point for certain groups of microservices" link1 link2. Note that api gateway is for a group of microservices, i.e. there may be several gateways for different groups of services (one for public api, one for mobile api, etc).

  3. Only you can answer this question because only you knows what problem you try to solve. Before deciding I recommend to read about MonolithFirst approach

答案2

得分: -1

微服务架构在某种程度上是ESB产品的下一代,但由于服务数量众多,我不确定它是否是一个解决方案!

英文:

Micro services architecture is somehow the next generation of ESB products but in this case due to the high number of services,I am not sure if it is a solution!

huangapple
  • 本文由 发表于 2021年10月2日 16:29:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/69415266.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定