ACID in Database System

reza andriyunanto
Nov 10 · 2 min read

As we know, knowledge about database is important for backend engineer, because our daily job desk is about handling data, one of the resource is database.
In database system, especially in sql, transaction is one thing that we must concern about it. That why ACID exists. ACID stands for Atomicity, Consistency, Isolation and Durability. ACID is set standard that guarantee database transaction and processed reliability. ACID tell us how behavior of transaction, so we can recovers from any failure that might occurs in transaction process.

Then, lets talk about each component of ACID.

Atomicity

Atomicity guarantee that transaction that happen is succeed or failed. If there any part of transaction that fail, so all the transaction will fail at all, and will be succeed if all the transaction process is succeed.

Consistency

Consistency guarantee that transaction keep the data consistent. All data will be valid according the rule like trigger and cascade.

Isolation

Isolation guarantee that one transaction will not affect to another transaction until the transaction committed. So each transaction will occurs in isolation.

Durability

Durability guarantee that the transaction that succeed, will remain in the system. Even any crash or something following the transaction. So if system said the transaction succeed, that means the transaction must be in fact succeed.


Then we know that ACID concept handle when any failure occurs. Kind of failure that might happen is like this sample

Transaction Failure

Transaction failure could happen when there any invalid input or the transaction violate the data consistency.

System Failure

System failure could happen when any bug on RDBMS system, operating system fault, or hardware issue.

Media Failure

Media failure could happen when there any fail when doing write/read from the media storage like hard disk. That caused by the media storage itself.

That is all about ACID and failure that might happen, so ACID will really important to understand.

reza andriyunanto
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade