Types of Consistency
Depending on the use case, there are mainly two types of consistency parameters for every type of database
1. Strong Consistency
Strong consistency refers to the AVAILABILITY of the correct & accurate data to all the users interacting with the database at any given moment of time from any part of the world. In this, all the nodes (or replicas) will contain exactly the same data at any given time. This type of consistency is facilitated in SQL Database which functions of ACID Properties.
Example: Banking Application where real-world money is credited and debited in real-time and must be shown accurately to the user.
2. Weak Consistency
Weak consistency refers to the “eventually accurate information” but doesn’t guarantee its correctness immediately unlike Strong consistency. In this, it’s not always guaranteed, that the primary replica will have the same updated information just like other replicas.
If your use case doesn’t deal with real-time data analysis or requires your users to have access to partially correct information for a while, you can opt for NoSQL Databases that work on BASE Properties.
What is Database Consistency?
Database consistency governs the most crucial aspects of the database, availability of correct information at the right time by the validation rules specified in the beginning is what decides the data integrity, and accuracy of the data stored.
In this article, we’ll be exploring consistency in the context of a relational database, why it’s crucial to be maintained, its real-world examples, and what features of an RDBMS help maintain a consistent database.