Imagine buying the last pair of sneakers in a flash sale. The inventory must decrease and an order must be created together—not leave one without the other. A database transaction treats that work as a single unit. section 8.2.1
ACID describes the guarantees behind that unit of work:
- Atomicity: All steps succeed together, or the database rolls them back. A payment timeout should not leave the sneaker deducted without an order. section 8.2.1
- Consistency: A transaction moves the database between valid states. An inventory constraint can reject a purchase that would bring stock below zero. section 8.2.1
- Isolation: Transactions do not interfere with one another. In the sale example, another reader sees the inventory before or after the purchase, not its half-finished calculation. section 8.2.1
- Durability: Once committed, a transaction is permanent, even if power fails immediately afterward. section 8.2.1
Durability is not a backup. It protects committed data from failures such as a power interruption; it does not undo an accidental deletion. section 8.2.1




















