The syncing of mobile data is an important issue, ranging from clean and reliable (Pocket, for example) to spotty and erratic (Facebook, for example). In this recent article, Adam Wiggins of Wandering CTO discusses the Clue engineering team's solution to syncing mobile data: Couchbase Mobile.
The appeal of Couchbase Mobile, according to Wiggins, is the multi-master model, as opposed to the more common client-server model. With the multi-master model, your data is replicated in multiple locations - both on your device and on the backend - which gets around the problem of network connectivity. He describes the difference as follows:
The lightbulb moment for me came by thinking of the difference between client-server vs master-master syncing as the difference between Subversion and Git.
With Subversion, you can’t commit changes unless you can talk to the server. Unavailable or intermittent network connectivity blocks your ability to work. Git (and other DVCSes), on the other hand, store a copy of the revision control database (as the .git directory) with every repository. So you can work continuously without network, committing as you go. Git pull & push do a sync.
Wiggins makes a persuasive and concise argument in favor of the multi-master model, but poses a number of questions as well. For example:
- How do you handle multi-tenancy?
- How do you manage/authenticate users?
- Where would backend logic run?