Swiftpack.co -  bradhowes/DottedVersionVector as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
bradhowes/DottedVersionVector
Swift implementation of a dotted version vector (see https://github.com/ricardobcl/Dotted-Version-Vectors)
.package(url: "https://github.com/bradhowes/DottedVersionVector.git", from: "1.0.1")

CI Swift 5.3 SwiftPM compatible License: MIT Documentation

DottedVersionVector Library

This is a Swift implementation of the dotted version vector as described in the paper Dotted Version Vectors: Efficient Causality Tracking for Distributed Key-Value Stores by Gonçalves R, Almeida PS, Moreno CB, Fonte V, Preguiça N. (2012). This code used the reference implementation in Erlang for guidance (and test cases).

Implementation Details

The basic class is DVV which contains a version vector and a Dot which is just a named counter. The version vection itself is simply an ordered collection of Dot instances, but with slightly different semantics. The Dot instance in the DVV refers to a write counter for a given server, while the Dot instances in the version history record the relationships between versions.

The Erlang reference implementation incorporates a timestamp in the Dot defintion that is used to order Dot instances when the server or replica key is the same. This Swift implementation does not do this -- it assumes that the server or replica managing the Dot counter can guarantee that it is properly incremented at every update.

Just like the Erlang implementation, a DVV is immutable. The DVV API will generate a new DVV instance instead of changing a value in-place.

Links for More

GitHub

link
Stars: 5
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics