Oralce/MYSQL database administrators are well aware of term named ACID
ACID stands for: Atomicity, Consistency, Isolation, Durability and it is at the foundation of RDBMS success.
ATOMICITY: If one part of transaction fails, the entire transaction will fail to maintain integrity of database
CONSISTENCY: Database will always be in a consistent state both at the beginning and at the end of a transaction
ISOLATION: No transaction has access to any other in-flight/unfinished transaction
DURABILITY: Database records the transaction in persistent storage/data files when it completes. Power/disk failure will not impact the completed transaction.
Above principal applies strictly to RDBMS databases but not to NoSQL databases.
Now let us understand the CAP Theorem
CAP theorem is also known as Brewer’s theorem after computer scientist Eric Brewer who gave this Theorem.
CAP stands for : Consistency, Availability, Partition Tolerance
CONSISTENCY: Somewhat similar to what it means in ACID terminology but NOT same. Every read receives the most recent write or an error
AVAILABILITY: Every request receives a (non-error) response BUT without the guarantee that it contains the MOST RECENT write
PARTITION TOLERANCE: Database will operate even if an arbitrary number of records are dropped/delayed by the network between nodes
Now important point here is that a distributed database system like Cassandra NoSQL can only have 2 out of above 3: Consistency, Availability and Partition Tolerance.
Cassandra offer availability and partition tolerance, sacrificing consistency.
Let us now go to next term which is applicable to NoSQL databases like Cassandra: BASE
BASICALLY AVAILABLE: System does guarantee availability in a reasonable amount of time
SOFT: State of the system may change over time to become consistent eventually
EVENTUALLY CONSISTENT: Not all nodes see the same version of the data. As the data is replicated, the latest version of the data may be sitting on some node in the cluster, but older versions are still out there on some other nodes, but at some point eventually all nodes will see the latest version
To re-iterate, Cassandra favors availability and partition tolerance and don’t concern much with consistency.
MongoDB is another popular NoSQL database, which favors consistency and partition tolerance over high availability.
In the coming posts our goal will be to learn more about Cassandra database and go in-depth on these terminology.
[Post Views: 0]
You can connect with me on LinkedIn.
Latest posts by Brijesh Gogia (see all)
- Cassandra – 4 –Cassandra Architecture terminology - March 30, 2019
- Cassandra – 3 – Related Terms : ACID, BASE,CAP Theorem - March 15, 2019
- Cassandra – 2 – Basics of Cassandra - March 9, 2019