
DURABILITY
For this task, I am trying to understand durability. That means once a transaction is committed, the data should not be lost even if the system crashes. First I check the current data in the table. Query select * from accounts; Here I can see Alice has 1000 and Bob has 500. Now I perform a money transfer from Alice to Bob. Query begin; update accounts set balance = balance - 200 where name = 'Alice'; update accounts set balance = balance + 200 where name = 'Bob'; commit; Here I started a transaction, deducted 200 from Alice and added 200 to Bob, and then committed it. After commit, the changes are saved permanently. Now I check the data again. Query select * from accounts; Now I can see Alice has 800 and Bob has 700. This confirms that the transaction is successful. Next step is to simulate a system crash or restart. In real scenario, this means database stops and starts again. After reconnecting, I again run the same select query. Query select * from accounts; I can still see Alice ha
Continue reading on Dev.to Tutorial
Opens in a new tab




