DDIA Reading Notes - Chapter 7. Transactions

Feb 17, 2025

Transactions are needed because they provide a way to handle various system failures, errors, and concurrent operations by grouping multiple database operations into a single atomic unit that either completely succeeds or fails, simplifying error handling and maintaining data consistency.

The Meaning of ACID

A - Atomicity : Either all operations complete successfully or none of them take effect, with automatic rollback if any part fails.

C - Consistency: foreign key constraints or uniqueness constraints.

I - Isolation: Serializable. Concurrent transactions operate independently and cannot interfere with each other, ensuring data consistency as if the transactions were executed one after another sequentially, though they may actually run simultaneously

D - Durability: data can be stored without fear of losing it.

Weak Isolation Levels

  1. No Dirty Reads
  2. No Dirty Writes
  3. Snapshot Isolation and Repeatable Read
  4. No Lost updates
  5. No Write Skews
  6. No Phantoms Reads
  7. Serializability a. Actual Serial Execution b. Two Phase Locking (2PL) c. Serializable Sanpshot Isolation (SSI)
Jiayi Li