mydumper : faster logical backups and restores

19
Faster Logical Backup and Restores Using mydumper By MySQL Consulting Team

Upload: mydbops

Post on 23-Jan-2017

579 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: MyDUMPER : Faster logical backups and restores

Faster Logical Backup and Restores Using mydumpe

r

By

MySQL ConsultingTeam

Page 2: MyDUMPER : Faster logical backups and restores

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

Agenda

• Logical Backups

• Backup Tools available

• Drawbacks

• Mydumper

• Myloader

Page 4: MyDUMPER : Faster logical backups and restores

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

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

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

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

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

mydumper - important options

• --threads

• --outputdir

• --rows, --chunk-filesize

• --compress

• --less-locking

• --kill-long-queries

Page 10: MyDUMPER : Faster logical backups and restores

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

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

mydumper - improving times

Page 13: MyDUMPER : Faster logical backups and restores

mydumper - improving times

Page 14: MyDUMPER : Faster logical backups and restores

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

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

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

DEMO

Page 18: MyDUMPER : Faster logical backups and restores

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

Thank You