DEV Community

Sharmila devi
Sharmila devi

Posted on

Durability

When I build a wallet system, I want to make sure that once money is transferred, it should never be lost. This is called Durability.

What Durability Means
Once I COMMIT a transaction, it is permanently saved
Even if the system crashes, data will still be there
Example Transfer
BEGIN;
UPDATE accounts SET balance = balance - 200 WHERE name = 'Alice';
UPDATE accounts SET balance = balance + 200 WHERE name = 'Bob';
COMMIT;

After this:
Alice → ₹800
Bob → ₹700
After Crash / Restart

Even if the database restarts, when I check again:
SELECT * FROM accounts;
I still see the updated balance.
Data is safe

Simple Idea
If COMMIT happens → data is saved forever
If not → changes are not saved

Conclusion
Durability ensures:

No data loss
Data stays permanent

So I remember it like this:
Once committed, it will never be lost.

Top comments (0)