Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Principal of ACID with financial system

Principal of ACID with financial system

I explained the ACID properties using examples from financial systems.

Atsushi Hatakeyama

December 05, 2024
Tweet

Other Decks in Technology

Transcript

  1. Name : Atsu (Atsushi Hatakeyama) Role : Software Engineer Tech

    Stack : Next.js, Remix, Python etc.. Food : bánh mì Who am I?
  2. Name : Atsu (Atsushi Hatakeyama) Role : Software Engineer Tech

    Stack : Next.js, Remix, Python etc.. Food : bánh mì Who am I?
  3. What is Transaction? Transaction A transaction is a way for

    an application to group several reads and writes together into a logical unit (Martin Kleppmann, 2017).
  4. What is Transaction? Transaction A transaction is a way for

    an application to group several reads and writes together into a logical unit (Martin Kleppmann, 2017). Mechanism to maintain data consistency
  5. What is Transaction? 1 Commit Commits the current transaction, making

    its changes permanent. 2 Rollback Rolls back the current transaction, canceling its changes.
  6. Example of Transaction Start Transaction Treat as one logical unit

    Making its changes permanent. Canceling its changes.
  7. What is ACID? Atomicity The statement is carried out entirely

    or not performed at all (All or nothing). Consistency Corruption or errors in your data do not create unintended consequences for the integrity of your table. Isolation Ensures that the concurrent transactions don't interfere with or affect one another. Durability Guarantees that data changes from committed transactions persist, even after system failures. ACID is an acronym that refers to the set of 4 key properties that define a transaction:
  8. Atomicity The statement is carried out entirely or not performed

    at all (All or nothing). FB Send process succesD 4B Recieve process fail Inconsistent data
  9. Atomicity The statement is carried out entirely or not performed

    at all (All or nothing). All (success) Nothing (Fail)
  10. Consistency Corruption or errors in your data do not create

    unintended consequences for the integrity of your table. Consistency ensure that :R @ There is no change total amoutn compared to before the transaction3 @ Balance should not be negative value3 @ etc...
  11. Isolation Ensures that the concurrent transactions don't interfere with or

    affect one another. If two transactions can update the same data concurrently, data inconsistencies can occur. -> Can not withdrow more than $500 ($-200)
  12. Isolation Ensures that the concurrent transactions don't interfere with or

    affect one another. Await the completion of the transaction and then reference the committed data. -> Depends on isolation level. If two transactions can update the same data concurrently, data inconsistencies can occur. -> Can not withdrow more than $500 ($-200)
  13. Durability Guarantees that data changes from committed transactions persist, even

    after system failures. Data it has written will not be forgotten, even if there is a hardware fault or the database crashes.
  14. Reference ACID Transactions https://www.databricks.com/glossary/acid-transactions Designing Data-Intensive Applications (DDIA)  https://dataintensive.net/ MySQL

    8.4 Reference Manual 15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements https://dev.mysql.com/doc/refman/8.4/en/commit.html