Flexible Sync Vs. Realm (Partition) Sync + is pausing sync possible?

Hi

I started using Realm’s partition based Sync for a not yet published app, where a key feature is the ability to pause sync, so I can control when the app syncs (diff. plans give diff. sync frequencies).

However, I just found out and am excited about Flexible, but I will only be able to use it if it also has the same ability to temporarily pause/resume sync’ing.

Is it possible?

I could neither find an explicit mentioning of this in the Doc., nor a code-example (react native).
Does Flexible include all the possibilities (100% enhancements over) Partition Sync, or would we trade features off between the two and potentially loose (e.g. sync.pause)

As far as I understand it, in Partition Sync, I can keep the data always on device (offline) which may or may not be sync’ed at any moment.
Is it possible to have that same guarantee with Flexible, i.e. having all previously downloaded data available offline?
See
“When you remove a subscription query, the server also removes synced data from the client device.” from
https://docs.mongodb.com/realm/sdk/react-native/examples/flexible-sync/

Is there a possibility to never remove still-valid data, so a user offline never ends up missing previously available data?
Could it be done by always creating the same subscriptions at startup and never removing them?
What if sync is paused / user logs out then logs in / or just closes the app, what would happen to local data-copy?

Do you have a more precise time-frame for when Flexible will be available on the Free tier?
I am hoping to publish my app this coming April - will Flexible Sync be production-ready by then, and would it be available on the lesser paid-plans or only dedicated cluster?

Regards,

@Tayeb_Taouti

  1. Yes you should also be able to pause sync with flexible sync - I believe that it is the same API as partition-based Sync. Is this not working for you?

  2. Flexible sync is just a different way of seeding the data that gets stored on the client which is available for offline usage - instead of sending a partitionKey value you send a query. The data stays on the device even if the user closes the app or goes offline. You can remove the local data by unsubscribing from your syncing query subscription - if you don’t want to remove the data - don’t unsubscribe.

  3. Its available in the free tier now! Have at it!

1 Like