SteelReed

Search

Search posts, questions…

Transactions & LockingQuestion 1 / 17

Junior

What is ACID? How does a database guarantee atomicity and durability?

Short answer

ACID is four promises a transaction makes: all or nothing, always valid, no one sees half-done work, committed means never lost.

COMMIT: fsync logROLLBACK or crashUPDATE in a transactionUndo: old valueInnoDBRedo/WAL: new changeDurabledirty pages written laterUndo uncommittedchanges

3 points to say:

  1. The four letters: A, C, I, D.
  2. Durability comes from the WAL: log on disk before data.
  3. All-or-nothing comes from the undo log.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.