Durability means once a transaction is successfully committed, its changes are permanently saved in the database. Yes, even when the system crashes, power failure or any other and this relaiblity in transaction is possible in databases like postgresql by WAL( Write Ahead Logs) where Before making actual changes, they first record the transaction in a log file. This way even if the system crashes before executing, the queries can be retrieved to execute them
In case of Wallet systems
Once money is transferred and confirmed, it will always be reflected and there is No risk of losing completed transactions and records for the user
BEGIN;
UPDATE accounts
SET balance = balance - 100
WHERE name = 'Alice';
COMMIT;
Top comments (0)