Share
Embed
Principal of ACID with financial system
I explained the ACID properties using examples from financial systems.
Atsushi Hatakeyama
December 05, 2024
Transcript
17 slides
-
Principle of ACID Produced By Atsushi Hatakeyama Date 2024/12/2 with
financial system -
Name : Atsu (Atsushi Hatakeyama) Role : Software Engineer Tech
Stack : Next.js, Remix, Python etc.. Food : bánh mì Who am I? -
Name : Atsu (Atsushi Hatakeyama) Role : Software Engineer Tech
Stack : Next.js, Remix, Python etc.. Food : bánh mì Who am I? -
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). -
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 -
What is Transaction? 1 Commit Commits the current transaction, making
its changes permanent. 2 Rollback Rolls back the current transaction, canceling its changes. -
Example of Transaction Start Transaction Treat as one logical unit
Making its changes permanent. Canceling its changes. -
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: -
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 -
Atomicity The statement is carried out entirely or not performed
at all (All or nothing). All (success) Nothing (Fail) -
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... -
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) -
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) -
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. -
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