veda.ng
Back to Glossary

ACID Properties

ACID properties are the four guarantees that define reliable database transactions: Atomicity, Consistency, Isolation, and Durability. Together, they ensure data integrity even when systems fail or multiple operations happen concurrently. Atomicity guarantees that a transaction either completes entirely or has no effect at all, transferring money from account A to B either decrements A AND increments B, or neither happens. Partial completion is impossible. Consistency ensures that transactions move the database from one valid state to another, maintaining all defined constraints and rules. Isolation means concurrent transactions don't interfere with each other; each transaction sees the database as if it were the only one executing, even when thousands run simultaneously. Durability guarantees that once a transaction commits, its effects survive any subsequent failures, power outages, crashes, hardware failures. Implementing ACID requires careful engineering. Write-ahead logging records intentions before execution, enabling recovery. Locking mechanisms prevent conflicting concurrent access. These mechanisms impose performance costs: ACID-compliant databases sacrifice raw throughput for reliability guarantees. The CAP theorem formalizes the fundamental tradeoff: distributed systems can't simultaneously guarantee consistency, availability, and partition tolerance. NoSQL databases often relax ACID, particularly isolation and consistency, for better performance and scalability (BASE: Basically Available, Soft state, Eventually consistent). Choosing between ACID and BASE depends on whether your application can tolerate temporary inconsistencies or requires strict correctness.