Skip to main content
InterviewHubPRO
Section Overview
Q14

Question 14 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

28%
MySQL & InnoDB (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What is the Undo Log and what are its two purposes?

senior LevelSystem Design

In Simple Words: The Undo Log stores the previous version of data before a row was modified:

  1. Transaction Rollback: If a transaction executes ROLLBACK or encounters a failure, InnoDB reads the Undo Log to reverse all modifications.
  2. Multi-Version Concurrency Control (MVCC): Allows concurrent read queries to read the historical snapshot of data as it existed when the read began, without acquiring locks!