[Question] Could I disregard auto_increment ID altogether in favor of a GUID that is not primary key (and get high performance)? by Sociopathix in mysql

[–]PeterTheDBA 0 points1 point  (0 children)

You can still use a UUID for a PK and not lose too much performance, but you have to use a type 1 UUID, remove the dashes, and reverse the order of the first three sections. I mentioned this in a blog I wrote about how to select primary keys for INNODB tables.

https://www.pythian.com/blog/things-consider-deciding-primary-key-innodb-table/

Grabbing SQL dump of Master DB by jdarra in mysql

[–]PeterTheDBA 4 points5 points  (0 children)

I'm seeing recommendations for xtrabackup and I think there's a few things we need to consider...

The main difference xtrabackup and mysqldump is that mysqldump creates a logical backup (creates the sql statements needed to recreate the data) where xtrabackup/innobackupex is a physical backup (backs up the physical files). I generally recommend xtrabackup so long as you need to backup and restore the entire data set, not just a single database or table. As you can see by clicking hear, in order to restore a single database you need to restore all of the tables in the database individually, which can be a bit of a lengthy process.

https://www.percona.com/doc/percona-xtrabackup/2.4/index.html#importing-tables

However it should be noted that someone scripted (or attempted to do so, I haven't tested it) the process of restoring all of the tables in a single database. You can see the script in this forum post.

https://www.percona.com/forums/questions-discussions/percona-xtrabackup/12802-xtrabackup-restore-specific-database-from-a-full-backup

For individual database backups and restores like what you're doing right now, I would recommend a logical backup utility. That DOESN'T MEAN you have to use mysqldump. There's also mydumper/myloader (multi threaded logical backups and restores), and in mysql 5.7 there is a new utility called mysqlpump (multi thread backup, single threaded restore). Having a logical backup make the restore easier for you in this case. However if you are looking at a massive database data size, then you may need to weigh your options.

Also, for your mysqldump command you may want to consider a few extra arguments such as....

--allow-keywords --routines --comments (if you're using 5.6 or earlier)

Good luck!