How do ACID and database transactions work?

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

    I slightly modified the printer example to make it more explainable

    1 document which had 2 pages content was sent to printer

    Transaction - document sent to printer

    • atomicity - printer prints 2 pages of a document or none
    • consistency - printer prints half page and the page gets stuck. The printer restarts itself and prints 2 pages with all content
    • isolation - while there were too many print outs in progress - printer prints the right content of the document
    • durability - while printing, there was a power cut- printer again prints documents without any errors

    Hope this helps someone to get the hang of the concept of ACID

提交回复
热议问题