How do ACID and database transactions work?

前端 未结 8 629
迷失自我
迷失自我 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: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.

提交回复
热议问题