App Version Management System
Every smartphone user these days has lots of apps installed in their smartphones. These apps follow multiple iterations in its lifecycle which can range from fresh installs to updates of an existing app.
Install is done for cases where the phone doesn't have the app previously installed.
Updates are triggered when the app is preinstalled but a new feature is rolled out.
Design an app version management system for a mobile application, say PhonePe app.
We will assume that there is no marketplace like Playstore / AppStore exists and every App Owner can directly interact with the target device irrespective of operating system ( android / iOS )
To install any app, consumer can go to the website and directly install the app through online installer ( we’ll assume, this is something which is implemented )
Real world example -
Install - Consumer just bought his / her first Mobile device and wants to use PhonePe. In such case a fresh Install will happen - always latest version supported will be installed
Consumer goes to phonepe website and selects install option given on website ( how it happens is outside the scope of problem statement )
Update- Above customer has installed the app and a few days later a new feature ( say dark mode ) is rolled out by PhonePe. In such cases, PhonePe will directly update the app on the phone.
System Components -
App and App versions -
App will have a list of versions, each version denoting a new file and metadata.
Version will have some meta data associated with it, like the minimum supported operating system ( android / iOS ) version etc. Roll out :: App admin can roll-out a new version from the backend. A roll-out can be either installing or updating the app - Rollout strategy - New version rollout can be done with different strategies.createUpdatePatch( app, fromVersion, toVersion) :
Create an update patch from source to target app version.
Diff of fromVersion and toVersion will be a byte-stream or byte-array and same diff would be fired on the target device and pre-installed app will take care of installation
Pre Installed app has capability to accept a byte-stream / byte-array and install it as an update / patch
releaseVersion(// necessary params) :
will release a version as per the strategy. BetaRolloutStartergy will include rolling out a new app version to only a set of devices.
isAppVersionSupported(// necessary params) :
will check if given targetVersion supports the input device using info like like device android version, rollout strategies etc
checkForInstall(// necessary params) :
Check whether a given h/w + OS supports the the app or not
checkForUpdates(// necessary params) :
checks if an update is available for a given device.
executeTask(// necessary params) -
will create an install or update task based on the method input. Can use methods from the list of available methods below.
Available Capabilities -
We can assume below methods are available (can decide method arguments by yourselves) -