Presentation is loading. Please wait.

Presentation is loading. Please wait.

Consistency and Replication

Similar presentations


Presentation on theme: "Consistency and Replication"— Presentation transcript:

1 Consistency and Replication
CSCI 6900/4900

2 Data-Centric Consistency Models
The general organization of a logical data store, physically distributed and replicated across multiple processes.

3 Consistency Models Contract between processes and data store
If the processes play by certain rules the store promises to work correctly Data store guarantees certain properties on the data items stored Example: A read on a data item would always return the value showing the most recent write Several data consistency models Strict consistency, sequential consistency, causal consistency, FIFO consistency

4 Strict Consistency Most stringent consistency model
“Any read on a data item x returns a value corresponding to the result of the most recent write on x” Natural and obvious Uniprocessor systems guarantee strict consistency Implicitly assumes the existence of absolute global time

5 Strict Consistency - Illustration
Behavior of two processes, operating on the same data item. A strictly consistent store. A store that is not strictly consistent.

6 Problems with Strict Consistency
Strict consistency poses serious problems for systems with multiple machines Example Two machines A & B located in different continents & data item x is stored on B. A performs a read at T1 and immediately after B performs a write at T2 If T2 – T1 is very small, the write would have completed before T1 arrives. Thus T1 reads the new value Problem arises because strict consistency relies on absolute global time Impossible to assign unique time stamps corresponding to actual global time Locks do not solve the problem

7 Sequential Consistency
Slightly weaker consistency model “The result of any execution is the same as if the (read & write operations by all the processes on the data store were executed in some sequential order and the operations of each individual process appear in this sequence in the order specified by its program” Any valid interleaving of read and write operations All processes should see the same interleaving of operations Time does not play a role in this model

8 Sequential Consistency - Example
A sequentially consistent data store. A data store that is not sequentially consistent.

9 Linearizability Weaker than strict consistency but stronger than sequential consistency Operation receive a timestamp from a globally available clock, but the clock has finite precision “The result of any execution is the same as if the (read and write) operations by all the processes on the data store were executed in some sequential order and the operations of each individual process appear in this sequence in the order specified by its program. In addition if tsOP1(x) < tsOP2(y) then OP(1) should precede OP2 in this sequence. A linearizable data store is also sequential

10 Validity in Sequential Consistency
Process P1 Process P2 Process P3 x = 1; print ( y, z); y = 1; print (x, z); z = 1; print (x, y); Three concurrently executing processes.

11 Validity in Sequential Consistency
x = 1; print ((y, z); y = 1; print (x, z); z = 1; print (x, y); Prints: Signature: (a) print (x,z); print(y, z); Prints: Signature: (b) print (y, z); Prints: Signature: 110101 (c) Prints: 111111 (d) Four valid execution sequences for the processes of the previous slide. The vertical axis is time.

12 Causal Consistency Weaker than sequential consistency
Differentiates between causally related events and those that are not Example: Process P1 writes x. Process P2 reads x and writes y. Reading of x and writing on y are potentially causally related. However two independent writes are not causally related “Writes that are potentially casually related must be seen by all processes in the same order. Concurrent writes may be seen in a different order on different machines.”

13 Casual Consistency - Example
This sequence is allowed with a casually-consistent store, but not with sequentially or strictly consistent store.

14 Casual Consistency- Example [Contd.]
A violation of a casually-consistent store. A correct sequence of events in a casually-consistent store.


Download ppt "Consistency and Replication"

Similar presentations


Ads by Google