Should multithreading be used in microservices?

Pasha :

Should parallel programming be used in the development of microservices in case the microservices are scalable and, for instance, deployed as ECS on AWS?

If yes, what are the benefits of consuming more resources by one instance vs the same resources by N instances?

How does parallel programming match https://12factor.net/

P.S. to be more specific - should I conceptually use parallel streams rather than simple streams?

Ivan :

Basically the link that you provided also provides answer to your question already

This does not exclude individual processes from handling their own internal multiplexing, via threads inside the runtime VM, or the async/evented model found in tools such as EventMachine, Twisted, or Node.js. But an individual VM can only grow so large (vertical scale), so the application must also be able to span multiple processes running on multiple physical machines.

https://12factor.net/concurrency

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=129207&siteId=1