Hi,

I'd really like to add CloudKit syncing to my app and I was wondering what 
the best approach would be for integrating it with CouchbaseLite (iOS).

In a previous post I suggested generating files that contain all the 
changes and then processing them on each device, keeping track of the last 
file that was synced.

But now I'm thinking a better solution would be to use CloudKit and store 
CBLDocument properties into CKRecord objects. 

What I'm wondering is what would be the best approach for this?

Should I simply store a one-to-one mapping of CBLDocument objects 
(representing the most current revision) to CKRecord objects?

What if a CBLDocument is updated or deleted?

Instead of storing CBLDocument objects into CKRecord objects, should I 
store CBLRevisions into CKRecords basically keeping a running log of all 
the changes over time?

If a CBLDocument is updated or deleted locally, maybe I should just replace 
the associated CKRecord in CloudKit with the updated most recent local 
revision?

What about document attachments?

There's the CKAsset class for that, but I'm wondering if maybe it's best to 
have a separate CKRecord for each attachment and relate that to the main 
CKRecord that represents the CBLDocument? Then if an attachment is updated, 
I just just find the corresponding CKRecord and update its attachment.

Processing the changes from CloudKit would just be a matter of converting 
each CKRecord into a CBLDocument and calling putExistingRevisionWithProperties 
on it.

I know these are a lot of unanswered questions. I'm just trying to find out 
what the best way to support CloudKit would be.

Official support for this from Couchbase would be an amazing addition for 
all iOS and Mac CBL developers.

If anyone wants to collaborate with me further on this that would be 
amazing. Multiple minds working on the problem would be much better than 
just me alone.

Thanks,

Brendan

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/752cc474-3b8c-4142-b787-c05380a10113%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to