How it works
Placing an order might insert the order, reduce stock and record a payment. Inside a transaction, a failure halfway rolls everything back, so stock is never reduced for an order that does not exist. ACID names the guarantees: atomic (all or nothing), consistent (rules hold), isolated (concurrent work does not mix) and durable (committed means saved).
Isolation levels decide how much concurrent transactions can see of each other's work. Relational databases are built around transactions; many NoSQL stores offer them in narrower forms.
Related terms
More in Databases and storage
Keeping data correct