In: Computer Science
Why is atomicity in database design important?
Atomicity It is one of the properties of ACID (Atomicity, Consistency, Isolation, Durability) in DBMS It is the property which treats the transaction as one atomic unit means Either transaction done(If all operation executed successfully) or failed (If any of one opreation is failed). so there is no option to left the transaction partially completed. Whaterver the operation done before the transaction and after it should be defined means whether it is executed or failed
Why is atomicity in database design important?
Atomicity in database design is important because it maintains the integrity,accuracy and completeness of whatever transaction is done on database it will be more clear my an example
Suppose Alice want to send 100 to Bob
Operation done on Alice account
1. Open Alice account
2. Old Balance = Balance
3. New balance = Old balance - 100
4. Balance = New balance
5. Close account
Operation done on Bob account
1. Open Bob account
2. Old Balance = Balance
3. New balance = Old balance + 100
4. Balance = New balance
5. Close Bob account
If any one of operation is failed the transaction must be failed as per atomicity says to maintain the integrity,completeness and accuracy.
Please hit the like button if you find this helpful for you THANK YOU AND HAPPY LEARNING:)