Consistency of NoSQL Models
Au Tran, Thy Nguyen, Chaz Chang, Vijaypal Singh, Timothy To, Akash Budholia
Consistency of NoSQL Models Au Tran, Thy Nguyen, Chaz Chang, - - PowerPoint PPT Presentation
Consistency of NoSQL Models Au Tran, Thy Nguyen, Chaz Chang, Vijaypal Singh, Timothy To, Akash Budholia Introduction: From RBDMS to NoSQL In the past, ACID (Atomicity, Consistency, Isolation, and Durability) was a must have requirement for
Au Tran, Thy Nguyen, Chaz Chang, Vijaypal Singh, Timothy To, Akash Budholia
Strong consistency High Availability
Strong consistency Weak Consistency Eventual Consistency
○ Processes acknowledge the update: get updated value ○ Processes do not acknowledge the update: follow Eventual Consistency Model Weak Consistency Eventual Consistency Causal Consistency Sequential Consistency
successive reads will return that same value
performs read x1, then x2, then x2 cannot
were reflected in x1; intuitively, reads cannot go backward.
reads do not apply to
performed by different processes, only reads by the same process.
a given object needs to be completed before any subsequent write operation
performs write w1, then w2, then all processes observe w1 before w2.
processes, only writes by the same process.
○ prioritizing high performance ○ low computation complexity ○ high memory space efficiency ○ low application network traffic
the node, the node become the “coordinator” responsible for retrieving the data from neighboring nodes and answering back to application
value wrapped over the smallest hash value to form a ring
Designed to be eventually consistent, high availability, and low-latency. However, write consistency levels can be modify using configuration constants to satisfy user requirements
(Strong Consistency, high latency)
latency)
before responding to client (Eventual consistency, low latency)
coordinator will later attempt to replay the hint and deliver the mutation to the replicas. This consistency level is only accepted for write operations.
back to client, the number is called the quorum. (Eventual consistency, low latency)
same data center as the coordinator node. (Eventual Consistency, Low Latency)
Similar to Write Consistency Levels, the following configuration constants describe Cassandra read consistency levels:
consistency, less availability)
(Eventual consistency, high availability)
returns that data to client. (Eventual consistency, high availability)
to client, that number is the QUORUM. (Eventual consistency, high-availability)
read request before responding to client. (Eventual consistency, high-availability)
routine to improve consistency.
with out-of-date value, Cassandra will issues read-repair requests to those nodes and update them to the latest value. After all Read-repair requests are done, then the Coordinator node responds back to the client
ALL Write Consistency Level or ALL Read Consistency Level
ONE Read Consistency Level and QUORUM Write Consistency Level
QUORUM Read Consistency Level and ONE Write Consistency Level
ONE Read Consistency Level and ONE Write Consistency Level
○ Documents are distributed based on the shared-key values. ○ Shard-key value close to each other will most likely end up on the same shard.
○ MD5 hash is used to hash the shard-keys ○ The idea behind hash-based is to distribute the data among shard evenly ○ Could be slower for ranged based queries ○ Good for monotonically increasing ids.
○ Users can specify a custom configuration to accomplish application requirements. ○ For example, high-demanding data can be stored in-memory and less demanding data on disk
○ When a new replica set is initiated ○ Primary steps down ○ Node failover where primary can’t reach majority of the secondaries
Figure: The majority write concern in practice.
1.
2.
3.