heckj / CRDT

Conflict-free Replicated Data Types in Swift
https://swiftpackageindex.com/heckj/CRDT/main/documentation/crdt
MIT License
154 stars 3 forks source link

create an iCloud file sync example showing the use of CRDT #38

Open heckj opened 1 year ago

heckj commented 1 year ago

Partially to show how to use the library, but also to work out more kinks - dig around in iCloud/CloudKit and set up an iCloud-based app that synchronizes a file and load/store the CRDT information from that - including reloading and merging on updates, and if that works and doesn't step over each other as two collaborators edit a single, simple document.

heckj commented 1 year ago

I'm leaning towards trying this with UbiquityURL and FilePresenter. From Apple's CloudKit docs:

heckj commented 1 year ago

Another example that would be really relevant is using it as a synchronization/state update mechanism for Apple's SharePlay API. But in order to be relevant, it would need to enable some controls to limit the update messages, allowing smaller sends if necessary/possible due to SharePlay's 256Kb message limit. For example, If you're slapping data from large (1MB+) images around in LWW maps, it'll need alternative mechanisms due to those limits in SharePlay.