Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Harddrive bit-rot does happen. Does MySQL go about making sure that bit-rot does not happen to my data stored in the database? Ie. does it make any row-level checksumming, or table-level checksumming? I guess it's not dealing with error correcting codes.

Let's stick to InnoDB and MyISAM for this answer (as they are the most common DB engines).

share|improve this question
    
I didn't check. but i would guess both of them are much too optimized for performance to do any checksumming. –  mauro.stettler Feb 22 '13 at 9:30
    
Your storage media does checksuming - so if you lost/flipped bits, MySQL is never going to see the data to test any checksum it adds. –  symcbean Feb 22 '13 at 9:40
    
syncbean, so would you say bit-rotting is a non-issue at the application layer? –  Ztyx Feb 22 '13 at 9:49
    
It entirely depends on your media. A single sata/ide hard drive doesn't do checksums, so a flipped bit wouldn't be detected. A raid-1 array would detect it, and a three disk raid-1 would be able to repair it. SSDs tend to do checksums to detect when pages start failing due to wear. –  kormoc Feb 25 '13 at 7:43

1 Answer 1

up vote 2 down vote accepted

Innodb checksums each data page and by default verifies that checksum each time the page is read from disk: http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_checksums

I'm not sure that myisam has internal checksumming, but there are a bunch of external utilities that can verify the integrity of myisam tables/data (myisamchk, etc).

Between the two, I think Innodb is a much better choice for data integrity if that is what you're looking for.

Hope that helps.

share|improve this answer
    
You also can use the innochecksum tool to verify any binary backups you make as well. Url: dev.mysql.com/doc/refman/5.0/en/innochecksum.html –  kormoc Feb 25 '13 at 7:40
    
This could also be useful: dev.mysql.com/doc/refman/5.6/en/… –  Ztyx Apr 10 '13 at 10:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.