Over a million developers have joined DZone.

Couchbase Mobile: Multi-Master vs. Client-Server Models

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

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?

For more details on the Clue engineering team's work with Couchbase Mobile, as well as the conclusions they came to, check out Wiggins' full post.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}