I am pretty close to going in production with a mobile application that uses Realm.
While testing different scenarios however I found a problem, I did not really think of before.
I created my own CI/CD that does the following:
- Build Android application
- Build iOS application
- Deploy both applications to the store
- Promote Realm vom Dev to Prod
Now however arises the following problem:
The moment I promote Realm from Dev to Prod, the applications in the stores are not yet live (this can take up to a few days). And even if they are, I can not ensure that the users will even update the application on time. That means, that my Realm is always “ahead” of my application. So if I - for example - rename a field in Realm, the application of all users will break in the second, I promote my schema from Dev to Prod.
All the migration logic that I could put into my application to compensate this will thus have no effect, as they dont have the application yet.
I am kind of lost now, how the procedure should look like. I thought of following scenario and wanted to ask for feedback first:
- Build iOS + Android application
- Deploy them to the store with a fixed release date (e.g. 5 days in the future) in the future
- Create a CRON job that runs in 5 days and promotes Realm Dev to Prod
- Block the users in the application until they update (problem)
- Don’t touch Dev for 5 days (problem)
I hope I made my problem clear and there are already some best practices.