{
  "id": 45337,
  "title": "What Happens If a Bank Transfer Fails Halfway? Understanding ACID Properties in SQL",
  "url": "https://urgent.news/2026/08/02/what-happens-if-a-bank-transfer-fails-halfway-understanding-acid",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-02T14:04:26.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/darshan_dev/what-happens-if-a-bank-transfer-fails-halfway-understanding-acid-properties-in-sql-1oe"
  },
  "original_language": "en",
  "account": "Bank transfers occasionally encounter failures when the process is interrupted. Imagine a scenario where ₹1,000 is deducted from Jeni's account but the transfer to Dravid's account is halted mid-operation. If the system crashes before the credit is applied, Jeni's balance remains at ₹9,000 while Dravid's stays at ₹5,000. This incomplete transaction represents a critical issue in banking systems.\n\nTo prevent such problems, databases utilize transactions and ACID properties. A transaction is a single logical unit of work that groups multiple database operations. In our example, two UPDATE statements would be part of a single transaction: one to deduct ₹1,000 from Jeni's account and another to add ₹1,000 to Dravid's balance.\n\nThe ACID properties ensure transactions behave reliably. Atomicity means all operations within a transaction are treated as one unit. Either all succeed or none take effect. For instance, if the transaction fails after deducting ₹1,000 from Jeni's balance but before crediting Dravid's, the transaction is rolled back, restoring both accounts to their original balances.\n\nConsistency ensures transactions maintain data integrity by moving the database from a valid state to another while adhering to defined rules. In our example, the total balance remains unchanged at ₹15,000 before and after the transfer, respecting consistency rules.\n\nIsolation prevents concurrent transactions from interfering with each other. Multiple users may perform operations simultaneously, so isolation controls how transactions interact with each other's changes. Durability guarantees that once a transaction is committed, its effects remain permanent, even in the event of a system failure.\n\nBy enforcing ACID properties, databases ensure reliable transactions, maintaining data integrity and preventing incomplete or inconsistent states when errors occur.",
  "summary": "In the scenario outlined in the report, a bank transfer of ₹1,000 from Jeni's account to Dravid's account is interrupted before the full operation can be completed. This results in a state where Jeni's account balance is ₹9,000 while Dravid's remains at ₹5,000. Had the transfer been completed successfully, Dravid's balance would have been ₹6,000. This situation presents a problem known as an \"inconsistent state,\" where the database is left in an unexpected condition due to a partial transaction. To prevent such issues, databases employ transactions and the ACID properties. Atomicity ensures that all operations within a transaction are completed fully or not at all, meaning that in our example, if the transfer fails halfway, the database must roll back the operation and revert Jeni's balance to ₹10,000, thus maintaining the integrity of the data. Consistency ensures that a transaction brings the database from one valid state to another, maintaining all predefined rules and constraints. Isolation guarantees that transactions are isolated from each other, preventing concurrent transactions from interfering with each other's data. Finally, Durability ensures that once a transaction has been committed, it will remain so, even in the face of subsequent system failures. These ACID properties collectively ensure that transactions are reliable and that the database remains consistent and accurate, even in the face of failures.",
  "key_points": [
    "Bank transfers may fail if interrupted mid-operation, causing incomplete transactions.",
    "ACID properties (Atomicity, Consistency, Isolation, Durability) ensure reliable transactions.",
    "ACID properties maintain data integrity and prevent inconsistent states during errors."
  ],
  "editors_take": null,
  "illustration": "https://urgent.news/ill/45337.png",
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}