← Lessons

quiz vs the machine

Silver1050

Databases

The InnoDB Storage Engine

Why MySQL defaults to InnoDB and what its transactional design buys you.

4 min read · intro · beat Silver to climb

What a storage engine is

MySQL separates the SQL layer that parses and optimizes queries from the storage engine that actually stores rows and serves reads and writes. InnoDB has been the default engine since MySQL 5.5 and is the right choice for almost every workload.

What InnoDB gives you

  • ACID transactions with commit and rollback, backed by redo and undo logs.
  • Row level locking so two sessions writing different rows do not block each other.
  • Crash recovery that replays committed work after an unexpected shutdown.
  • Foreign keys for referential integrity, which the older MyISAM engine never supported.

How it stores data

InnoDB keeps table data and indexes in B plus tree structures on disk and caches hot pages in a memory area called the buffer pool. Rows live inside a primary key ordered tree, so the physical layout follows the primary key.

Older engines like MyISAM offered fast counts and table level locks but no transactions or crash safety, which is why InnoDB replaced them for general use.

Key idea

InnoDB is MySQL's default transactional engine, giving ACID transactions, row level locking, and crash recovery on top of B plus tree storage and an in memory buffer pool.

Check yourself

Answer to earn rating on the learn ladder.

1. Which feature does InnoDB provide that MyISAM does not?

2. What locking granularity does InnoDB use for writes?