News for hackers. Stuff that matters.
Re:Show HN: Matrix-CRDT – real-time collaborative apps using... by jeroenhd on Tuesday January 18, 2022 @10:27AM (#29980545)
This is an interesting use of the Matrix protocol. I like the many creative ways Matrix is being used outside the chat space, where its predominant use lies. However, I have several questions about this approach.

- What happens with E2EE when there are key exchange problems? (i.e. a server goes down and the account is moved)

- What happens when someone redacts a message? I assume you'd want to disable redactions for these rooms or you'll end up with broken update trees!

- How do you communicate clearly that any data you add is in the event chain forever? In Word and GDocs you can remove old revisions of a document, but I don't think you can in this system? That could be a feature, of course!

- What's the performance impact of such a system on a server editing reasonably large documents? If twenty people each edit ten to twenty documents you end up with quite a large set of state, especially over time!

Re:Show HN: Matrix-CRDT – real-time collaborative apps using... by YousefED on Tuesday January 18, 2022 @11:30AM (#29981554)
Thanks for the questions!

- If you'd enable E2EE for the Matrix client that you pass to Matrix-CRDT, key management is covered in the same way that Matrix does it normally. If key sharing with a particular user is broken, then you won't see updates from that user anymore and v.v. Basically, the transport between you and that user is broken. As CRDTs such as Yjs are designed specifically to work Local-first, at the core there is no assumption that all clients should always be connected to each other. Once the clients are able to communicate again, potential conflicts would be "resolved" according to the CRDT design.

- Redacting: yes, basically you need to trust clients not to fiddle with messages (I think this is fair as you trust them to work with you on the same data already)

- UX / communication: good question! Technically would be possible to purge old (deleted data), but I think this is still something we need to explore together while we start to see more mature software built on these technologies.

- Kevin already answered your performance questions. Matrix-CRDT makes an additional optimization so that not the entire history of the Matrix room needs to be retrieved (see "Snapshots" in the readme)

Re:Show HN: Matrix-CRDT – real-time collaborative apps using... by Arathorn on Tuesday January 18, 2022 @07:57PM (#29988458)
The best way to do snapshots might be to persist them as binary blobs (or binary diffs) in the Matrix media repository rather than snapshotting as Matrix events (whose limit is 65KB) ftr.
Re:Show HN: Matrix-CRDT – real-time collaborative apps using... by alexisread on Tuesday January 18, 2022 @03:30PM (#29985287)
Amazing work on this btw Yousef! With the UX/Communication, I kinda see this as similar to tombstoning (with or without envelope-encrypted data), and archiving (eg. to permanent storage). I'd imagine this would also be necessary for GDPR compliance.

Additionally, exposing the CRDT stream would allow for reactive index building for searches on the data (ie. timely dataflow operations to aggregate an index).

Re:Show HN: Matrix-CRDT – real-time collaborative apps using... by kevinjahns on Tuesday January 18, 2022 @10:53AM (#29980963)
I can only answer to the last question. Yjs uses several performance optimizations to produce small documents (both in memory and in the encoded state). Since humans type relatively slow (<60 actions per minute), it is impossible for humans to create a document that has performance problems. I showed this in [1].

Relm [2] even models a 3d world using Yjs. I don't necessarily recommend doing this as 3d applications usually produce a lot more actions per minute than text applications. This required some workarounds and deep knowledge of how Yjs' optimizations work. But it's definitely possible.

[1]: https://blog.kevinjahns.de/are-crdts-suitable-for-shared-edi... [2]: https://www.relm.us/