Search code examples
databasemongodbrealm

Can MongoDB Realm be used to sync remote data to local db (rather than the opposite as advertised)?


I have a mobile app that needs to sync some tables from a remote db to the local db to use when it's offline, and then sync with remote db to update local records/data whenever it's online. I've stumbled upon MongoDB Realm and was wondering if it could support this behavior. Everything I've read so far on it seems to suggest the opposite: syncing local changes to remote db.

Would also appreciate any alternative suggestions.


Solution

  • Yes, Atlas Device Sync works in both directions - it will upload local data to Atlas and also stream changes from Atlas to the local device. The data is stored locally in a Realm database, so it's fully available and queryable when offline. Once the device reconnects to the internet, any changes that have occurred in the meantime will be automatically sent to the device.