Skip to content Skip to sidebar Skip to footer

Firestore Schema Versioning And Backward Compatibility With Android App To Prevent Crashes

Firestore a NOSQL is a Document oriented database. Now how to manage versioning of the data as I use it with Firebase SDK and Android applications? For e.g. let's say I have a JSON

Solution 1:

We come up to next versioning with Firestore:

  • prefer additive changes, backward compatible -> keeping structure as it was, but with adding new fields (that can be ignored by old mobile clients)
  • in case it is impossible, and we are doing backward incompatible change: we have a collection in Firestore, called 'versioning', where store clients with allowed versions. Then mobile application on lunch fetch this version for current platform and compare version from configuration with stored in Firestore - if version is less then min allowed, force upgrade required, else if version less then current, we recommend updating the client, otherwise all is fine. enter image description here

Post a Comment for "Firestore Schema Versioning And Backward Compatibility With Android App To Prevent Crashes"