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.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

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.
share|improve this answer

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.