Chat-Wane/CausalTrack

Create a data structure with tombstones

Chat-Wane opened this issue · 1 comments

Current package includes three kinds of causality tracking. VV tracks all events among all the others. Both IVV and VVwE tracks semantically related event (e.g. 2nd operation of 1st peer depends on the 1st operation of 3rd peer, therefore, the former requires that the latter is delivered before being delivered, and nothing else).

The fourth data structure would be a set (ordered for efficient search) with the unique id of the operation and a time-to-live (TTL). When the TTL is expired, the operation does not exist anymore. Theoretically, it can create consistency problems. Nevertheless, in practice, with a TTL high enough, it does not. Difficult part being to set the value of this TTL.

NB: "tombstones" designation refers to the conflict-free replicated data types. One class of CRDTs keeps the deleted elements in the underlying structure forever (hence called tombstones). Using tombstones allows distinguish elements delivered then deleted, of elements not delivered yet.

TODO: Use the module "lru-cache" which does exactly the aforementioned deletion overtime. Still need to map both interfaces though.