Skip to content

ACID Properties

Database

Understand ACID: Atomicity, Consistency, Isolation, Durability.

Official Site
01

Overview

Atomicity: all or nothing. Consistency: valid state transitions. Isolation: concurrent transactions do not interfere. Durability: committed data survives crashes. Relational DBs provide ACID. NoSQL may relax (BASE).

bash
BEGIN;
  UPDATE accounts SET bal=bal-100 WHERE id=1;
  UPDATE accounts SET bal=bal+100 WHERE id=2;
COMMIT;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
02

Best Practices

Use transactions for multi-step operations. Choose isolation by consistency needs. WAL ensures durability. Use savepoints for partial rollback. In NoSQL understand consistency model. Use 2PC for distributed transactions.

Ready to try ACID Properties?

Visit the official site for the latest version and full documentation.

Visit ACID Properties