MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
InnoDB Storage Engine Architecture: Buffer Pool, Redo Log, and Undo Log.
senior LevelMost AskedSystem DesignMySQL
In Simple Words: InnoDB is MySQL's default ACID storage engine:
- InnoDB Buffer Pool: RAM cache holding data and index pages in memory. Modified pages are marked as "dirty" and flushed to disk asynchronously.
- Redo Log (WAL): Circular disk buffer that records physical changes before modifying table files. If the server crashes, InnoDB replays the Redo Log during crash recovery to guarantee Durability (ACID).
- Undo Log: Stores historical copies of data rows before modification, enabling MVCC consistent non-blocking reads and transaction rollback.
- Doublewrite Buffer: Writes pages to a contiguous disk area before writing to final data files, preventing page corruption from partial OS writes during power failure.