2

We have two MySQL tables, one is InnoDB and the other is MyISAM. If I execute a chunk of inserts in a single transaction on both tables and the power fails in the middle, what will be the status?

What will happen to the newly inserted data on the InnoDB and MyISAM tables?

1

Innodb is a transactional database, it stores database changes in the transaction log files, using checksumming validation, it either commits or rolls back transactions on next restart after a crash or power outage.

MyISAM doesn't have a transactional system to roll back unsuccessful transaction commits. So database corruption becomes a major issue in flakey servers with flakey power.

If data integrity and avoiding lock contention (innodb row locks vs myisam table locks) are a must, you go with Innodb.

1

My understanding (I'm not sure) is:

  • InnoDB will rollback the transaction completely.
  • MyISAM will retain whatever data was inserted just up to the point of the power failure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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