概念
- Atomicity
Main article: Atomicity (database systems)
Atomicity requires that database modifications must follow an "all or nothing" rule. Each transaction is said to be atomic. If one part of the transaction fails, the entire transaction fails and the database state is left unchanged. An atomic system must guarantee atomicity in each and every situation, including power failures, errors, and crashes. This guarantees that a transaction cannot be left in an incomplete state.
- Consistency
Main article: Consistency (database systems)
The consistency property ensures that any transaction will bring the database from one valid state to another. Any data written to the database must be valid according to all defined rules, including but not limited to constraints, cascades, triggers, and any combination thereof.
事务开始之前和之后,数据库的约束不能被破坏,即数据库要处于valid state。
- Isolation
Main article: Isolation (database systems)
Isolation refers to the requirement that no transaction should be able to interfere with another transaction. No transactions that affect the same rows can run concurrently, since their sequence, and hence the outcome, would be unpredictable. This property of ACID is often partly relaxed due to the huge speed decrease this type of concurrency management entails.[citation needed]
- Durability
Main article: Durability (database systems)
Durability means that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently. If the database crashes immediately thereafter, it should be possible to restore the database to the state after the last transaction committed.
参考
1. ACID的描述来自 http://en.wikipedia.org/wiki/ACID