SyntaxStudy
Sign Up
MySQL Beginner 4 min read

ACID Properties

ACID

ACID stands for Atomicity (all or nothing), Consistency (rules always enforced), Isolation (transactions do not interfere), and Durability (committed data survives crashes).

Example
-- Atomicity: both updates happen or neither does
-- Consistency: foreign keys and CHECK constraints still apply
-- Isolation: other sessions see the old balance until COMMIT
-- Durability: after COMMIT, the change survives a server restart
START TRANSACTION;
INSERT INTO orders (user_id, total) VALUES (1, 99.99);
INSERT INTO order_items (order_id, product_id, qty) VALUES (LAST_INSERT_ID(), 5, 2);
COMMIT;
Pro Tip

InnoDB (MySQL default engine) provides full ACID compliance; MyISAM does not support transactions.