Consistency
ELI5 — The Vibe Check
Consistency in databases means a transaction can only bring the database from one valid state to another valid state. It can never violate your rules — constraints, foreign keys, triggers — all checked every time. Garbage in, error out.
Real Talk
Consistency ensures that a transaction brings the database from one valid state to another, maintaining all predefined rules including integrity constraints, cascades, and triggers. Any data written to the database must be valid according to all defined rules. It is the 'C' in ACID.
When You'll Hear This
"Consistency ensures a foreign key constraint is never violated mid-transaction." / "ACID consistency is different from consistency in the CAP theorem."
Related Terms
ACID (Atomicity, Consistency, Isolation, Durability)
ACID is the four guarantees a reliable database makes about transactions. It is the reason you trust a bank's database with your money.
Atomicity
Atomicity means a transaction is all-or-nothing — like an atom that cannot be split.
Durability
Durability means once the database says 'committed', your data is saved forever — even if the server crashes right after.
Isolation
Isolation means concurrent transactions do not see each other's in-progress changes.
Transaction
A transaction groups multiple database operations into one all-or-nothing bundle. Either ALL of them succeed, or NONE of them happen.