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?

random
  • 450
  • 1
  • 9
  • 16
Ash
  • 21
  • 3

2 Answers2

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.

Fiasco Labs
  • 563
  • 4
  • 10
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.
random
  • 450
  • 1
  • 9
  • 16
sfas
  • 11
  • 1