How do CRDTs work with denormalized data, or more generally, data where some fields have invariants that must be maintained between them? Let's say we have an object with an array of strings and a count of that array:
{
"words": ["a", "b", "c"],
"count": 3
}
Now suppose users A and B edit the document so that one word is deleted, and two words are added, respectively: {
"words": ["a", "b"],
"count": 2
}
{
"words": ["a", "b", "c", "d", "e"],
"count": 5
}
What probably should happen now is that we reach the state where `words` is `["a", "b", "d", "e"]` and `count` is `4`, but is that really what would happen? That would require the CRDT to understand changes to `count` as increment/decrement operations, but aren't there also situations where you'd simply want one of the two values to win?