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:
- Transaction Rollback: If a transaction executes
ROLLBACKor encounters a failure, InnoDB reads the Undo Log to reverse all modifications. - 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!