microdot
microdot copied to clipboard
Does it load balance?
Team, Do you any documentation over Load balancing? If not, could you please give a high level flow.
Thanks
@srinathgnath Unfortunately we don't have documentation for it right now, but I'll be glad to give you a quick overview.
There are two load balancing mechanisms:
-
Server-side load balancing done by Orleans. Orleans distributes load across the cluster using it's own methods, which you can read about here.
-
Client-side load balancing done by Microdot for inter-service calls. Calls to other services are distributed across the various nodes of that server/cluster using a round-robin approach combined with an optional correlation-ID-based "sticky session", which means that multiple calls with the same correlation ID (a.k.a
RequestID
, settable viaTracingContext.SetRequestID()
) will always go to the same node of the target service to reduce the chances that Orleans tries attempts to create duplicate activations of the same grain in multiple hosts, which requires time to resolve. This is only a performance optimization, not a matter of correctness.
Feel free to ask more questions!