I've been doing some research for enhancement of in-house Discovery Service on my project. We have a number of nodes in a cluster accountable for discovery service, higly available. In order to get access to some service each client app sends a multicast message to all these nodes in the cluster. All nodes respond to a client and the very first response defines a particular node for further work. This is an overhead and I'm thinking of using some kind of leader election algorithm where only a single leader responds to clients. Is it reasonable to use such an algorithm for this task?
Asked
Active
Viewed 565 times
0
-
leader selection, or other solutions for concensus problem solutions are usually implemented when availability is critical. Is it the situation in your case? – amit Feb 13 '14 at 12:01
-
We need to make sure that there's at least a single node is up and running. High availability is critical but a simple availability is not. – Ivan Voroshilin Feb 13 '14 at 12:03
1 Answers
0
I think what you are trying to do is load balance across multiple machines where in any machine can handle the requests. Leader selection etc seems a overhead. Probably a loadbalancer can solve the issue.

abhinav
- 1,252
- 10
- 27
-
Each node in a cluster already works as a load-balancer using a simple round-robin. The issue is that we don't have a leader among those nodes. Therefore clients send request-messages to all of them to get access to a particular service. – Ivan Voroshilin Feb 13 '14 at 12:21
-
Let me draw how it works in simple terms: 1. client sends multicast request-->1..n nodes. 2. All available nodes respond 3. Client initiates further conversation with that node which responded first to the client with generated sessionId and connection details of a particular service. – Ivan Voroshilin Feb 13 '14 at 12:25
-
-
No abhinav. I mean that I don't want a client to get responses from all nodes in a cluster but a single one - that is the leader. – Ivan Voroshilin Feb 13 '14 at 12:32
-
Exactly, so in my opinion, add a loadbalancer, to which client will send all the requests. And loadbalancer can then in forward it to any node. My approach is basically based on my experience of using amazon ELB – abhinav Feb 13 '14 at 13:03
-
The thing is that we implement it on our own. LoadBalancer should also have high availability. E.g. what a client is going to do if the load-balancer goes down for some reason? He would try another one. So if we have 10 Load-Balancers, a client will sequentially try all of them until success. I think that if the client knows about the leader he connects to him - this is a better case. – Ivan Voroshilin Feb 13 '14 at 13:12
-
The reason clients send multicast to all of them as it works now - we reduce latency in response unlike if a client would try all of them sequentially 1-by-1. – Ivan Voroshilin Feb 13 '14 at 13:15
-
you can the number them and client can try one by one, if first one fails go on to second etc – abhinav Feb 13 '14 at 16:55