Versions of objects in firebase

I use firebase as a database for a mobile application. Mobile version of application 1 using a specific database structure. But in version 2, I have major schema changes. I could not find any specific documentation that mentioned the best methods for managing database updates. So I’m thinking about the next steps that look good on paper.

  • Application version 1 is in production using firebase / v1
  • Copy version 1 of firebase / v1 to firebase / v2
  • Firebase / v2 schema update
  • Disable write operations in firebase / v1
  • Distribute v2 application pointing to firebase / v2

Using these steps, users with older versions of the application will be able to read only data. Therefore, if they do not update the application, they will not be able to change any data.

Am I going in the right direction when managing schema updates? Or is there a better way to do this.

+16
android rest database ios firebase
source share
1 answer

Use the cloud function database functions to transfer data from db / v1 to db / v2. When updating events in db / v1, you can write to db / v2 in parallel so that all active user data can move to db / v2.

https://firebase.google.com/docs/functions/database-events

Transfer data as soon as possible!

0
source share

All Articles