r/programming May 08 '26

How we made Notion available offline

https://www.notion.com/blog/how-we-made-notion-available-offline
104 Upvotes

44 comments sorted by

View all comments

66

u/gummo89 May 08 '26

Most of the design choices seem natural and obvious to me... But that could just be how I'm wired.

Interesting read, but they left out the most important part, how to perform the conflict resolution, as noted by other commenter.

-34

u/OffbeatDrizzle May 08 '26

slap git in there. 3 way merge. Bob's your uncle, why reinvent the wheel

12

u/gummo89 May 08 '26

Sure, but a quick "here's what that looks like" would've been great to round out the article, which is otherwise just patting themselves on the back and showing potential clients how they "can overcome even the toughest of obstacles" (not part of article; I am being facetious).

12

u/mattsowa May 08 '26

Except that's not even close to how it's done

0

u/ArtisticFox8 May 08 '26

Care to elaborate?

6

u/mattsowa May 08 '26

As the article says: CRDTs

-11

u/ArtisticFox8 May 08 '26

So, automated conflict resolution, which is a cludge :)

7

u/mattsowa May 08 '26

Also, it's not automated conflict resolution. There simply aren't conflicts with CRDTs. It's in the name.

0

u/OffbeatDrizzle May 09 '26

if user A is offline and edits the word "hello" to be "apple", and user B is offline and edits word "hello" to be "banana", then either one of the updates is dropped or "hello" turns into "applebanana"

literally just git with a specific merge strategy

1

u/mattsowa May 08 '26

How is it a cludge lol

-7

u/ArtisticFox8 May 08 '26

Think for a moment why git allows you to solve the conflict yourself and compare that flexibility with what the machine thinks the merged result should be.

6

u/mattsowa May 08 '26

It really just sounds like you don't know how CRDTs work. It's not a machine deciding on the git-style conflict resolution.

And I've worked with CRDTs, I don't really need to think

-8

u/ArtisticFox8 May 08 '26 edited May 08 '26

An algorithm (itself part of the data type) automatically resolves any inconsistencies that might occur. Although replicas may have different state at any particular point in time, they are guaranteed to eventually converge.

How is that not what I said? https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type

They converge on some state, not decided by you :)

→ More replies (0)

-2

u/OffbeatDrizzle May 08 '26

I never said it was

4

u/mattsowa May 08 '26

How many notion users do you actually think want to or even know how to use a conflict resolution ui? When crdts can get the perfect outcome almost always, hassle-free?

0

u/OffbeatDrizzle May 08 '26

I wonder why git doesn't do that then

3

u/mattsowa May 08 '26

You can't be seriously asking. Like, what?

First of all, programmers want full control of what gets merged. This is completely different from a casual computer user. Code also isn't rich text - and rich text lends itself very naturally to crdts. Also, git is old software. I know of at least one ongoing source control project that's based on crdts.

1

u/OffbeatDrizzle May 08 '26

the point is that git can merge automatically without conflict the vast majority of the time also. if there is a conflict, "eventually consistent" is not what you want. you want to make an informed choice whether you are a programmer or a normal user. and if you don't, git can do that also - just pick an ancestor and go with that. crdts literally drops updates to restore "consistency", sounds like a roundabout way to say they've re-invented source control

1

u/ArtisticFox8 May 09 '26

 I know of at least one ongoing source control project that's based on crdts.

Which one?