This guide explains how MDOQ handles and manages the different types of database backups, and intern how they are used by instances.
The MySQL Component
As you may or may not know, every instance on MDOQ is built from a number of components, in this guide we are going to be focusing on the MySQL Component. This component is responsible for all things database related; importing backups, taking snapshots, MySQL configuration etc...
The MySQL component can be configured by going to "Settings" > "MySQL". You can see an overview of the settings available here. By default every new instance inherits the same settings as the production/live connector instance, once the instance has been created these settings can be changed.
There are 2 main types of backups, with 2 options each. A description of the types and options can be found here.
MySQL Creation Process
When you ask MDOQ to create an instance, it will check to make sure that a backup matching the type and option configured exists.
If it does and a snapshot (Built version) for the type doesn't exist, MDOQ will create from the backup.
Importing a MySQL backup takes much more time than from a built version.
Because MDOQ can create multiple instances at the same time, to stop a duplication of slow work (importing a MySQL backup) MDOQ creates a lock.
This lock stops any other instances from trying to import the same backup at the same time. If two or more instances are trying to be created at the same time, the first instance will import the backup and the other instances will wait for it to finish and for the lock to be removed.
When a backup has been imported MDOQ will automatically create a built version of it, before releasing the lock.
This allows any other currently waiting instances and/or future instances to create from the built version, speeding up instance creation.
This process is the same regardless of backup type i.e Sanitized or Full
Using "Latest Sanitized"
We recommend using latest sanitized however it is the same process for "Latest Full".
If you select this option, as soon as a new backup is available with MDOQ it will be used next time an instance is created, or the MySQL component is synchronized.
- No manual intervention is neccesary to build the latest backup
- The underlying backup for Mysql can change when synchronizing mysql. Which can cause unpexpected issues.
- If a new backup is taken and it large. All instances will have to wait for this backup to be built before they can be created.
Using "Latest Sanitized (Built)"
We recommend using latest sanitized however it is the same process for "Latest Full (Built)".
If you select this option, MDOQ will only use the latest built version. (If a built version doesn't exist it will import a backup, which will then be built and used in future)
This means that new MySQL backups will not be used without manual intervention.
- The underlying backup for MySQL will remain the same.
- Any new backups of any size will not impact instance creation time.
- Manual intervention is necessary to build the latest backup so that it can be used.
Building a MySQL backup
This sounds more complicated then it is.
- (optional) Take a new backup of the correct type. If you already have a new backup in MDOQ you can skip this step. A guide on creating backups can be found here.
- Create a new instance or use an existing instance. (Any changes in the DB for this will be lost).
- On the chosen instance navigate to "Settings" > "MySQL"
- Change the "Backup" option from "Latest (Built)" to "Latest" of the same type. (e.g "Latest Sanitized (Built)" => "Latest Sanitized")
You will need to uncheck the "use live" checkbox, before you can change the option.
- Save the changed settings and close the dialog.
- Open the "Synchronize" dialog and select "MySQL".
- Click "Proceed"
The logs for the instance will show the progress of the synchronization.
Once complete, MDOQ will have a built version of the backup that can be used by future instances.
If you have a relatively small database (less than 100000 products), use "Latest Sanitized"
If you have a larger database, use "Latest Sanitized (built)". Regularly build the latest backup.