node.jsarchitecturemicroservicesmoleculer

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.

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!


Solution

  • 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. And if the traffic grows, you can start to separate the services into groups and make replicas if need (without modification in services codes).