tezvyn:

The ACID properties of transactions

AI-drafted, machine-checkedSource: interviewbeginner
WHAT IT TESTS

foundational transaction guarantees.

OUTLINE

define Atomicity, Consistency, Isolation, Durability and why each matters.

RED FLAG

confusing Consistency with Isolation or thinking durability means in-memory only.

WHAT THIS TESTS The interviewer checks foundational knowledge of the guarantees that make transactional databases reliable, and whether you can distinguish properties that are easy to conflate.

A GOOD ANSWER COVERS Atomicity means a transaction is all-or-nothing: every operation commits together or the whole transaction rolls back, so a half-applied money transfer can never persist. Consistency means a transaction takes the database from one valid state to another, respecting all constraints, triggers, and rules; it never leaves declared invariants violated. Isolation means concurrent transactions are kept from interfering, so the result is as if they ran in some serial order, with isolation levels tuning how strictly. Durability means once a transaction commits, its effects survive crashes and power loss, typically guaranteed by flushing a write-ahead log to stable storage before acknowledging the commit.

COMMON WRONG ANSWERS Confusing Consistency with Isolation; Consistency is about constraint validity, Isolation is about concurrent visibility. Thinking Durability is met by holding data in memory; it requires persistence to non-volatile storage. Believing ACID means transactions run strictly one at a time, when isolation levels deliberately allow controlled concurrency.

LIKELY FOLLOW-UPS How does a write-ahead log provide Atomicity and Durability? What anomalies do weaker isolation levels permit? How does the CAP theorem relate to distributed ACID?

ONE CONCRETE EXAMPLE Transferring money debits one account and credits another. Atomicity ensures both happen or neither does, so money is never lost mid-transfer. Durability ensures that once the transfer is acknowledged, a server crash a millisecond later cannot undo it, because the change was already written to the durable log.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.