I am developing a microservice architecture and had to design a custom load balancer to resolve issues with a general one; however, I encountered a problem with hashing functions that allowed distributing loads effectively among the services. To be precise, all the services I’m running are unique instances that could as well be copy instances capable of scaling up or down depending on the traffic load.
What are the best approaches of preventing frequent request re-routing whenever instances of an application scale up or scale down?
What data structures and algorithms are recommended to be used for manipulating the hash ring and updating it, and in particular, for the distributed environment?
Noticed any possible pitfalls or recommendations regarding the “split brain” problem in this context, which is that the hash ring may be out of phase of between the nodes here.
Also, I’m interested in knowing if there are in Java some libraries or frameworks that could be used to easier and more efficient the use of the consistent hashing and the management of the dynamic scaling in a microservices architecture.
I implemented consistent hashing to distribute requests across dynamic service instances but faced issues with request re-routing during scaling. So, I expected minimal disruption when instances scaled up or down.
kiruthikpurpose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.