Database consistency doesn’t mean that the transaction is correct, only that the transaction didn’t break the rules defined by the program. Database consistency is important because it regulates the data that is coming in and rejects the data that doesn’t fit into the rules.  Consistency rules are often enforced through constraints at a field level. A constraint specifies a rule governing a given record or field-level value.

Example of Consistency Rules at Work

For example, a column in a database may only have the values for a coin flip as “heads” or “tails.” If a user were to attempt to put in “sideways,” consistency rules for the database would not allow it. You may have experience with consistency rules about leaving a field on a web page form empty. When a person is filling out a form online and forgets to fill in one of the required spaces, a NULL value goes to the database, causing the form to be rejected until the blank space has something in it.  Consistency is the second stage of the ACID model (Atomicity, Consistency, Isolation, Durability), which is a set of guidelines for ensuring the accuracy of database transactions.