What is a database transaction?


 
A transaction is a way of representing a state change. Transactions ideally have four properties, commonly known as ACID:

  • Atomic (if the change is committed, it happens in one fell swoop; you can never see “half a change”)
  • Consistent (the change can only happen if the new state of the system will be valid; any attempt to commit an invalid change will fail, leaving the system in its previous valid state)
  • Isolated (no-one else sees any part of the transaction until it’s committed)
  • Durable (once the change has happened – if the system says the transaction has been committed, the client doesn’t need to worry about “flushing” the system to make the change “stick”)

See the Wikipedia ACID entry for more details.

Although this is typically applied to databases, it doesn’t have to be. (In particular, see Software Transactional Memory.)

原创文章,作者:sunnyman218,如若转载,请注明出处:https://blog.ytso.com/274088.html

(0)
上一篇 2022年7月13日
下一篇 2022年7月13日

相关推荐

发表回复

登录后才能评论