What does ACID mean in the context of transactions?
Assesses fundamental understanding of DBMS conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
ACID describes the guarantees of a transaction, a unit of work that either completes fully or not at all.
- Atomicity: all statements commit or all roll back. Implemented with logging and undo.
- Consistency: the database moves from one valid state to another, respecting constraints, keys and invariants.
- Isolation: concurrent transactions do not observe each other's uncommitted intermediate states; the degree is set by the isolation level.
- Durability: once committed, changes survive a crash, usually by writing to a write-ahead log and fsyncing before acknowledging.
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT; -- or ROLLBACK
The transfer is atomic and consistent, and isolation prevents another transaction from seeing only the debit. Durability is often relaxed slightly for performance, and distributed systems extend the idea with two-phase commit or consensus protocols.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.