1 Prof. Orhan Gemikonakli Module Leader: Prof. Leonardo Mostarda Università di Camerino Distributed Systems – Consistency Prof. Orhan Gemikonakli - Camerino.

Slides:



Advertisements
Similar presentations
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 7: Consistency 4/13/20151Distributed Systems - COMP 655.
Advertisements

Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication Chapter Introduction: replication and scalability 6.2 Data-Centric Consistency Models 6.3 Client-Centric Consistency.
Consistency and Replication Chapter Topics Reasons for Replication Models of Consistency –Data-centric consistency models: strict, linearizable,
Principles and Paradigms Consistency and Replication
Consistency and Replication
Consistency and Replication (3). Topics Consistency protocols.
Consistency and Replication Chapter 6. Object Replication (1) Organization of a distributed remote object shared by two different clients.
Replication and Consistency Chapter 6. Data-Centric Consistency Models The general organization of a logical data store, physically distributed and replicated.
Consistency Models Based on Tanenbaum/van Steen’s “Distributed Systems”, Ch. 6, section 6.2.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
Distributed Systems CS Consistency and Replication – Part II Lecture 11, Oct 10, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Distributed Systems Spring 2009
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, Oct 5, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class: Web Caching Use web caching as an illustrative example Distribution protocols –Invalidate.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Replication and Consistency CS-4513 D-term Replication and Consistency CS-4513 Distributed Computing Systems (Slides include materials from Operating.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Introduction Consistency models –Data-centric consistency models.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Client-Centric.
Consistency and Replication Chapter 7
Consistency and Replication CSCI 4780/6780. Chapter Outline Why replication? –Relations to reliability and scalability How to maintain consistency of.
Consistency and Replication
Consistency And Replication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
Distributed Systems CS Consistency and Replication – Part II Lecture 11, Oct 2, 2013 Mohammad Hammoud.
CIS 720 Lecture 16. Client-Centric Consistency Intended to address the issues in eventual consistency for mobile clients. –Consistent for a single.
ICS362 – Distributed Systems Dr. Ken Cosh Lecture 7.
Consistency and Replication Chapter 6. Release Consistency (1) A valid event sequence for release consistency. Use acquire/release operations to denote.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Outline Introduction (what’s it all about) Data-centric consistency Client-centric consistency Replica management Consistency protocols.
Consistency and Replication Distributed Software Systems.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
第5讲 一致性与复制 §5.1 副本管理 Replica Management §5.2 一致性模型 Consistency Models
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Replication (1). Topics r Why Replication? r System Model r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, September 30, 2013 Mohammad Hammoud.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication. Outline Introduction (what’s it all about) Data-centric consistency Client-centric consistency Replica management Consistency.
Distributed Systems CS Consistency and Replication – Part IV Lecture 13, Oct 23, 2013 Mohammad Hammoud.
Client-Centric Consistency Models
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Consistency and Replication CSCI 6900/4900. FIFO Consistency Relaxes the constraints of the causal consistency “Writes done by a single process are seen.
Consistency and Replication (1). Topics Why Replication? Consistency Models – How do we reason about the consistency of the “global state”? u Data-centric.
1 Prof. Leonardo Mostarda University of Camerino Distributed Systems – intro Prof. Leonardo Mostarda-- Camerino,
Distributed Systems: Consistency and Replication Ghada Ahmed, PhD. Assistant Prof., Computer Science Dept. Web:
1 Prof. Orhan Gemikonakli Module Leader: Prof. Leonardo Mostarda Università di Camerino Distributes Systems – Consistency (2) Prof. Orhan Gemikonakli -
CS6320 – Performance L. Grewe.
Distributed Systems – Paxos
Distributed Systems CS
Consistency and Replication
Consistency and Replication
Consistency Models.
Distributed Systems CS
Consistency and Replication
DATA CENTRIC CONSISTENCY MODELS
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed Systems CS
Prof. Leonardo Mostarda University of Camerino
Consistency and Replication
Presentation transcript:

1 Prof. Orhan Gemikonakli Module Leader: Prof. Leonardo Mostarda Università di Camerino Distributed Systems – Consistency Prof. Orhan Gemikonakli - Camerino

General Introduction A distributed system organized as middleware. The middleware layer extends over multiple machines, and offers each application the same interface. Prof. Orhan Gemikonakli - Camerino2

General Introduction zDiscussed so far: Principles of Distributed Systems yArchitectures yProcesses yCommunication yNaming ySynchronisation Prof. Orhan Gemikonakli - Camerino3

General Introduction Prof. Orhan Gemikonakli - Camerino4 zTo discuss: More on principles of DSs yConsistency and Replication yFault Tolerance ySecurity – in a separate module zTo discuss: How to develop Distributed Applications (the paradigms) yDistributed object-based systems yDistributed file systems yDistributed web-based systems yDistributed coordination-based systems

Last Lecture zMutual Exclusion yA Centralized Algorithm yA Distributed Algorithm yA Token Ring Algorithm zLeader election yThe Bully Algorithm yA Ring Algorithm 5Prof. Orhan Gemikonakli - Camerino

Outline zBasic definitions about Consistency and replication zData-centric consistency models yContinuous consistency ySequential consistency yCausal consistency zClient-centric consistency models yEventual consistency yMonotonic reads yMonotonic writes yReads your writes yWrites follows reads 6Prof. Orhan Gemikonakli - Camerino

Consistency and Replication zData are generally replicated to yenhance reliability or yimprove performance. zReplication introduces the problem of keeping the replicas consistent. zA serious problem: keeping multiple copies consistent may itself be subject to serious scalability problems. ywhen an update operation is performed on one copy, the update should be propagated to all copies before a subsequent operation takes place (tight consistency) z“ The cure may be worse than the disease.” 7Prof. Orhan Gemikonakli - Camerino

Consistency Models zData-centric consistency models 1.Sequential consistency 2.Causal consistency zClient-centric consistency models 1.Eventual consistency 2.Monotonic reads 3.Monotonic writes 4.Read your writes 5.Writes follow reads Prof. Orhan Gemikonakli - Camerino8

Data-centric consistency models zAn important class of what are known as consistency models assumes that multiple processes simultaneously access shared data. zConsistency for these situations can be formulated with respect to what processes can expect when reading and updating the shared data. zTraditionally, consistency has been discussed in the context of read and write operations on shared data, available by means of (distributed) shared memory. 9Prof. Orhan Gemikonakli - Camerino

Data-centric Consistency Models zThe general organization of a logical data store, physically distributed and replicated across multiple processes. Prof. Orhan Gemikonakli - Camerino10

zA consistency model is essentially a contract between processes and the data store. yIt says that if processes agree to obey certain rules, the store promises to work correctly. yNormally, a process that performs a read operation on a data item, expects the operation to return a value that shows the results of the last write operation on that data. 11 Data-centric Consistency Models Prof. Orhan Gemikonakli - Camerino

zIn the absence of a global clock, it is difficult to define precisely which write operation is the last one. zAs an alternative, we need to provide other definitions, leading to a range of consistency models. zEach model effectively restricts the values that a read operation on a data item can return. 12 Data-centric Consistency Models Prof. Orhan Gemikonakli - Camerino

Continuous Consistency zThere is no best solution to replicating data zReplicating data creates consistency problems that cannot be solved in a general way zEfficient solutions? yLoosen consistency! zLoosening consistency: yNo general rules. yWhat can be tolerated is application specific. Prof. Orhan Gemikonakli - Camerino13

Continuous Consistency zMeasuring inconsistency in terms of numerical deviations can be used. yOne obvious example is the replication of records containing stock market prices. o Absolute deviation: An application may specify that two copies should not deviate more than for example $0.02. o Relative numerical deviation: An application may specify that two copies should not deviate more than for example 0.5%. zNumerical deviation can also be understood in terms of yOrder deviation: the number of updates that have been applied to a given replica, but have not yet been seen by others. yStaleness deviation: last time the replica was updated 14Prof. Orhan Gemikonakli - Camerino

Continuous consistency zOrder deviation Prof. Orhan Gemikonakli - Camerino15 Order deviation for replica A = 3 Order deviation for replica B = 2

Continuous Consistency zChoosing the appropriate granularity for a consistency unit (conit). (a) Two updates lead to update propagation. Prof. Orhan Gemikonakli - Camerino16

Continuous Consistency zChoosing the appropriate granularity for a conit. (b) No update propagation is needed (yet). Prof. Orhan Gemikonakli - Camerino17

Continuous Consistency zStaleness deviations relate to the last time a replica was updated. For some applications, it can be tolerated that a replica provides old data as long as it is not too old. yFor example, weather reports typically stay reasonably accurate over some time, zFinally, there are classes of applications in which the ordering of updates are allowed to be different at the various replicas, as long as the differences remain bounded. ysome updates may need to be rolled back and applied in a different order before becoming permanent. 18Prof. Orhan Gemikonakli - Camerino

Consistent Ordering of Operations zThese models deal with consistently ordering operations on shared, replicated data. zWhen tentative updates at replicas need to be committed, replicas will need to reach agreement on a global ordering of those updates. zIn other words, they need to agree on a consistent ordering of those updates. 19Prof. Orhan Gemikonakli - Camerino

Data-centric consistency models 1.Sequential consistency 2.Causal consistency Prof. Orhan Gemikonakli - Camerino20

zP1 does a write to a data item x, modifying its value to a zP2 later reads the value NIL, and some time after that a yit took some time to propagate the update of x to P2 21 Sequential Consistency Prof. Orhan Gemikonakli - Camerino

Sequential consistency zSequential consistency yThe result of any execution is the same as if the (read and write) operations by all 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. Leslie Lamport zAny valid interleaving of read and write operations is acceptable behaviour, but all processes see the same interleaving of operations. 22Prof. Orhan Gemikonakli - Camerino

Sequential Consistency (3) z(a) A sequentially consistent data store. (b) A data store that is not sequentially consistent. Prof. Orhan Gemikonakli - Camerino23

Sequential consistency zThree concurrently executing processes Prof. Orhan Gemikonakli - Camerino24

Sequential Consistency zFour valid execution sequences for the processes P1, P2, and P3. The vertical axis is time. Prof. Orhan Gemikonakli - Camerino25

Causal Consistency zThe causal consistency model represents a weakening of sequential consistency in that it makes a distinction between events that are potentially causally related and those that are not. zWrites that are potentially causally related must be seen by all processes in the same order. Concurrent writes may be seen in a different order on different machines. 26Prof. Orhan Gemikonakli - Camerino

Causal consistency zFor a data store to be considered causally consistent, it is necessary that the store obeys the following condition: yWrites that are potentially causally related … must be seen by all processes in the same order. yConcurrent writes … may be seen in a different order on different machines. Prof. Orhan Gemikonakli - Camerino27

Causal Consistency (2) zThis sequence is allowed with a causally-consistent store, but not with a sequentially consistent store. zW(x)b and W(x)c are concurrent, so it is not required that all processes see them in the same order. Prof. Orhan Gemikonakli - Camerino28

Causal Consistency (3) z A violation of a causally-consistent store. Prof. Orhan Gemikonakli - Camerino29

Causal Consistency (4) z(b) A correct sequence of events in a causally-consistent store. Prof. Orhan Gemikonakli - Camerino30

Client-centric consistency models zThe consistency models described so far aim at providing a system wide consistent view on a data store. zThe data stores we consider are characterised by the lack of simultaneous updates, or when such updates happen, they can easily be resolved. zIn client-centric consistency, inconsistencies can be hidden in a relatively cheap way. 31Prof. Orhan Gemikonakli - Camerino

Client-centric consisteny models 1.Eventual consistency 2.Monotonic reads 3.Monotonic writes 4.Read your writes 5.Writes follow reads Prof. Orhan Gemikonakli - Camerino32

Eventual Consistency zIn WWW, DNS write conflicts rarely happen. Why? zAll replicas will gradually become consistent. This form of consistency is called eventual consistency. zWhat is the problem? 33Prof. Orhan Gemikonakli - Camerino

Eventual Consistency zThe principle of a mobile user accessing different replicas of a distributed database. Prof. Orhan Gemikonakli - Camerino34

client-centric zThe problem can be alleviated by introducing client- centric consistency. zIn essence, client-centric consistency provides guarantees for a single client concerning the consistency of accesses to a data store by that client. zBayou essentially distinguishes four different consistency models: yMonotonic Reads yMonotonic Writes yRead Your Writes yWrites Follow Reads 35Prof. Orhan Gemikonakli - Camerino

Monotonic Reads (1) zA data store is said to provide monotonic- read consistency if the following condition holds: yIf a process reads the value of a data item x and any successive read operation on x by that process will always return that same value or a more recent value. Prof. Orhan Gemikonakli - Camerino36

Monotonic Reads (2) zThe read operations performed by a single process P at two different local copies of the same data store. (a) A monotonic-read consistent data store. Prof. Orhan Gemikonakli - Camerino37

Monotonic Reads (3) zThe read operations performed by a single process P at two different local copies of the same data store. (b) A data store that does not provide monotonic reads. Prof. Orhan Gemikonakli - Camerino38

Monotonic Writes (1) zIn a monotonic-write consistent store, the following condition holds: yA write operation by a process on a data item x is completed before any successive write operation on x by the same process. Prof. Orhan Gemikonakli - Camerino39

Monotonic Writes (2) zThe write operations performed by a single process P at two different local copies of the same data store. (a) A monotonic-write consistent data store. Prof. Orhan Gemikonakli - Camerino40

Monotonic Writes (3) zThe write operations performed by a single process P at two different local copies of the same data store. (b) A data store that does not provide monotonic-write consistency. Prof. Orhan Gemikonakli - Camerino41

Read Your Writes (1) zA data store is said to provide read-your- writes consistency, if the following condition holds: yThe effect of a write operation by a process on data item x will always be seen by a successive read operation on x by the same process. Prof. Orhan Gemikonakli - Camerino42

Read Your Writes (2) zA data store that provides read-your-writes consistency. Prof. Orhan Gemikonakli - Camerino43

Read Your Writes (3) zA data store that does not. Prof. Orhan Gemikonakli - Camerino44

Writes Follow Reads (1) zA data store is said to provide writes-follow- reads consistency, if the following holds: yA write operation by a process on a data item x following a previous read operation on x by the same process is guaranteed to take place on the same or a more recent value of x that was read. Prof. Orhan Gemikonakli - Camerino45

Writes Follow Reads (2) zA writes-follow-reads consistent data store. Prof. Orhan Gemikonakli - Camerino46

Writes Follow Reads (3) zA data store that does not provide writes-follow- reads consistency. Prof. Orhan Gemikonakli - Camerino47

Summary zBasic definitions about Consistency and replication zData-centric consistency models yContinuous consistency ySequential consistency yCausal consistency zClient-centric consistency models yMonotonic reads yMonotonic writes yReads your writes yWrites follows reads 48Prof. Orhan Gemikonakli - Camerino

Next Lecture zState machine replication approach zPaxos protocol Prof. Orhan Gemikonakli - Camerino49