It is like the Lamport event model married to a LSMT database. And their children are CRDTs.
> That makes sense to me except for calculating diffs efficiently. Are you saying that can be done in time proportional to the _diff_? (as opposed to the number of changes?)
Slightly different abstractions here, but yes, in most cases a "diff" is a tail of an op log. On request, it gets compacted and sent. I guess, in noms you leverage immutable data structures for that.
Thanks, now I understand your trade-offs better.
What happens in the case where the op log represents changes that went back and forth a bunch between two states. Does that ever get compacted down locally?
The difference here is that Noms will never have to read or compact those intermediate states. If a character gets inserted and deleted a bunch of times, and then that set of changes get synced with a peer, the source peer diffs the beginning and end state and ignores the intermediate ones. The local work done will just be proportional to the actual change between the two states (in this case finding a diff of a single char). This work is always proportional to the change in the two states, not the amount of ops that transpired between them.
> I guess, in noms you leverage immutable data structures for that.
That, and content-addressing.