ACID Properties In Databases

ACID Properties In Databases

ACID properties are fundamental properties in any database management system. These are the foundations on which databases are built. So let’s look at them & try to understand what these properties stand for.

Atomicity:- In a database, if you are performing transactions, then either the entire transaction succeeds, or fails entirely.

So consider the example that we want to deduct some amount from user1’s account & add the same amount to user2’s bank account. So if our transaction fails after deducting the amount from user1’s account, it will have an inconsistent state. So to avoid that all databases guarantee that our transactions will be atomic.

Consistency:- All the rules in the database will be enforced, or the entire transactions are rolled back.

So consider we have a rule in our database which stops us from having a negative balance in our account_balance column. So if there are transactions/updates which are trying to make the balance negative, they will be rolled back to ensure consistency in the system.

Isolation:- All transactions which are running parallel in the system will not interfere with one another.

In this case, consider an example where 2 people are trying to credit & debit some amount from the same account in the bank. In this case, the database will ensure that the transactions are linearly performed & the transactions do not interfere with one another.

Durability:- Once the transactions are performed & database is updated, the updates will stay whatever happens to the database, even if it crashes.

Durability ensures that no data is lost even if something wrong happens in the system. To ensure this DB’s must write to some kind of persistent storage & also need to create replicas to ensure the durability of the data.

So hope you would have got some idea about ACID properties in DBs. If you have any suggestions feel free to add them in the comments below. Do follow me on my YouTube channel where I am publishing a lot of great content.

Did you find this article valuable?

Support Abhijeet Gurle by becoming a sponsor. Any amount is appreciated!