Print · ACID
Back to study12 cards · 2 sheets · 4 pages.
Print double-sided, flipping on the long edge, at 100% scale with no margins added by the browser. Answer columns are already mirrored, so each answer lands on the back of its own question. Cut along the dashed lines. The last sheet has 4 blank cells, since this deck is not a multiple of eight.
Preview
What does ACID stand for?
Define atomicity.
Define consistency (in ACID terms).
Define isolation.
Define durability.
Name the four standard isolation levels, weakest to strongest.
What is a dirty read?
Non-repeatable read vs phantom read?
All or nothing: a transaction either fully completes or fully rolls back. No partial effects are ever visible. It's about failure handling, not concurrency.
Atomicity, Consistency, Isolation, Durability — the four guarantees a database makes about transactions.
Concurrent transactions don't interfere with each other. The result is as if they had run one at a time (serially).
Every transaction moves the database from one valid state to another — constraints and invariants (foreign keys, uniqueness, business rules) always hold.
Read uncommitted, read committed, repeatable read, serializable. Postgres defaults to read committed; MySQL InnoDB to repeatable read.
Once committed, data survives crashes and power loss — via write-ahead logging, fsync to disk, and (in distributed databases) replication.
Non-repeatable: a row you already read changes between two reads. Phantom: new rows matching your query appear between two reads.
Reading another transaction's uncommitted changes, which may later roll back. Prevented by read committed and above.
How do databases implement atomicity and durability?
What is MVCC?
What is BASE and how does it contrast with ACID?
Which ACID property is the 'odd one out' and why?
Multi-version concurrency control: writers create new row versions instead of overwriting; each transaction reads a consistent snapshot. Readers never block writers.
The write-ahead log (WAL): changes are appended to a sequential log and fsynced before commit. Crash recovery replays the log — redo committed, undo uncommitted.
Consistency. A, I, and D are pure database mechanisms; C is a joint responsibility — the application defines what 'valid' means, the database only enforces declared constraints.
Basically Available, Soft state, Eventually consistent — the availability-first model of AP systems, trading strict guarantees for uptime and scale.