How do ACID and database transactions work?

前端 未结 8 576
迷失自我
迷失自我 2020-11-29 14:31

What is the relationship between ACID and database transaction?

Does ACID give database transaction or is it the same thing?

Could someone enlighten this top

相关标签:
8条回答
  • 2020-11-29 15:27

    ACID properties are very old and important concept of database theory. I know that you can find lots of posts on this topic, but still I would like to start share answer on this because this is very important topic of RDBMS.

    Database System plays with lots of different types of transactions where all transaction has certain characteristic. This characteristic is known ACID Properties. ACID Properties take grantee for all database transactions to accomplish all tasks.

    Atomicity : Either commit all or nothing.

    Consistency : Make consistent record in terms of validate all rule and constraint of transaction.

    Isolation : Make sure that two transaction is unaware to each other.

    Durability : committed data stored forever. Reference taken from this article:

    0 讨论(0)
  • 2020-11-29 15:28

    ACID are desirable properties of any transaction processing engine.

    A DBMS is (if it is any good) a particular kind of transaction processing engine that exposes, usually to a very large extent but not quite entirely, those properties.

    But other engines exist that can also expose those properties. The kind of software that used to be called "TP monitors" being a case in point (nowadays' equivalent mostly being web servers).

    Such TP monitors can access resources other than a DBMS (e.g. a printer), and still guarantee ACID toward their users. As an example of what ACID might mean when a printer is involved in a transaction:

    • Atomicity: an entire document gets printed or nothing at all
    • Consistency: at end-of-transaction, the paper feed is positioned at top-of-page
    • Isolation: no two documents get mixed up while printing
    • Durability: the printer can guarantee that it was not "printing" with empty cartridges.
    0 讨论(0)
提交回复
热议问题