Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 998
David Avatar asked Oct 09 '14 17:10

David


2 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.

like image 99
Christian Melchior Avatar answered Nov 15 '22 18:11

Christian Melchior


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.

like image 25
Andrew Varvel Avatar answered Nov 15 '22 20:11

Andrew Varvel