What is the difference between the InnoDB and MyISAM storage engines?

IntermediateConceptMySQL
Answer

Short answer

InnoDB is MySQL's default engine since 5.5: it supports transactions, row-level locking, foreign keys and crash recovery. MyISAM is the old engine: no transactions, table-level locks, no foreign keys and it can be corrupted by a crash. Today you should use InnoDB for everything.

Comparison

Feature InnoDB MyISAM
Transactions (ACID) ✅ ❌
Locking Row-level Whole table
Foreign keys ✅ ❌
Crash recovery Automatic (redo log) Often needs REPAIR TABLE
Consistent backups with --single-transaction ✅ ❌ (needs locks)
Supported by RDS/Aurora features ✅ Limited

Check and convert

SELECT table_name, engine FROM information_schema.tables WHERE table_schema = 'shop';
ALTER TABLE legacy_logs ENGINE = InnoDB;

What to say in the interview

"InnoDB is transactional with row-level locking, foreign keys and crash recovery; MyISAM uses table locks and has no transactions. I'd convert any MyISAM tables to InnoDB, also because consistent online backups and replication depend on it."

All Databases (MySQL, PostgreSQL, MongoDB) questions Roadmap: MySQL basics

More on MySQL