Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

MySQL supports several storage engines. Compare InnoDB, MyISAM and MEMORY, and say why MyISAM is considered legacy today.

InnoDB is the default engine since MySQL 5.5 and supports transactions, row-level locking, MVCC, crash recovery and foreign keys. MyISAM has no transactions, locks whole tables and is not crash-safe, so tables can need repair after a crash; it survives only for legacy reasons, and even MySQL's own system tables moved to InnoDB in 8.0. MEMORY keeps data in RAM, loses it on restart and locks whole tables, and has mostly been replaced by InnoDB with a large buffer pool or by an external cache. Special engines such as ARCHIVE, CSV and MyRocks exist for niche needs, and MyISAM tables are moved with ALTER TABLE ... ENGINE=InnoDB after testing.

Why this question is asked

MySQL is unusual among databases because the part that stores data is pluggable: the SQL layer parses and plans queries, and a storage engine stores and retrieves the rows. For most of today's applications the engine question has one answer, InnoDB, but interviewers still ask it because older systems are full of MyISAM tables, and knowing why they are a risk is part of maintaining them. In this answer, we will recap the pluggable engine design, compare InnoDB, MyISAM and MEMORY, explain why MyISAM is legacy, mention the special-purpose engines, and see how to convert a MyISAM table.

1A Quick Recap of Pluggable Storage Engines

Every MySQL table belongs to a storage engine, named in its definition. The server layer handles connections, parsing, the optimizer and the binary log, and calls the engine through a common interface to read and write rows. That is why features like transactions, locking granularity and crash recovery differ per table: they belong to the engine, not to MySQL as a whole.

Java
SHOW ENGINES;
-- InnoDB DEFAULT Supports transactions, row-level locking, and foreign keys
-- MyISAM YES MyISAM storage engine
-- MEMORY YES Hash based, stored in memory, useful for temporary tables
-- CSV, ARCHIVE, BLACKHOLE, ... (varies by build)
SELECT table_schema, table_name, engine
FROM information_schema.tables
WHERE engine <> 'InnoDB'
AND table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys');
-- legacy audit_2014 MyISAM

The second query is the first thing to run on any inherited server: it lists every table that is not on InnoDB.

2Comparing InnoDB, MyISAM and MEMORY

InnoDB stores rows in a clustered index by primary key, keeps redo and undo logs, and supports ACID transactions, row-level locks so concurrent writers rarely block each other, MVCC so readers do not block writers, automatic crash recovery and foreign keys. It caches data and indexes in the buffer pool.

MyISAM stores data and indexes in separate files and caches only indexes, relying on the operating system for data. It has no transactions: each statement is applied immediately and ROLLBACK does nothing. It locks the whole table for every write, so a single slow UPDATE blocks every other writer and, by default, readers too. And it is not crash-safe: if the server dies during a write, the table can be left marked as crashed and needs REPAIR TABLE.

MEMORY keeps the whole table in RAM with hash indexes by default. It is fast for lookups, but the data disappears on restart, it uses table-level locks, and it has limits such as fixed-length rows.

Three engines side by side
FeatureInnoDBMyISAMMEMORY
Transactionsyesnono
Lockingrow-leveltable-leveltable-level
Crash recoveryautomatic, redo lognone, may need REPAIRdata lost on restart
Foreign keysyesnono
MVCC readsyesnono
Typical use todayeverythinglegacy onlyrare, small lookups

3Why MyISAM Is Considered Legacy

MyISAM was the default engine until MySQL 5.5, chosen then for its simplicity and speed on read-mostly workloads. Everything that once favoured it has since been matched or overtaken. InnoDB has supported FULLTEXT indexes since 5.6, its performance on modern hardware with a large buffer pool is better for almost every workload, and its crash safety means no nightly repairs. In MySQL 8.0, the data dictionary and system tables in the mysql schema moved to InnoDB as well, so the server itself no longer depends on MyISAM.

The risks of keeping MyISAM are concrete: data loss or corruption after crashes, no way to roll back a failed multi-step change, table locks that turn one slow query into an outage, and backups that need locks to be consistent. MyISAM is still included and works, but it receives little development, and no new table should use it.

4Other Engines for Special Cases

A few other engines exist for narrow needs. ARCHIVE stores rows compressed and supports only inserts and selects, which suits write-once logs, though compressed InnoDB tables or an external store are more common now. CSV stores a table as a comma-separated file, handy for exchanging data with other tools. BLACKHOLE accepts writes and stores nothing, which was used in some replication relay setups. Outside Oracle's MySQL, Percona Server and MariaDB ship MyRocks, an engine built on RocksDB with better compression and write efficiency for some write-heavy workloads. Internal temporary tables in MySQL 8.0 use the TempTable engine rather than MEMORY.

5Converting a MyISAM Table to InnoDB

The conversion itself is a single statement, which rebuilds the table by copying it, so a large table needs an online schema change tool or a quiet window. The work that matters is testing the behaviour that changes.

SQL
ALTER TABLE audit_2014 ENGINE=InnoDB;
-- Query OK, 12000000 rows affected (4 min 10 sec)
SELECT COUNT(*) FROM audit_2014;
-- MyISAM: instant, the row count is stored in the table
-- InnoDB: scans an index (MVCC means each transaction may see a different count)

Notice the COUNT(*) difference. MyISAM keeps an exact row count, so COUNT(*) without a WHERE clause is instant. InnoDB cannot, because concurrent transactions may each see a different number of rows, so it scans the smallest index, which on a large table can take seconds; screens that show a total may need a cached or approximate count. FULLTEXT search also behaves differently: InnoDB uses a different default stopword list and minimum token size (innodb_ft_min_token_size), so search results and ranking change. Other differences to check include MyISAM's per-group AUTO_INCREMENT on a secondary column of a composite key, which InnoDB does not support, and code that relied on table locks or ignored transactions.

6Follow-up questions

Why can a MyISAM table need repair after a crash?

Because MyISAM writes changes directly into its data and index files without a log to replay or undo. If the server dies in the middle of a write, the files can be inconsistent, and MySQL marks the table as crashed until REPAIR TABLE or myisamchk rebuilds the index from the data, which can take hours on big tables and may lose rows.

Is MEMORY a good choice for a cache table?

Rarely now. A normal InnoDB table whose data fits in the buffer pool is served from memory too, survives restarts and uses row-level locks. For a real cache shared by many application instances, Redis or a local cache such as Caffeine is usually better.

Can one query join InnoDB and MyISAM tables?

Yes, because joins happen in the server layer. But a transaction that writes to both cannot roll back the MyISAM part, which is a common source of inconsistent data in old systems.

7Conclusion

In this answer, we saw that MySQL's storage engines are pluggable and decide features per table. InnoDB, the default since 5.5, provides transactions, row-level locking, MVCC, crash recovery and foreign keys. MyISAM lacks transactions, locks whole tables and may need repair after a crash, and even MySQL's system tables left it in 8.0, so it is legacy. MEMORY loses data on restart and is mostly replaced by the buffer pool or an external cache. ARCHIVE, CSV and MyRocks cover special cases, and MyISAM tables move with ALTER TABLE ... ENGINE=InnoDB after testing count, full-text and locking behaviour.

What to say in the interviewAbout 90 seconds aloud

Open with

In MySQL the storage engine is chosen per table, and it decides transactions, locking and crash recovery. InnoDB has been the default since 5.5. It gives ACID transactions, row-level locking, MVCC so readers do not block writers, automatic crash recovery through the redo log, and foreign keys.

Then, if they want more

MyISAM has no transactions, so rollback does nothing, it locks the whole table for writes, and it is not crash-safe: after a crash a table can be marked crashed and need REPAIR TABLE.

Its old advantages are gone, since InnoDB has had full-text indexes since 5.6 and performs better on modern hardware, and in 8.0 even the system tables moved to InnoDB, so it is kept only for legacy tables.

MEMORY keeps data in RAM, loses it on restart and also uses table locks, so today we use InnoDB with a big buffer pool or a cache like Redis or Caffeine instead. There are niche engines too, such as ARCHIVE for compressed append-only data, CSV for exchange, and MyRocks in Percona Server and MariaDB.

To move a MyISAM table I run ALTER TABLE ENGINE=InnoDB, with an online tool for big tables, and test the behaviour changes: COUNT(*) is no longer instant, full-text stopwords and ranking differ, and code that relied on table locks or on rollbacks being ignored must be checked.

About this answer

Last updated
12 November 2026
Versions it names
MySQL 5.5, MySQL 8.0
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
MySQL reference manual
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "MySQL supports several storage engines. Compare InnoDB, MyISAM and MEMORY, and say why...": https://scrivio-interview-library.netlify.app/databases/mysql/7183b6a465/