What are MySQL Storage Engines?

A storage engine is the part of MySQL that decides how a table stores, reads and locks its data. You can choose an engine for each table.

EngineFeaturesUse
InnoDB (default)Transactions, foreign keys, row locking, crash recoveryAlmost everything
MyISAMFast reads, table locking, no transactions or foreign keys. OldRare, old systems
MEMORYKeeps data in RAM. Lost on restartTemporary fast tables
CSVStores data in CSV filesData exchange
ARCHIVECompressed, only INSERT and SELECTLogs
CREATE TABLE logs (
  id INT PRIMARY KEY,
  message TEXT
) ENGINE = InnoDB;

SHOW ENGINES;                       -- list of engines
SHOW TABLE STATUS WHERE Name = 'logs';   -- engine of a table

Use InnoDB unless you have a special reason. It is needed for transactions and foreign keys.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.