Hacker News new | ask | show | jobs
by josephg 884 days ago
Hi! I invented replayable event graphs. I'm writing a paper at the moment about it, which hopefully should be out in a month or so. Send me a private email and I can mail you the current draft if you like.

> If you remove these ops from history, does that remove the ability to time travel

Yes it does. You also need the ops from history to be able to merge changes. You can only merge changes so long as you have the operations going back to the point at which the fork happened.

> is it possible to put the removed historical/tombstone ops into a "cold storage" that's optional and only loaded for time-travel use?

Absolutely. And this is very practically useful. For example, you could have a web page which loads the current state of a document (just a string. Unlike CRDTs, it needs no additional metadata!). Then if some merge happens while you have the document open, the browser could just fetch the operations from the server back as far as it needs to be able to merge. But in normal operation, none of the historical operations need to be loaded at all.

All this said, with text documents the overhead of just keeping the historical operations is pretty tiny anyway. In my testing using diamond types (same algorithm, different library), storing the entire set of historical operations usually increases the file size by less than 50% compared to just storing the final text string. Its much more efficient on disk than git, and more efficient than other CRDTs like automerge and Yjs. So I think most of the time its easier to just keep the history around and not worry about the complexity.

1 comments

Is this a special case of operational transforms, vv or something else entirely?
I think you can argue that it’s both a special case of an OT system, and a special case of a CRDT at the same time. It stores the original operations rather than transformed operations (like an OT system would). Then it does OT in bulk on those operations on every peer by constructing a crdt state object on the fly.

So it’s very closely related to both crdt and OT based systems. I think if you squint your eyes you could argue that it’s both. It’s a grow only set crdt, storing operations that we do OT on. We do OT by embedding another crdt implementation inside each peer.