What is the difference between MyISAM and InnoDB?
Why Interviewers Ask This
Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid MySQL / SQL basics — a prerequisite for any developer role.
Answer
MySQL supports multiple storage engines. InnoDB and MyISAM were historically the two main choices. InnoDB (default since MySQL 5.5): supports ACID transactions (COMMIT/ROLLBACK); row-level locking (fine-grained, high concurrency); foreign key constraints and referential integrity; crash recovery via redo logs; MVCC for non-locking reads; better performance for mixed read/write workloads. MyISAM (legacy): no transaction support; table-level locking (one write locks the whole table — poor concurrency); no foreign keys; faster for read-heavy workloads without writes; supports FULLTEXT indexing (InnoDB added FULLTEXT in MySQL 5.6+); table data is stored more simply (can be faster to count rows as it stores the count). Verdict: Always use InnoDB for new applications. The only remaining use cases for MyISAM are legacy systems or extremely specific read-only analytical workloads. MySQL 8.0 still supports MyISAM but it is essentially deprecated for new development. For analytics, consider columnar engines like ClickHouse or MySQL's NDB Cluster for specialized workloads.
Pro Tip
Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a MySQL / SQL codebase.
Previous
What are transaction isolation levels in MySQL?
Next
What is the AUTO_INCREMENT attribute in MySQL?