

Syncing data between iOS devices - floriankugler
http://www.objc.io/issue-10/

======
Spearchucker
Interesting read. I've been working on multi-device sync for some time and
noticed a few things I ran into. The article speaks of P2P, and goes on to say
that transaction logs are uploaded to the cloud. Not P2P then. P2P doesn't
work anyway, because there's no guarantee that any two devices are active at
any one time. I'm pretty sure my understanding of P2P is limited, compared to
the author's.

The other issue is that all approaches described seem to preclude multi-user
sync, which is what I've been struggling with. Security also becomes a ball-
ache in that changing a password, which unlocks a private key that unlocks a
symmetric key that encrypts and decrypts content means storing two copies of
any one sync item until all sync clients have the new keys. There are ways of
simplifying this, but complexity always creeps back in if I want a zero-
knowledge server.

The third thing I'm working on is the idea of multiple, disposable servers. If
one goes down, another steps in. If server A offers better comms to device 2
than device 1 which syncs via server B, then device 2 should default to server
A without affecting sync scope from device 1.

It's a fascinating subject.

Good article, all the same!

~~~
mamcx
I'm stuck on this too. I wish to make my invoice app with offline support +
async sync, where a company sync several devices, in both ways:

[http://stackoverflow.com/questions/21733360/algorithm-
that-s...](http://stackoverflow.com/questions/21733360/algorithm-that-
synchronizes-two-database-sources)

~~~
Aloisius
We built a custom solution at SeatMe to sync multiple iOS devices with offline
support to a central database. There were a lot of edge cases that make it
pretty difficult.

There was the embedded mongo (or maybe couchbase?) db available for iOS that
does multi-master sync that was being developed for a while that might work
though.

~~~
Spearchucker
I use Mongo to store entities. I front that with a relational database to a.
map entity locations and b. hold associations. That lets me track entities by
device/application/users (one item can be shared bu multiple apps and multiple
users, each using multiple devices). I want to be able to disable devices and
user accounts. Only the creator of an item can hard delete an item, and so on.
My code is custom too, because there's nothing out there I could find that
does that.

------
aaronbrethorst
This is great. Guys, I love what you're doing with objc.io. Please keep it up!

Everyone else: if you want to help support the site, set up a recurring
purchase for the objc.io app in the App Store. It's something ridiculously
cheap (for the value provided), like $5.

Also, for more on iOS data syncing and Core Data, this has been a frequent
topic of late on Brent Simmons' blog:
[http://inessential.com](http://inessential.com)

------
alexwolfe
Firebase is also a good solution: [https://www.firebase.com/docs/ios-
quickstart.html](https://www.firebase.com/docs/ios-quickstart.html)

------
jchrisa
Couchbase Lite supports both iOS and Android, and it's all open source.
[http://mobile.couchbase.com](http://mobile.couchbase.com)

~~~
yapcguy
There's also Cloudant Sync based on CouchDB, which is also open-source and for
both iOS and Android. [https://cloudant.com/blog/introducing-cloudant-
sync/](https://cloudant.com/blog/introducing-cloudant-sync/)

But how do we choose between CouchBase and CouchDB sync?

~~~
tzm
Here is more info on Cloudant Sync: [https://cloudant.com/cloudant-sync-walk-
thru](https://cloudant.com/cloudant-sync-walk-thru)

