Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit a43c164

Browse files
committed
(GH-53) Add consistency section
1 parent 9f8df5a commit a43c164

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/rdbms/acid.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ fails.
6161
Consistency
6262
===========
6363

64-
.. todo: help ensure the data to be in correct state,
65-
data integrity constraints must be followed.
66-
consistency = correctness
64+
You can think "consistency" as "correctness". It ensures that a transaction
65+
can only bring the database from one consistent state to another, preserving
66+
database invariants: any data written to the database must be valid according
67+
to all defined rules, including constraints, cascades, triggers, and any
68+
combination of thereof. This prevents database corruption by an illegal
69+
transaction. As example, referential integrity guarantees the primary key --
70+
foreign key relationship.
6771

6872
Isolation
6973
=========

0 commit comments

Comments
 (0)