I am thinking of building an application using a Service Oriented Architecture (SOA).
This architecture is not as complex and messy as a microservices solution (I think), but I am facing similar design problems. Imagine I have services of type ServiceA that send work to services of type ServiceB. I guess, if I use a queue, then load balancing will not be a problem (since consumers will take what they can handle from the queue). But queues tend to generate some bad asynchrony in the code that requires extra effort to fix. So, I was more inclined to use HTTP calls between services, using the efficient and amazing async/await
feature of C#. But this generates issues on sharing the workload and detecting services that are saturated or dead.
So my questions are:
- Is there a queue that supports some sort of
async/await
feature and that functions like an HTTP call that returns the result where you need it and not in some callback where you cannot continue your original execution flow? - How do I load-balance the traffic between services and detect nodes that are not suitable for new assignments when using HTTP? I mean, I can probably design something by myself from scratch, but there ought to be some standard way or library or framework to do that by now. The best I found online was this, but it is built for microservices, so I am not sure if I can use it without problems or overkills.
Update: I have now discovered this question, that also asks for awaitable queues: awaitable Task based queue ...and also discovered Kubernetes, Marathon, and the like.