Consistency and Replication. Some slides are from Prof. Jalal Y. Kawash at Univ. of Calgary

Similar documents
Consistency and Replication

Consistency and Replication (part b)

Chapter 4: Distributed Systems: Replication and Consistency. Fall 2013 Jussi Kangasharju

殷亚凤. Consistency and Replication. Distributed Systems [7]

Lecture 6 Consistency and Replication

Replication and Consistency. Fall 2010 Jussi Kangasharju

Module 7 - Replication

Consistency and Replication

Replica Placement. Replica Placement

Consistency and Replication

Replication. Consistency models. Replica placement Distribution protocols

Chapter 7 Consistency And Replication

Replication & Consistency Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 7 Consistency And Replication

CSE 5306 Distributed Systems. Consistency and Replication

Consistency & Replication

Replication in Distributed Systems

Distributed Systems: Consistency and Replication

Consistency and Replication. Why replicate?

Consistency and Replication 1/62

CSE 5306 Distributed Systems

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1

Consistency and Replication. Why replicate?

Distributed Systems (5DV147)

DISTRIBUTED COMPUTER SYSTEMS

Consistency and Replication 1/65

Distributed Systems Principles and Paradigms. Chapter 07: Consistency & Replication

CONSISTENCY IN DISTRIBUTED SYSTEMS

Replication of Data. Data-Centric Consistency Models. Reliability vs. Availability

Eventual Consistency. Eventual Consistency

Replication architecture

Last Class: Consistency Models. Today: Implementation Issues

Last Class: Web Caching. Today: More on Consistency

Consistency in Distributed Systems

Replication and Consistency

DYNAMO: AMAZON S HIGHLY AVAILABLE KEY-VALUE STORE. Presented by Byungjin Jun

Important Lessons. Today's Lecture. Two Views of Distributed Systems

Implementation Issues. Remote-Write Protocols

Last Class:Consistency Semantics. Today: More on Consistency

11. Replication. Motivation

Module 7 File Systems & Replication CS755! 7-1!

CS Amazon Dynamo

SCALABLE CONSISTENCY AND TRANSACTION MODELS

10. Replication. Motivation

CAP Theorem, BASE & DynamoDB

There is a tempta7on to say it is really used, it must be good

Distributed Systems COMP 212. Revision 2 Othon Michail

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs

Today CSCI Consistency Protocols. Consistency Protocols. Data Consistency. Instructor: Abhishek Chandra. Implementation of a consistency model

Linearizability CMPT 401. Sequential Consistency. Passive Replication

Chapter 17: Distributed Systems (DS)

X X C 1. Recap. CSE 486/586 Distributed Systems Gossiping. Eager vs. Lazy Replication. Recall: Passive Replication. Fault-Tolerance and Scalability

Distributed KIDS Labs 1

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica

CPS 512 midterm exam #1, 10/7/2016

Dynamo: Amazon s Highly Available Key-Value Store

Dynamo: Amazon s Highly Available Key-value Store

DISTRIBUTED SHARED MEMORY

Dynamo: Key-Value Cloud Storage

Distributed System Chapter 16 Issues in ch 17, ch 18

Intuitive distributed algorithms. with F#

Recap. CSE 486/586 Distributed Systems Case Study: Amazon Dynamo. Amazon Dynamo. Amazon Dynamo. Necessary Pieces? Overview of Key Design Techniques

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing

GOSSIP ARCHITECTURE. Gary Berg css434

Dynamo: Amazon s Highly Available Key-value Store. ID2210-VT13 Slides by Tallat M. Shafaat

Module 15: Network Structures

Failure Models. Fault Tolerance. Failure Masking by Redundancy. Agreement in Faulty Systems

Lecture XII: Replication

EECS 498 Introduction to Distributed Systems

Presented By: Devarsh Patel

Reliable Distributed System Approaches

Paxos Replicated State Machines as the Basis of a High- Performance Data Store

Multiprocessors & Thread Level Parallelism

Horizontal or vertical scalability? Horizontal scaling is challenging. Today. Scaling Out Key-Value Storage

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

Today: Fault Tolerance. Replica Management

Basic vs. Reliable Multicast

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Building Consistent Transactions with Inconsistent Replication

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica

CS 425 / ECE 428 Distributed Systems Fall 2017

Maintaining the NDS Database

Distributed Data Management Replication

Parallel and Distributed Systems. Programming Models. Why Parallel or Distributed Computing? What is a parallel computer?

Transaction Management using Causal Snapshot Isolation in Partially Replicated Databases. Technical Report

02 - Distributed Systems

Homework 2 COP The total number of paths required to reach the global state is 20 edges.

02 - Distributed Systems

Replication. Feb 10, 2016 CPSC 416

Distributed Systems 8L for Part IB

Distributed Systems. Lec 9: Distributed File Systems NFS, AFS. Slide acks: Dave Andersen

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

Today: World Wide Web! Traditional Web-Based Systems!

Module 16: Distributed System Structures. Operating System Concepts 8 th Edition,

Fault Tolerance. Distributed Systems. September 2002

Distributed Systems Multicast & Group Communication Services

Today CSCI Data Replication. Example: Distributed Shared Memory. Data Replication. Data Consistency. Instructor: Abhishek Chandra

Transcription:

Consistency and Replication Some slides are from Prof. Jalal Y. Kawash at Univ. of Calgary

Reasons for Replication Reliability/Availability : Mask failures Mask corrupted data Performance: Scalability (size and geographical) Examples: Web caching Horizontal server distribution Object distribution

Example Object Replication a) A distributed system for replication-aware distributed objects. b) A distributed system responsible for replica management

Cost of Replication Replicas must be kept consistent Dilemma: 1. Replicate data for better performance 2. Modification on one copy triggers modifications on all other replicas 3. Propagating each modification to each replica can degrade performance?

Consistency Issues Access/Update Ratio User accesses to the page Lost Updates Updates to the Web page time

Consistency Model When and how the modifications are made = consistency model: Weak versus strong consistency model

Consistency Models (cont.) The general organization of a logical data store, physically distributed and replicated across multiple processes.

Consistency Models (cont) read1 read2 A process performs a read operation on a data item, expects the operation to return a value that shows the result of the last write operation on that data No global clock difficult to define the last write operation Consistency models provide other definitions Different consistency models have different restrictions on the values that a read operation can return

Summary of Consistency Models Consistency Strict Linearizability Sequential Causal FIFO Description Absolute time ordering of all shared accesses matters. All processes must see all shared accesses in the same order. Accesses are furthermore ordered according to a (nonunique) global timestamp All processes see all shared accesses in the same order. Accesses are not ordered in time All processes see causally-related shared accesses in the same order. All processes see writes from each other in the order they were used. Writes from different processes may not always be seen in that order (a) Consistency Weak Release Entry Description Shared data can be counted on to be consistent only after a synchronization is done Shared data are made consistent when a critical region is exited Shared data pertaining to a critical region are made consistent when a critical region is entered. a) Consistency models not using synchronization operations. (b) b) Models with synchronization operations.

Distribution Models Replica Placement: Where is a replica placed? When is a replica created? Who creates the replica? How do we distribute updates between replicas? Update propagation Epidemic protocols

Types of Replicas The logical organization of different kinds of copies of a data store into three concentric rings.

Permanent Replicas Initial set of replicas Other replicas can be created from them Small and static set Example: Web site horizontal distribution 1. Replicate Web site on a limited number of machines on a LAN Distribute request in round-robin 2. Replicate Web site on a limited number of machines on a WAN (mirroring) Clients choose which sites to talk to

Server-Initiated Replicas (1) Dynamically created at the request of the owner of the DS Example: push-caches Owners: web owners for CNN, Yahoo Web hosting servers can dynamically create replicas close to the demanding client Need dynamic policy to create and delete replicas One is to keep track of Web page hits Keep a counter and access-origin list for each page

Server-Initiated Replicas (2) Counting access requests from different clients.

Client-Initiated Replicas These are caches Temporary storage (expire fast) Managed by clients Cache hit: return data from cache Cache miss: load copy from original server Kept on the client machine, or on the same LAN Multi-level caches

Multi-Level Caches

Revisit: Iterative versus Recursive Resolution The comparison between recursive and iterative name resolution with respect to caching.

Design Issues for Update Propagation A client sends an update to a replica. Based on the consistency model supported, the update is then propagated to all other replicas at its proper time 1. Propagate state or operation 2. Pull or Push protocols 3. Unicast or multicast propagation

State versus Operation Propagation (1) 1. Propagate a notification of update Invalidate protocols When data item x is changed at a replica, it is invalidated at other replicas An attempt to read the item causes an item-fault triggering updating the local copy before the read can complete Uses little network bandwidth When is good to use this distribution protocol? When read-to-write ratio is low or high? Good when read-to-write ratio is Low

State versus Operation Propagation (2) When read-to-write ratio is high: 2. Transfer modified data Uses high network bandwidth 3. Propagate the update operation Each replica must have a process capable of performing the update Uses very low network bandwidth

Pull versus Push Push: updates are propagated to other replicas without solicitation Typically, from permanent to server-initiated replicas Used to achieve a high degree of consistency Pull: A replica asks another for an update Typically, from client-initiated replica Inconsistent cache results in longer response time

Pull versus Push Protocols Issue Push-based Pull-based State of server List of client replicas and caches None Messages sent Update (and possibly fetch update later) Poll and update Response time at client Immediate (or fetch-update time) Fetch-update time A comparison between push-based and pull-based protocols in the case of multiple client, single server systems.

Unicast versus Multicast Unicast: a replica sends separate n-1 updates to every other replica Multicast: a replica sends one message to multiple receivers Network takes care of multicasting Can be cheaper Suites push-based protocols

Consistency Protocols Actual implementation of consistency models Whether primary copy exists or not Primary-based protocols Replicated-write protocols

Primary-Based Remote Write Protocols Non-replicated Single copy of each data item Both read and write at the (remote) primary server

Primary-Based Remote-Write Protocols (cont.) Primary-based remote-write protocol with a fixed server to which all read and write operations are forwarded.

Primary-Based Remote-Write Protocols (cont.) Replicated: primary-backup remote write protocol Primary copy and backups for each data item Read from local copy Write to the (remote) primary server Update backups Blocking vs. non-blocking update

Primary-Based Remote-Write Protocols (cont.) The principle of primary-backup protocol.

Primary-Based Local Write Protocols Non-replicated Single copy of each data item Move primary copy to local server and write to it Replicated: Primary-backup local write protocol Primary copy and backups for each data item Read from local copy Move primary copy to local server and write to it Update backups

Primary-Based Local-Write Protocols (cont.) Primary-based local-write protocol in which a single copy is migrated between processes.

Primary-Based Local-Write Protocols (cont.) Primary-backup protocol in which the primary migrates to the process wanting to perform an update.

Which consistency protocol does DNS (Domain Name System) follows?

No Primary Copy Replicated-Write Protocols Active replication Quorum-based protocol

Ordering Guarantees Anti-entropy, Gossip & Unreliable multicast Messages sent from different processes may be delivered in different orders at different sites Totally-ordered multicast Causally-ordered multicast The sequencer approach All requests must be sent to a sequencer, where they are given an identifier The sequencer assigns consecutive increasing identifiers as it receives requests Requests arriving at sites are held back until they are next in sequence

Active Replication The problem of replicated invocations.

Active Replication (cont.) Forwarding an invocation request from a replicated object. Returning a reply to a replicated object.

Idea? Network Partitions Well-known Solution: Quorum-Based Protocols Use Majority Write Read Read Retrieve number of replicas in read quorum Select the one with the latest version. Perform a read on it Write Retrieve number of replicas in write quorum. Find the latest version and increment it. Perform a write on the entire write quorum.

Quorum-Based Protocols N: Total #Replicas N R : #Replicas in Read Quorum N W : #Replicas in Write Quorum Constraints: 1. N R + N W > N 2. N W > N/2

Quorum-Based Protocols Three examples of the voting algorithm for N = 12 replicas (a) A correct choice of read and write set (b) A choice that may lead to write-write conflicts (c) A correct choice, known as ROWA (read one, write all)