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?
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
Sure, imagine a microservice that needs to execute multiple independent calls to a dB or to other microservice and aggregate the results. As the calls are independent, they can be executed in parallel so that the total time is at most the time it takes to execute the slowest call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With