You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generic database upgrade mechanism on startup should be built.
This involves:
Creating a context table with a single record holding the last version of the software run (when the table is not present, assume the version run is the one before the version implementing the change)
On server startup:
the server checks if the software version is greater than the last version run
if no, it simply starts
if yes,
it looks for all upgrades to apply in order from the last version run to this version (this is done using a static function hardcoding the upgrade functions to call for each version)
if there is any to run, it sets an upgrading flag on the db state field in the context table
it runs all the upgrades in order
it sets the flag from upgrading to ready
On every call to the DB, a check must be performed on the db state field to check if the DB is upgrading. If yes, calls should fail. Performance can be maintained using a secondary write-through cache of the context table
Upgrades should be programmed to resist being interrupted in the middle and resumed from start.
The text was updated successfully, but these errors were encountered:
A generic database upgrade mechanism on startup should be built.
This involves:
context
table with a single record holding the last version of the software run (when the table is not present, assume the version run is the one before the version implementing the change)upgrading
flag on thedb state
field in thecontext
tableupgrading
toready
db state
field to check if the DB is upgrading. If yes, calls should fail. Performance can be maintained using a secondary write-through cache of thecontext
tableUpgrades should be programmed to resist being interrupted in the middle and resumed from start.
The text was updated successfully, but these errors were encountered: