You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/CRDT/Documentation.docc/UsingCRDTs.md
+14-1
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ The choice of type impacts how much memory is required as additional tracking in
32
32
In ``ORSet``, ``ORMap``, and ``List`` the combination of the both the size of the `ActorID` and the size of the Lamport timestamp are used to track the history of each element.
33
33
The causal tree implementation of ``List`` includes an additional metadata to track the parent id within the causal tree.
34
34
35
-
36
35
### Memory Overhead
37
36
38
37
The memory overhead is minimal for the simplest CRDTs: ``GCounter``, ``PNCounter``, and ``GSet``.
@@ -42,6 +41,20 @@ The memory needed to track the history when you can add, remove, and update unor
42
41
The most memory is required to track history when you can add, remove, and maintain an ordered set of values.
43
42
The memory needed for `List` grows with the combination of all additions, removals, and edits to the array.
44
43
44
+
If the size of a list element is fairly small, a CRDT can represent a significant expansion in the total memory needed to represent that list.
45
+
This may not be a significant issue, but is definitely worth being aware of.
46
+
As an example, the library tests include [a test that shows the expansion of rough memory needed to store a string](https://github.com/heckj/CRDT/blob/f0ee6b25937a8ac1202432eba856d98f76f1cdf6/Tests/CRDTTests/grokTests.swift#L111) as a CRDT list of characters, which you might do to represent a collaboratively edited description.
47
+
The ``List`` CRDT type has the most memory overhead, but provides the most functionality in allowing items to be added, removed, updated, and their ordering preserved.
48
+
This space of CRDTs also has the most ongoing research and experimentation to optimize it.
49
+
50
+
Using a single character string as an `ActorID`, the expansion in space is roughly 21 times:
When you start off with CRDT types that are independent, merging them is deterministic, meaning that you will always get the same result, but that result may not be what you perceive as correct.
0 commit comments