ACID Compliance in Financial Applications
Fast recall
Quick revision
Core answer
Whether the candidate can apply ACID properties to a real-world domain and explain the specific consequences of violating each property in financial contexts
Giving abstract or generic answers without connecting to specific financial scenarios like double-spending, race conditions on balance updates, or lost payments due to crashes
Walk through a money transfer scenario and systematically explain what breaks if each ACID property is missing, using concrete examples like overdrafts or duplicate charges — showing you understand real-world impact
Interview-ready guide
Interview answer
Financial systems use ACID transactions where related database changes need one reliable outcome. Atomicity keeps a debit and credit together. Consistency means encoded rules—such as valid accounts, balanced ledger entries, and amount checks—still hold. Isolation, locks, versions, or conditional updates protect concurrent transfers from lost updates. Durability lets an acknowledged posting survive restart within the configured storage guarantee. That is not the whole payment design: an external processor cannot normally join the local transaction, so idempotency keys, durable events, reconciliation, and compensation are also needed. ACID supports financial integrity, but compliance additionally requires access controls, audit evidence, retention, monitoring, and operational procedures.
ACID Compliance in Financial Applications
Direct Answer
Financial ledger changes commonly need ACID transactions: related entries commit together, encoded invariants remain valid, concurrent updates are controlled, and acknowledged commits survive recovery. ACID is not the complete payment design; idempotency, reconciliation, audit evidence, access control, and recovery are also required when work crosses systems.
Code Example
BEGIN;
-- Lock both rows in a stable order to coordinate concurrent transfers.
SELECT id, balance
FROM accounts
WHERE id IN (10, 20)
ORDER BY id
FOR UPDATE;
UPDATE accounts
SET balance = balance - 100.00
WHERE id = 10 AND balance >= 100.00;
-- Application must verify that exactly one row was updated.
UPDATE accounts SET balance = balance + 100.00 WHERE id = 20;
INSERT INTO ledger_entries(transfer_id, account_id, amount)
VALUES ('tr-42', 10, -100.00), ('tr-42', 20, 100.00);
COMMIT;
The transaction groups local writes. A unique transfer_id supports idempotency, while locks and the conditional debit handle concurrency and insufficient funds.
Common Mistakes & Pitfalls
- Assuming ACID covers a remote charge: The database cannot roll back an external payment API; use idempotency and reconciliation.
- Calling ACID a compliance certificate: Regulations require broader controls, audit evidence, retention, and security.
- Ignoring concurrency details: Choose locks, isolation, conditional updates, or version checks and define how serialization failures are retried.
Check your understanding
Answer these without looking back at the article.
- What are the trade-offs between ACID and scalability in NoSQL databases?
- Can you have transactions across microservices?
- What is eventual consistency?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.