- If i will lock my tables while taking dump of production and at the same time if user will enter any data for specific table. What will happen to that specific insertion ? Will it be discarded or it will be inserted after successful creation of dump ?
If i will not lock my tables while taking dump of production. Will it create any problem ?
Which one is preferred way to taking dump of production with or without locking tables ?
| |||
|
feedback
|
The MySQL docs describe most of these options in greater detail: | |||||||
feedback
|
|
It's best to take a backup off of a read-only replica, as when you lock the tables, any writes will error out. Also, a backup can be a pretty resource intensive operation, so it can effect performance. If you do not have a read-only replica, then I would suggest looking into one of the MySQL hot backup products out there (Percona has a good one, as I recall). Also - if you do not lock the tables, or use a hot backup product, you run the risk of not getting a complete backup. IE, if someone is writing to a table, and has it locked when you run the backup, you'll get corrupted data. | |||
|
feedback
|