I am using PostgreSQL 9.3, and I have implemented consistent hashing with virtual hosts using plproxy.
In the current node configuration, adding and rebalancing between nodes is performed (moving data between servers is performed using PostgrelSQL external data wrappers ).
But there is one limitation. In the current setup, all physical nodes are considered equal. those. There is no way to provide a virtual node account to the server when adding node. I also want to build this behavior.
So, I ask what would be the best algorithm to implement this. The current algorithm distributes the virtual capacity of the node servers evenly between the servers. In the new algorithm, I would like to see the minimum number for the virtual node movement.
Example:
Suppose we have a cluster of 4 servers, and each server has 64 virtual nodes (a total of 256 virtual nodes). I want to add a server (server X) that has 200 virtual nodes (or a few percent of virtual nodes) so that every 4 servers equally contribute to this new server, to some extent satisfy its virtual node.
BUT, when a new node is added (for example, server X), I do not want to allocate all 200 for this server. I need an algorithm to assign a certain percentage of existing servers, so that the new server 200 nodes are satisfied to some extent, and the previous 4 servers do not lose a virtual node counter there.
What would be the best strategy for sharing a virtual node among physical servers?
Viraj source
share