MyDUMPER : Faster logical backups and restores
Transcript of MyDUMPER : Faster logical backups and restores
![Page 1: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/1.jpg)
Faster Logical Backup and Restores Using mydumpe
r
By
MySQL ConsultingTeam
![Page 2: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/2.jpg)
About MyDBOPS
•MySQL Consulting. •MySQL Support.•Remote DBA Service.•Expert MySQL Solutions•MariaDB, Percona, Galera, TokuDB are supported too.
![Page 3: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/3.jpg)
Agenda
• Logical Backups
• Backup Tools available
• Drawbacks
• Mydumper
• Myloader
![Page 4: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/4.jpg)
Logical backups
• Plain text files - SQL Statements
• Can be remote
• Can be restored on different versions
• Sometimes is the only option
• Partial backup and restores
• Feed ETL processes
![Page 5: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/5.jpg)
Backup Tools
mysqldump
• Native MySQL Client Program
• Can be piped to mysql client
• One Big Output File
• Lack of features for modern day problems
![Page 6: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/6.jpg)
Drawbacks
• Single Threaded
• Lack of native compression
• Not possible to chunk the output file
• Consistent Online backup
![Page 7: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/7.jpg)
mydumper
Maintained by Percona Currently
Launchpad Project
https://launchpad.net/mydumper
Release Notes
http://tinyurl.com/mydumper-091
![Page 8: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/8.jpg)
mydumper - features
• Faster as is multithread
• Different files per table
• One row per line
• Can able to chunk based on rows, size
• Support to MariDB multi source replication
• TokuDB transactional support
![Page 9: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/9.jpg)
mydumper - important options
• --threads
• --outputdir
• --rows, --chunk-filesize
• --compress
• --less-locking
• --kill-long-queries
![Page 10: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/10.jpg)
mydumper - selective backups
• -B, --database
• -T, --tables-list
• -B db1
• -B db1 -T t1,t2
• -T db1.t1,db2.t1
• --regex=‘^((db1.|db2.))’
![Page 11: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/11.jpg)
mydumper - improving times
--rows• Chunk tables by rows• Only works with INT fields indexes
--file-size-chunks• Chunk tables by data size• 1 dump thread but different files allowing parallel
restore• works with any table
![Page 12: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/12.jpg)
mydumper - improving times
![Page 13: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/13.jpg)
mydumper - improving times
![Page 14: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/14.jpg)
Myloader
• Helps in restoring the backup for mydumper.
Restore
myloader -h x.x.x.x -d /backup/dir -o
![Page 15: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/15.jpg)
Examples
• Full backup
mydumper -h x.x.x.x -–less-locking –-compress
-o /backup/dir
• Restore
myloader -h x.x.x.x -d /backup/dir -o
![Page 16: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/16.jpg)
Examples
• Partial restore (version >= 0.9)
myloader -h x.x.x.x -d /backup/dir/restore/ -o
-B db
• Partial restore diff DB name (version >= 0.9)
myloader -h x.x.x.x -d /backup/dir/restore/ -o
-B db_new -s db
![Page 17: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/17.jpg)
DEMO
![Page 18: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/18.jpg)
How MyDBOPS can Help You ?
• MySQL Consulting
• MySQL Support
• Remote DBA services
• 24*7 MySQL Monitoring
Contact : [email protected]
![Page 19: MyDUMPER : Faster logical backups and restores](https://reader031.fdocuments.us/reader031/viewer/2022022202/588548f81a28abb5368b6571/html5/thumbnails/19.jpg)
Thank You