Locking instances for backup
As of MySQL 8, you can lock the instance for backup, which will allow the DML during online backup and block all the operations that could result in an inconsistent snapshot.
How to do it...
Before you begin your backup, lock the instance for backup:
mysql> LOCK INSTANCE FOR BACKUP;
Perform the backup, and after completion, unlock the instance:
mysql> UNLOCK INSTANCE;