Home » Android » What is the easiest way to keep a database synchronized between multiple iOS and Android devices?

What is the easiest way to keep a database synchronized between multiple iOS and Android devices?

Posted by: admin June 15, 2020 Leave a comment

Questions:

For our mobile application, we were hoping to use the Realm.io database, but we need to be able to synchronize multiple devices so they always have the same information. The database could get to be a few megabytes of data, so we would want to make sure that we didn’t have to upload the entire database every time something changed and then re-downloaded on all their other devices. Ideally, we would also want to make sure that no other transaction with the server happens on the device until its database is updated.

How to&Answers:

Currently that is not possible using Realm, although I believe it is on the roadmap. So you would have to roll your own synchronisation using a REST API or similar.

The only database for mobile that currently support something like that I know of is CouchDB Light http://developer.couchbase.com/mobile/, but I don’t have any experience with it.

Answer:

Another option would be to set up an account with Parse

You could write to Parse each time you do a database write on Realm.

Parse also supports silent push notifications, so when a device writes data to Parse, it could send a silent push notification to update the Realm data models on the other devices.

Parse supports a variety of login methods such as Facebook, Twitter and email/password allowing easy user authentication.

Answer:

they just released a new tool-kit to just to that.

Today, we’re launching the Realm Mobile Platform, a new offering that
integrates our fully open-source (see below!) client-side database for
iOS and Android with new server-side technology providing realtime
synchronization, conflict resolution, and reactive event handling. The
new platform makes it easy for mobile developers to create apps with
difficult-to-build features like realtime collaboration, messaging,
offline-first experiences, and more.

read more here:
https://realm.io/news/introducing-realm-mobile-platform/