I am using firebase as a database for a mobile application. Mobile application version 1 using a certain DB structure. But in version 2 I have a major schema changes. I could not find any specific documentation which would mention the best practices for managing DB upgrades. So I am thinking of following steps, which looks good on paper.
With these steps users with older versions app would be able to only read the data. So unless they dont upgrade the app they wont be able to modify any data.
Do I going in the right direction in managing my schema updates? Or is there any better way to do this.
By default, a query retrieves all documents that satisfy the query in ascending order by document ID. You can specify the sort order for your data using orderBy() , and you can limit the number of documents retrieved using limit() .
Cloud Storage for Firebase is a powerful, simple, and cost-effective object storage service built for Google scale. The Firebase SDKs for Cloud Storage add Google security to file uploads and downloads for your Firebase apps, regardless of network quality.
We can filter data in one of three ways: by child key, by key, or by value. A query starts with one of these parameters, and then must be combined with one or more of the following parameters: startAt , endAt , limitToFirst , limitToLast , or equalTo .
Cloud Firestore is Firebase's newest database for mobile app development. It builds on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales further than the Realtime Database. Realtime Database is Firebase's original database.
Use cloud function database functions to migrate data from db/v1 to db/v2. On update event in db/v1, you can write to db/v2 in parallel, so all active user data can move into db/v2.
https://firebase.google.com/docs/functions/database-events
Migrate data asap!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With