Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

Explain ACID properties with a bank transfer example.

FresherFundamentalsDatabase Fundamentals
Model answer

ACID transfer

PropertyMeaningFailure
AtomicityAll or nothingMoney vanishes
ConsistencyRules holdNegative balance
IsolationConcurrent txs safeDirty reads
DurabilitySurvives crashLost commit
sql
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;
Story beats acronym recitation.