An e-commerce application processes customer orders. When an order is placed, the system must decrement the inventory count and process the payment. The application ensures that either both operations complete successfully or both are rolled back if any error occurs. Which database property does this guarantee?
Trap 1: Consistency
Consistency ensures that a transaction brings the database from one valid state to another, maintaining data integrity rules. It does not directly guarantee the all-or-nothing execution of operations.
Trap 2: Isolation
Isolation ensures that concurrent transactions do not interfere with each other. It addresses visibility of intermediate transaction states, not the atomicity of operations within a single transaction.
Trap 3: Durability
Durability guarantees that once a transaction is committed, its changes persist even in the event of a system failure. It does not relate to the all-or-nothing execution of a transaction.
- A
Atomicity
Atomicity ensures that a transaction is an all-or-nothing operation. If any part of the transaction fails, the entire transaction is rolled back, preventing partial updates.
- B
Consistency
Why wrong: Consistency ensures that a transaction brings the database from one valid state to another, maintaining data integrity rules. It does not directly guarantee the all-or-nothing execution of operations.
- C
Isolation
Why wrong: Isolation ensures that concurrent transactions do not interfere with each other. It addresses visibility of intermediate transaction states, not the atomicity of operations within a single transaction.
- D
Durability
Why wrong: Durability guarantees that once a transaction is committed, its changes persist even in the event of a system failure. It does not relate to the all-or-nothing execution of a transaction.