Search code examples
realmrealm-mobile-platform

Sync large Realm behavior


I want to know how realm handles syncing large Realm on the Realm Mobile Platform.

Let's say I have a chat application. Users and chats. My understanding is that everything gets synced. If the amount of storage available on the phone won't let the entire realm sync, does realm handle this? If so what is the behavior? Do objects that are older get removed from the device?


Solution

  • You are right - the entire Realm gets synchronized. You can split different conversations into different Realms which you can then clean up as you see fit - e.g. remove the files (not the data - it will still be available on the server) for inactive conversations.

    Alternatively, you can use Partial Synchronization to download just the objects that are relevant for the current user.