Replicated Data Management DISHELT FRANCISCO TORRES PAZ.

Slides:



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

Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
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 7 Part II Replica Management & Consistency Protocols.
Consistency and Replication Chapter 6. Object Replication (1) Organization of a distributed remote object shared by two different clients.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Computer Science Lecture 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class: Web Caching Use web caching as an illustrative example Distribution protocols –Invalidate.
EEC 688/788 Secure and Dependable Computing Lecture 12 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Client-Centric.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class:Consistency Semantics Consistency models –Data-centric consistency models –Client-centric.
1 6.4 Distribution Protocols Different ways of propagating/distributing updates to replicas, independent of the consistency model. First design issue.
Fault Tolerance via the State Machine Replication Approach Favian Contreras.
Consistency And Replication
CH2 System models.
Distributed File Systems
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
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.
Replication (1). Topics r Why Replication? r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric consistency.
第5讲 一致性与复制 §5.1 副本管理 Replica Management §5.2 一致性模型 Consistency Models
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.
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
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.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Distributed Systems CS Consistency and Replication – Part IV Lecture 13, Oct 23, 2013 Mohammad Hammoud.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Hwajung Lee.  Improves reliability  Improves availability ( What good is a reliable system if it is not available?)  Replication must be transparent.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Replication Improves reliability Improves availability ( What good is a reliable system if it is not available?) Replication must be transparent and create.
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Replication Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
PERFORMANCE MANAGEMENT IMPROVING PERFORMANCE TECHNIQUES Network management system 1.
Distributed Computing Systems Replication Dr. Sunny Jeong. Mr. Colin Zhang With Thanks to Prof. G. Coulouris,
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
Replication Chapter Katherine Dawicki. Motivations Performance enhancement Increased availability Fault Tolerance.
Reliable multicast Tolerates process crashes. The additional requirements are: Only correct processes will receive multicasts from all correct processes.
CS6320 – Performance L. Grewe.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
Replication and Consistency
Consistency Models.
Replication and Consistency
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
7.1. CONSISTENCY AND REPLICATION INTRODUCTION
Consistency and Replication
Replication Improves reliability Improves availability
Distributed Systems CS
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed Systems CS
Replica Placement Model: We consider objects (and don’t worry whether they contain just data or code, or both) Distinguish different processes: A process.
Last Class: Web Caching
Abstractions for Fault Tolerance
CSE 486/586 Distributed Systems Consistency --- 3
Replication and Consistency
Presentation transcript:

Replicated Data Management DISHELT FRANCISCO TORRES PAZ

Data Replication Data replication is an age-old technique for tolerating faults, increasing system availability, and reducing latency in data access. Is widely used in cache memory, distributed shared memory, distributed file systems, and bulletin boards.

DNS servers at the upper levels are highly replicated—without this, IP address lookup will be unacceptably slow. Another major problem in replication management is that of replica update, when a replica is updated, every other copy of that data has to be eventually updated to maintain consistency.

RELIABILITY & AVAILABILITY Two primary motivations behind data replication are: ReliabilityReliability Availability On the World Wide Web, proxy servers provide service when the main server becomes overloaded. These show how replication can improve data or service availability. In mobile terminals and handheld devices, disconnected modes of operation are important, and replication of data or service minimizes the disruption of service. RAID (Redundant Array of Inexpensive Disks) is another example of providing reliability.

Reliability and availability address two issues: ◦A server that is reliable but rarely available serves no purpose. ◦Similarly, a server that is available but frequently malfunctions or supplies incorrect or stale data causes headache for all.

Consider two users Alice and Bob updating a shared file F. Each user’s life is as follows: do true → read F; modify F; write F od May update a central copy of F that is shared by both. May update the local copies of F separately maintained by Alice and Bob. This depends on data consistency models.

ARCHITECTURE OF REPLICATED DATA MANAGEMENT Ideal replication transparency can rarely be achieved, approximating replication transparency is one of the architectural goals of replicated data management. Ideally replicated data management must be transparent. Transparency implies that users have the illusion of using a single copy of the data or the object. The clients should not have any knowledge of which replica is supplying with the data or which server is providing the service.

PASSIVE & ACTIVE REPLICATION For maintaining replication transparency, two different architectural models are widely used: passive replication and active replication.

Passive Replication Every client communicates with a single replica called the primary. In addition to the primary, one or more replicas are used as backup copies. If the primary is up and running, then it provides the desired service. If the client requests do not modify the state of the server, then no further action is necessary.

If however the service modifies the server state, then to keep the states of the backup servers consistent. If the primary crashes, then one of the backup servers is elected as the new primary.

Primary-backup protocol 1. At most one replica can be the primary server at any time. 2. Each client maintains a variable L (leader) that specifies the replica to which it will send requests. Requests are queued at the primary server. 3. Backup servers ignore client requests. τ is the interval between the reception of two consecutive heartbeat messages. T is the election time δ is the maximum message propagation delay. Smallest failover time: τ+2δ+T

failover time. There may be periods of time when there is no primary server—this happens during a changeover, and the period is called the failover time. Heartbeat messages: The primary server is also required to periodically broadcast messages. If a backup server fails to receive this message within a specific window of time, then it concludes that the primary has crashed and initiates an election. The new leader takes over as the new primary and notifies the clients.

To maintain replication transparency, the above switchover must be atomic. But in real life this may not be true. Multiple retransmissions may be necessary until a backup server becomes the new primary server. This happens during the failover time This happens during the failover time.

Active replication Is an alternative to passive replication is active replication. Here, each of the n clients transparently communicates with a group of k servers (also called replica managers). The client’s machine multicasts the updates to every other server.

Whenever a member posts an update, her local copy is updated and her machine propagates the update to each of the k servers using total order multicast. To read a message, the client sends a request to her machine, which eventually sends a response. Depending on the consistency model, a read request may be forwarded to the other servers before the response is generated.

FAULT-TOLERANT STATE MACHINES Schneider presented a theory of fault-tolerant state machines, and it captures the essence of maintaining a fault-tolerant service via active replication. The value of k (servers) will depend on the failure model. If there is no failure, then: k = 1 will suffice. If one or more of the replicas fail: k must increase. The value of k will depend on the nature and the extent of failure.

Usually, replicas of a single server are executed on separate processors of a distributed system, and protocols are used to coordinate client interactions with these replicas. For a State Machine will be defined as: A set of States A set of States A set of Inputs A set of Inputs A set of Outputs A set of Outputs A transition function (Input x State -> State) A transition function (Input x State -> State) An output function (Input x State -> Output) An output function (Input x State -> Output) A distinguished State called Start. A distinguished State called Start.

The preceding intuitive discussion implies a simple technique for implementing a fault-tolerant service in terms of a State Machine: Place copies of the State Machine on multiple, independent servers. Receive client requests, interpreted as Inputs to the State Machine. Choose an ordering for the Inputs. Monitor replicas for differences in State or Output. Execute Inputs in the chosen order on each server. Respond to clients with the Output from the State Machine.

three A little deduction shows the minimum number of copies needed for fault-tolerance is three: One which has a fault Two others to whom we compare State and Output. Two copies is not enough Two copies is not enough; there is no way to tell which copy is the faulty one. Further deduction shows a three-copy system can support at most one: If more than one of the copies were to fail, all three States and Outputs might differ, and there would be no way to choose which is the correct one.

DATA-CENTRIC CONSISTENCY MODELS Replica consistency requires all copies of data to be eventually identical. However, due to the inherent latency in message propagation, it is sometimes possible for the clients to receive anomalous responses. For example:

In a particular flight, all the seats were sold out, and two persons A and B in two different cities: A B C cancel at 9:37:00 Request at 9:37:25 Request successful at 9:38:00 Consistency determines what responses are acceptable following an update of a replica.

The implementation of distributed shared memory (DSM), each machine maintains a local copy of the shared data. A distributed shared memory with four processes sharing a read– write object X.

Below we present a few well-known consistency models— each model has a different implementation. 1.Strict consistency 2.Linearizability 3.Sequential consistency 4.Causal consistency

STRICT CONSISTENCY For a shared variable x, the trace of a computation is a sequence of read (R) and write (W) operations on x. One or more processes can execute these operations. Strict consistency criterion requires that regardless of the number of replicas of x, every process receive a response that is consistent with the real time.

LINEARIZABILITY The linearizable consistency model handles the apparent incongruity above. Specifically, it looks like: Write of the value a to x occurred before the write of the value b. The linearizable consistency model ensures this by adding a timestamp, this timestamp is simply the global time that if the timestamp of x is less than the timestamp of y then x must occur before y in the sequence.

A linearizable shared memory. Initially x=y=0.

SEQUENTIAL CONSISTENCY A slightly weaker (and much more widely used) form of consistency is sequential consistency. A data store is sequentially consistent when the 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.

In other words, the events observed by each process must globally occur in the same order, or it is not sequentially consistent. Important facts: Time doesn't matter as much. That is, absolute time is somewhat irrelevant. The order of events is most important. A process only observes writes made by other processes. Reads by other processes are completely irrelevant to it.

CAUSAL CONSISTENCY In the causal consistency model, all writes that are causally related must be seen by every process in the same order. The writes may be executed by the same process, or by different processes. The order of values returned by read operations must be consistent with this causal order. Writes that are not causally related to one another can however be seen in any order

The various data consistency models have one thing in common: When multiple clients concurrently write a shared data, a write–write conflict results, and has to be appropriately resolved.

CLIENT-CENTRIC CONSISTENCY PROTOCOLS In some cases there are no write–write conflicts to resolve. For example of a webpage in the World Wide Web. The page is updated only by its owner. To maintain freshness, the cached copies are periodically discarded and updated pages are pulled from the server. As a result, updates propagate to the clients in a lazy manner. Protocols that deal with consistency issues in such cases are known as client- centric protocols.

EVENTUAL CONSISTENCY If the updates are infrequent, then eventually all readers will receive the correct view of the webpage, and all replicas become identical. Eventual consistency is acceptable as long as the clients access the same replica of the shared data. Mobile clients can potentially access different version of the replica and may be unsatisfactory. This is the notion of eventual consistency. Similar models apply to many large databases like the DNS (Domain Name Server).

CONSISTENCY MODELS FOR MOBILE CLIENTS When replicas are geographically distributed, a mobile user will most likely use a replica closest to her. Four consistency models are: 1. Read-after-read 2. Write-after-write 3. Read-after-write 4. Write-after-read

Read-after-read consistency When a read of a data set from one server S is followed by a read of its replica from another server S*, each read from S* should return a value that is at least as old as, or more recent than the value previously read from S. To make sense, if she reads a value x1 at time t1,then at time t2>t1, she must read a value that is either more recent or at least as old as the value x1. To implement this, all updates seen at time t1 must be propagated to all replicas before time t2.

Write-after-write consistency When a write on one replica in server S is followed by a write on another replica in a different server S*, it is important that the earlier updates propagate to all replicas (including S*) before the next write is performed.

Read-after-write consistency Each client must be able to see the updates in a server S following every write operation by itself on another server S*. Consider updating a webpage. If the browser is not synchronized with the editor and the editor sends the updated HTML page to the server, the browser may return an old copy of the page to the viewer. To implement this consistency model, the editor must invalidate the cached copy, forcing the browser to fetch the recently uploaded version from the server.

Write-after-read consistency Each write following a read should take effect on the previously read copy, or a more recent version of it. To implement this consistency model, the server must guarantee that it has obtained all updates on the read set.

REPLICA PLACEMENT There are many different policies for the placement of replicas of shared data: Mirror sites Server-generated replicas Client caches

Mirror Sites On the World Wide Web, a mirror site contains a replica of the original web site on a different server. There may be several mirror sites for a website that expect a large number of hits. These replica servers are geographically dispersed and improve both availability and reliability.

Server-generated replicas The primary server copies a fraction of its files to a replica site only when its own load increases. The primary server monitors the access counts for each of its files. When the count exceeds a predetermined threshold h1, the file is copied into a host server that is geographically closer to the callers, and all calls are rerouted. These replica servers are geographically dispersed and improve both availability and reliability.

Client caches The client maintains a replica in its own machine or another machine in the same LAN. The administration of the cache is entirely the client’s responsibility and the server has no contractual obligation to keep it consistent.