官术网_书友最值得收藏!

ACID properties

In a relational database, a single logical operation is called a transaction. The technical translation of a transaction is a set of database operations, which are createread, update, and delete (CRUD). An example of explaining a transaction is a budget assignment to several projects in the company assuming we have a fixed amount of money. If we increase a certain project budget, we need to deduct this amount of increase from another project. The ACID properties in this context could be described as follows:

  • Atomicity: All or nothing, which means that if a part of a transaction fails, then the transaction fails as a whole.
  • Consistency: Any transaction gets the database from one valid state to another valid state. Database consistency is governed normally by data constraints and the relation between data and any combination thereof. For example, imagine if someone would like to completely purge his account on a shopping service. In order to purge his account, his account details, such as a list of addresses, will also need to be purged. This is governed by foreign key constraints, which will be explained in detail in the coming chapter.
  • Isolation: Concurrent execution of transactions results in a system state that would be obtained if the transactions were executed serially.
  • Durability: The transactions that are committed—that is, executed successfully—are persistent even with power loss or some server crashes. In PostgreSQL, this is done normally by a technique called Write-Ahead Logging (WAL). Another database refers to this as a transaction log such as in Oracle.
主站蜘蛛池模板: 西青区| 建湖县| 和平县| 卢湾区| 陈巴尔虎旗| 荆州市| 铁力市| 车致| 岚皋县| 庄河市| 中江县| 镶黄旗| 剑川县| 海宁市| 云南省| 海宁市| 金溪县| 息烽县| 呼和浩特市| 丽江市| 迁安市| 盱眙县| 武夷山市| 江陵县| 大港区| 定边县| 犍为县| 东乡族自治县| 石门县| 石河子市| 天镇县| 榆树市| 齐河县| 开化县| 福建省| 安乡县| 旅游| 乌苏市| 城市| 沙田区| 苏尼特左旗|