gary-rowe / multibit-merchant

⚠️ OBSOLETE. DO NOT USE! A free and open source Bitcoin ecommerce platform, with several representative clients (online shop, admin etc). Uses Dropwizard, HAL, MongoDB etc
http://multibit.org
Other
150 stars 50 forks source link

Database upgrade and rollback process #2

Open gary-rowe opened 12 years ago

gary-rowe commented 12 years ago

Require a mechanism to allow the local database to be patched and populated safely.

The following approach could be used (includes client UI and platform operations):

  1. MH From the admin screen user clicks the Upgrade button
  2. CH All active user sessions are sent an alert giving them 1 minute before forced log out
  3. CH New users arriving are shown a system maintenance screen
  4. MH All active users sessions are suspended, and no new ones permitted.
  5. MH Database is backed up to {currentVersion}-final-snapshot.zip
  6. MH Admin is given message that upgrade preparation is complete
  7. CH Call out to script to perform shutdown and launch upgrade
  8. MH On startup new version uses existing database as basis for upgrade
  9. MH The version table contains the previous version and is used as the basis for applying a sequence of one-way patches to reach the current version
  10. MH If a patch fails at all, the upgrade fails and a rollback procedure is started (see later)
  11. MH Admin is given message that upgrade is complete
  12. MH Customers are accepted back on to the system

For rollback the following process could be used (includes client UI and platform operations):

  1. MH From the admin screen user clicks the Rollback button. Only available if an upgrade has failed.
  2. MH Existing database is backed up to {currentVersion}-failed-upgrade.zip to allow for more sophisticated recovery operations if necessary
  3. MH Existing database removed and restored from most recent of {previousVersion}-final-snapshot.zip
  4. MH Admin is given message that rollback preparation is complete
  5. CH Call out to script to perform shutdown and launch previous version