Nodes

Moleculer supports several architectures.

Monolith architecture

In this version every services are running on the same node. So there is no network latency and no transporter module. The local call is the fastest.

Monolith architecture

Microservices architecture

This is the well-known microservices architecture when every services are running on an individual nodes and communicates via transporter. In this case the network latency is not negligible. But you can scale your services to avoid faults.

Microservices architecture

Mixed architecture

In this case we are running coherent services in a group on the same node. It combines the advantages of monolith and microservices architectures.
For example, if the posts service calls a lot of times the users service, we put them together, that we cut down the network latency between services. If this node is overloaded, we will scale it up together.

Mixed architecture

Tip

The ServiceBroker tries to call first the local instances of service (if exists) to reduce network latencies. You can turn off this logic in broker options with preferLocal: false under the serviceRegistry key.