ACID is one of the main concepts or compliance to handle transactions in relational database systems (RDBMS). Full form of the ACID acronym is :
Here you will know about these concepts in detail:
Each Database transaction must completely succeed or failure/rolled back.
This concept state that partially success not allowed. Each transaction should completely successful or failed. Suppose your transactions have multiple steps (either read or write ) to perform operations in the database then if one operation gets failed then your database will return in the same state it was before starting the transactions.
A transaction can not leave the database in an inconsistent state.
This concept state that if your data is replicated across multiple nodes(copies of the database) then these nodes should have the same information.
One transaction can not interfere with Others.
This concept state that one client database transactions should not interfere with other client transactions. If one transaction is taking place for the same records then other transactions should wait.
Completed transactions should persist, even when servers restart etc.
This concept states that once your transaction got completed then this information should not be lost even system is powered off or restart. It should store in nonvolatile storage like the hard drive.
The best example of an ACID is transferring money from one account to another account. There may be two databases with different banks, so this transaction will perform withdrawal from one account while depositing on another account. If one of the steps got failed then return both database state to initial from where get started. The balance should be consistent on all nodes and if someone also performing some transaction at the same time that should be in the waiting state so that it keeps it isolated. If the transaction got completed it should durable by maintaining state in data.
In the case of ACID, other transactions must wait to complete the current transaction. This waiting causes the performance issue. In this case for maintaining consistency and improve performance, the solution is vertical scaling so that getting more get more powerful systems to process each transaction in less time and become available to process other requests.
One thought on “ACID Properties for Database Transactions”