What is the difference between the InnoDB and MyISAM storage engines, and why is InnoDB the default?
They are two different implementations sitting under the same SQL layer, and they differ in the guarantees they give you.
- Transactions. InnoDB is fully ACID and supports COMMIT and ROLLBACK. MyISAM has no transactions at all — a half-finished multi-statement change stays half-finished.
- Locking. InnoDB locks individual rows, so concurrent writers to different rows do not block each other. MyISAM locks the whole table on write, which collapses under concurrent traffic.
- Crash recovery. InnoDB replays its redo log and comes back consistent. MyISAM tables must be repaired after an unclean shutdown and can lose data.
- Foreign keys. Supported by InnoDB, silently ignored by MyISAM.
InnoDB became the default in MySQL 5.5 because durability and row-level concurrency matter for essentially every real application. MyISAM survives only in legacy schemas and in a few read-only cases where its smaller footprint and full-text history were useful — and even that argument disappeared once InnoDB gained full-text indexes.





