Thanks you @Ian_Ward and @Jason_Flax for the great webinar today! I asked a question about transactions and costs, but I don’t think I got the context around the question right, so I’ll ask it here instead.
My app is a workout log app and I am using Realm locally, but want to move over to MongoDbRealm. Since I only use local realms, I have never had to worry about committing to edits to the database, but as I move to synced realms, each transaction causes sync and has a cost attached to it and because of this I will have to restructure the app to be better suited for sync.
Currently, each keystroke is saved locally. For a single user, this could easily be thousands of writes during a workout session and each would trigger a sync. From the user perspective, the only time you want to sync the data is when done with your session. Doing commits every keystroke, like I do today will both cause performance issues with sync and be expensive. Pausing sync won’t help as each transaction is still counted. Is there any other way?
I am thinking about doing something along these lines:
Creating a workout:
1: The user creates a workout and adds this to a local realm
2: The user edits the local realm
3: When the user is done, this is copied to the synced realm (1 commit right?)
When editing an existing workout
1: The user copies a synced workout to the local realm.
2: The user edits the local realm
3: When the user is done, the workout is copied to the synced realm.
Would this approach work? Do you have any other recommendations for this type of app, where you don’t need realtime sync and do loads of writes?