简体   繁体   English

在单体应用中为微服务使用分子

[英]Using moleculer for microservices in monolith

I am in the process of implementing the backend for a business idea in moleculer microservice framework.我正在为分子微服务框架中的商业理念实施后端。 It works quite well for now using the NATS transporter.现在使用 NATS 传输器运行良好。

In the near future the number of messages will stay quite low ( compared to this example in moleculer documentation ) and scaling won't be an issue for now.在不久的将来,消息的数量将保持相当低(与分子文档中的这个示例相比),并且缩放现在不会成为问题。 Therefor In-Memory communication should not be an issue and I would like to remove the whole transporter overhead.因此,内存中的通信不应该成为问题,我想消除整个传输器的开销。

My motivation to use a microservice framework is loose coupling for a clean separation of responsibilities and the option to scale in the future with low effort.我使用微服务框架的动机是松散耦合,以实现职责的清晰分离,以及在未来轻松扩展的选项。

Are there any major disadvantages in using the monolithic architecture for early stage projects or should I directly implement it as a "One service - one/multiple node(s)" -solution?将单体架构用于早期项目是否有任何主要缺点,或者我应该直接将其实现为“一个服务 - 一个/多个节点” -解决方案? The official documentation describes multiple architectures .官方文档描述了多种架构

Any practical experience is highly appreciated!任何实践经验都非常感谢!

No, this is the biggest advantage of the Moleculer framework, that you can run all services on one node as a monolith while you have no big traffic.不,这是 Moleculer 框架的最大优势,您可以在没有大流量的情况下将所有服务作为一个整体运行在一个节点上。 And if the traffic grows, you can start to separate the services into groups and make replicas if need (without modification in services codes).如果流量增加,您可以开始将服务分成组并在需要时制作副本(无需修改服务代码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM