Back (Current repo: scraps)

random scraps and notes that are useful to me
To clone this repository:
git clone https://git.viktor1993.net/scraps.git
Log | Download | Files | Refs

innodb_vs_myisam.txt (850B)


Q: What’s the difference between the InnoDB and MyISAM storage engines in MariaDB, and why might you choose one over the other?

A: One of the most noticeable difference is that InnoDB uses row locking, whereas MyISAM uses table locking. Under InnoDB, it is possible to modify different rows of a table at the same time, making it much more suitable for high frequency writes/deletes. Under MyISAM, any DML statement will obtain an exclusive lock on the table, and while that lock is held, no other session can perform a SELECT or a DML operation on it.

MyISAM does not support transactions, so unlike InnoDB, there's no COMMIT and ROLLBACK mechanism. Once a statement is issued, it's done.

Because of these differences, InnoDB is now the default engine in MariaDB/MySQL. MyISAM's main use case is only for read-heavy, low-concurrency workloads.