loading image
Back to glossary

ACID (Atomicity, Consistency, Isolation, Durability)

Properties ensuring transaction reliability in relational databases to maintain data integrity and consistency.

Updated on January 25, 2026

ACID is an acronym representing four fundamental properties that guarantee transaction reliability in database management systems. These properties - Atomicity, Consistency, Isolation, and Durability - ensure that data operations remain reliable even during failures, errors, or concurrent access. Developed in the 1980s, this model forms the cornerstone of modern relational database systems.

Fundamentals

  • Atomicity: a transaction executes completely or not at all (all-or-nothing principle)
  • Consistency: every transaction takes the database from one valid state to another valid state
  • Isolation: concurrent transactions execute as if they were sequential
  • Durability: once committed, a transaction persists even in case of system failure

Benefits

  • Data integrity guarantee critical for financial, medical, and commercial applications
  • Protection against data corruption during system failures or application errors
  • Transparent concurrency management enabling secure simultaneous access
  • Facilitated regulatory compliance for sectors requiring data audits
  • Simplified application development thanks to database-level guarantees

Practical Example

Consider the classic example of a bank transfer between two accounts. This operation perfectly illustrates the four ACID properties:

bank-transfer.sql
BEGIN TRANSACTION;

-- Debit source account
UPDATE accounts 
SET balance = balance - 500 
WHERE id = 'A123';

-- Credit destination account
UPDATE accounts 
SET balance = balance + 500 
WHERE id = 'B456';

-- Consistency check
IF (SELECT balance FROM accounts WHERE id = 'A123') >= 0 THEN
  COMMIT; -- Commit transaction
ELSE
  ROLLBACK; -- Cancel everything if negative balance
END IF;

In this example: Atomicity ensures both updates happen together or not at all; Consistency preserves business rules (non-negative balance); Isolation prevents other transactions from observing intermediate states; Durability guarantees the committed transfer will never be lost.

Implementation

  1. Identify operations requiring transactional guarantees (transfers, orders, critical updates)
  2. Explicitly delimit transactions with BEGIN/COMMIT/ROLLBACK in your code
  3. Define consistency constraints (foreign keys, CHECK constraints, triggers) at database level
  4. Choose appropriate isolation level based on your needs (READ COMMITTED, SERIALIZABLE, etc.)
  5. Implement robust error handling with automatic rollback on failure
  6. Test concurrency scenarios and failure behaviors
  7. Monitor performance and optimize transaction duration to minimize locks

Professional tip

ACID transactions have a performance cost. For high-volume systems, evaluate whether all your operations truly require these guarantees. Some data can tolerate eventual consistency (BASE), enabling horizontal scalability. Modern architecture often combines ACID databases for critical data with NoSQL databases for the rest.

  • PostgreSQL: open-source database with full ACID support and configurable isolation levels
  • MySQL/MariaDB (with InnoDB): widely used transactional storage engine
  • Oracle Database: enterprise solution with advanced ACID transaction optimizations
  • Microsoft SQL Server: ACID support with high-availability features
  • SQLite: embedded ACID database for local applications
  • Transaction managers: like Spring @Transactional for managing application transactions

ACID properties represent a reliability investment that directly translates to user trust and reduced business risk. In sectors where data accuracy is non-negotiable - finance, healthcare, e-commerce - these guarantees constitute a major competitive advantage. While modern distributed architectures explore alternative models, ACID remains the reference standard for critical data requiring absolute integrity.

Themoneyisalreadyonthetable.

In 1 hour, discover exactly how much you're losing and how to recover it.

Web development, automation & AI agency

contact@peaklab.fr
Newsletter

Get our tech and business tips delivered straight to your inbox.

Follow us

© PeakLab 2025