We would like to shard a weighted directed graph,
The user can add nodes and edges dynamically, at first the DB/Graph is empty.
We keep the nodes and edges in a key/value database (probably Redis): For each node, we will have the nodeId as the key and a sortedset of keys of referenced nodes the score of each nodeId in the sortedSet is the weight of the edge.
(See question regarding that here: Redis: Implement Weighted Directed Graph)
We don't have a balance constraint, the most common action over the graph is Dijkstra, and we had like to minimize the I/O(network in our case)
Possible solution: each DB server contains a list of other servers with IPs:
key:server1, value:....250.1
key:server2, value:....250.2
key:server3, value:....250.3
and each nodeId will be serverX.originalNodeId
What would be the algorithm that decides which node goes where? should we support re-positioning of a node?
I guess that the naive approach would be, add node A to serverX where argmax(# of nodes in server X that have edges with node A), as long as serverX is not fully occupied..