Database ACID

Database Notes [1]: ACID Properties in DBMS

John Lu
2 min readApr 12, 2023
© imageBROKER / Alamy
  • A transaction is a single logical unit of work which accesses and possibly modifies the contents of a database.
  • Transactions access data using read and write operations.
  • In order to maintain consistency in a database, before and after the transaction, certain properties are followed.

Atomicity

The entire transaction takes place at once or doesn’t happen at all.

Each transaction is considered as one unit and either runs to completion or is not executed at all. Transactions do not occur partially.

It involves the following two operations.

  • Abort: If a transaction aborts, changes made to the database are not visible.
  • Commit: If a transaction commits, changes made are visible.

Consistency

The database must be consistent before and after the transaction.

It refers to the correctness of a database, which means that integrity constraints must be maintained.

Isolation

  • Multiple transactions occur independently without interference.
  • Any changes made in a transaction will remain invisible to other transactions until that transaction commits the particular change.
  • The isolation property guarantees that concurrent transactions result in a system state equivalent to executing the transactions sequentially in some order.

Durability

The changes of a successful transaction persist even if the system failure occurs.

These modifications to the database become permanent and the effects of the transaction should never lost.

Reference

--

--

John Lu
John Lu

Written by John Lu

AI Engineer. Innovative and results-driven. Adept at deploying cutting-edge models with high-performance apps. He transforms challenges into practical solutions

No responses yet