Hacker News new | ask | show | jobs
by junon 986 days ago
And CRDTs already solve this, which is what I assume notion uses.
2 comments

No, it was not using CRDTs when I last checked (more than a year ago). If you're designing for online-only, you can cheat a little and be "good enough".

Setting properties is a last write (to the server) wins (set path foo on block XXX to Y). So text changes overwrite the entire block. The contents of a page are a list of block ids. The operation is "insert id XXX after YYY", and if YYY is not found (deleted/moved), it's placed at the end of the list.

But the biggest impediments to offline for Notion (again when I last checked) were that it doesn't have a full copy of the data and some of the operations are executed server-side (autocomplete dropdowns, search, and some bulk operations). I was hoping they would deal with the former, because it'd make it easier to backup and process my data. But I ended up moving on.

I think they've dealt with some of the search operations, but are still not syncing all of the blocks.

Interesting, that actually surprises me. Thanks for clarifying!
I don't think there's truly any technical solution to "two users edited the same piece of text" tbh. You can try to be smart about it in various ways, but at the end of the day you're still going to hit situations where it's really not clear what the users' intent would be to handle two mutually-unaware edits on the same words
CRDTs handle exactly that. There are times where things aren't exactly as the user intends but at least there's a way to determine a resolution.
I meant in terms of achieving the intended outcome for the end-users. Is it actually desirable to ensure there's a resolution when really they need to decide?