ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Storage file format upgrades #13

Closed kirillt closed 2 years ago

kirillt commented 3 years ago

When the app reads a tags storage file, it checks the format version. If the version is lower than the current one, the file must be upgraded before using.

The app must contain code for upgrades between any two adjacent versions. Backup of the file should be done before upgrade.

kirillt commented 2 years ago

The storage format will be modified with time adding new features or due to other reasons. The library is supposed to be used by several apps on different devices and potentially on different platforms (Android, iOS, Linux, macOS, Windows). These apps can work with the same data synchronized between devices. This way, apps can use different versions of the library although version of tags storage can be the same on devices hosting these apps.

That's why:

  1. The library must be able to handle loading of older versions of the storage and upgrading them. Migrations mechanism can be implemented to allow this. Every critical source modification should add new migration. Storage upgrade must be confirmed by user and must involve saving original storage as backup.

  2. The library must be able to handle loading of newer versions of the storage and ignoring newer features. We can separate features in the storage from each other, loading only supported ones.

It really seems to be over-complication for now. The storage structure is really simple at the moment. When the format will need to change we must implement migration. For now only newer features are planned, which can be implemented as separate entity with separate storage.