Dotted Version Vectors
Let's learn what dotted version vectors are and how they provide scaling of version vectors.
We'll cover the following
Dotted version vectors is a technique that makes it possible to successfully identify concurrent versions, and allows the version vectors to scale with the number of servers.
The following characteristic of this technique allows it to achieve this.
Characteristic that makes it possible to scale version vectors
Each entry in the vector is not a single number anymore, but a pair of numbers. This can encode a sequence of numbers that are not fully sequential but contain one gap.
The pair represents all the numbers from to plus the number .
For example, the pair represents the sequence . Note that the second number is optional and some entries can still be a single number. This can be leveraged to keep track of concurrency between multiple versions.
The order between the two versions is now defined in terms of the contains relationship on the corresponding sequences. So, for vectors , the relationship holds if the sequence represented by is a subset of the sequence represented by . More specifically:
- if
- if
- if
- if
The update rule executed by each replica node when it receives a write operation is also slightly different.
For all the indexes except the one belonging to the replica node, the node uses the value where is the maximum number amongst those available in the provided version vectors in the context.
For the index corresponding to the replica node, the node uses the pair , where is the maximum number amongst those available in the provided version vectors in the context, and is the maximum number amongst the version vectors present in the replica node (essentially the value of its logical clock).
For a more elaborate analysis of the rules and formal proof that this technique is safe, refer to the
. original paper N. M. Perguica, C. Baquero, P. S. Almeida, V. Fonte, and G. Ri- cardo, “Dotted Version Vectors: Logical Clocks for Optimistic Replication,” arXiv:1011.5808, 2010.
The following illustration shows what a solution with dotted version vectors would look like in our previous examples.
As we can see, the write operations by client nodes and end up receiving version vectors and and they are successfully identified as concurrent, since and .
Get hands-on with 1400+ tech skills courses.