Part 2. How Is Data Updated Safely?
Part 1 showed how data is stored and managed in pages. Part 2 explains the mechanisms that keep modifications from being lost when pages are modified concurrently or the server terminates abnormally.
Chapter 4. What Is a Transaction?
- 4.1 What Is a Transaction
- 4.2 The Four Properties of an ACID Transaction
- 4.3 Commit, Rollback, Savepoint
- 4.4 Autocommit and Common Misunderstandings
- 4.5 The Danger of Long Transactions
- 4.6 DBMS Comparison
- 4.7 Options That Control How a Transaction Behaves
Chapter 5. WAL: Write the Log First
- 5.1 Power Loss During a Page Write
- 5.2 Log Records and the Log Buffer
- 5.3 The Rule of Writing the Log Before Data Pages
- 5.4 Redo and Undo
- 5.6 Differences by DBMS and a One-Line Summary
Chapter 6. Durability: fsync, Group Commit, Checkpoint
- 6.1 Storage Layers on the Write Path
- 6.2 fsync: Confirming Writes All the Way to Persistent Media
- 6.3 Group Commit: Many Commits with One fsync
- 6.4 Checkpoint: Writing Dirty Pages and the Recovery Starting Point
- 6.5 Restart Recovery
- 6.6 Differences by DBMS and What You Meet in Practice
Chapter 7. MVCC and Isolation Levels: Reading and Writing Concurrently
- 7.1 Problems That Arise When Reading and Writing Concurrently
- 7.2 Lock Basics
- 7.3 The Lock Family: S, U, X and Intent Locks
- 7.4 Lock Escalation: When Row Locks Become Table Locks
- 7.5 The Principle of MVCC: Showing Readers an Older Version
- 7.6 Locking Reads: FOR UPDATE, Optimistic and Pessimistic Locking
- 7.7 Where Old Versions Are Kept
- 7.8 Isolation Levels: When the Snapshot Is Taken
- 7.9 Cleaning Up Old Versions: Vacuum, Purge, and Long Transactions
- 7.10 Differences by DBMS and What You Meet in Practice