Databases & Transactions interview question · Most asked
What does ACID mean?
Summary
ACID describes transaction guarantees: Atomicity (all or nothing), Consistency (constraints hold before and after), Isolation (concurrent transactions don't see each other's partial work, to a configured degree), and Durability (committed data survives crashes).
Longer Answer
Atomicity is implemented with undo/redo logs, durability with write-ahead logs (WAL) flushed to disk, isolation with locks and/or MVCC snapshots. Consistency also depends on your schema constraints and application logic. Many NoSQL systems relax some of these properties for scale (BASE: basically available, soft state, eventual consistency).
Key Points
- Atomicity: all or nothing
- Consistency: constraints hold
- Isolation: levels control anomalies
- Durability: WAL on disk
- BASE as the relaxed alternative
More most-asked Databases & Transactions questions
- Explain transaction isolation levels and the anomalies they prevent.
- How do database indexes work and when do they help or hurt?
- What is the N+1 query problem and how do you fix it?
- How do you choose between SQL and NoSQL databases?
- What is connection pooling and how do you size a pool?
- How do you run schema migrations without downtime?
- How do you keep data consistent across services without distributed transactions?