2

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).

4
  • I didn't check. but i would guess both of them are much too optimized for performance to do any checksumming.
    – replay
    Feb 22, 2013 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, 2013 at 9:40
  • syncbean, so would you say bit-rotting is a non-issue at the application layer?
    – Ztyx
    Feb 22, 2013 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.
    – R. S.
    Feb 25, 2013 at 7:43

1 Answer 1

4

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.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .