Dynamic vector clock reconstruction with multiple nodes

379 views Asked by At

I am using a dynamic vector clock for my application with multiple nodes. Each node has a unique ID which is stored alongside its clock in the vector clock. I need to turn the vector clock into a textual representation. My current solution is to build a hash over all ids that are part of the vector clock. This however requires me to search for the matching hash in the product space of all node names.

For example I have 3 nodes with the (simplified) IDs "a", "b" and "c" and the clocks 3, 6 and 4. To not store them as "a:3-b:6-c:4", I join the IDs to "a\nb\nc" and create the hash out of this. In the end I have a string with "hash:3-6-4" to keep the vector clock short, even with a lot of nodes.

This dynamic vector clock should be able to add new nodes, with increasing time. E.g. if we add "d:1" to the vector clock above I take the hash of "a\nb\nc\nd" and join it to "hash:3-6-4-1".

If I now receive this vector clock on any node I want to be able to reconstruct the IDs from the hash in order to work with them locally. The current implementation I have is not applicable for more than 15 nodes at once, as reconstructing the IDs from the hash is too expensive.

Is there any efficient algorithm or datastructure that would allow me to solve this problem more intelligently?

Thanks a lot in advance for your input.

0

There are 0 answers