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

Similar documents
CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Systems. Lec 12: Consistency Models Sequential, Causal, and Eventual Consistency. Slide acks: Jinyang Li

CSE 5306 Distributed Systems. Consistency and Replication

Replication and Consistency

Consistency and Replication

Consistency and Replication. Why replicate?

DISTRIBUTED COMPUTER SYSTEMS

Consistency: Relaxed. SWE 622, Spring 2017 Distributed Software Engineering

June Gerd Liefländer System Architecture Group Universität Karlsruhe, System Architecture Group

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

Distributed Systems. Fundamentals Shared Store. Fabienne Boyer Reprise du cours d Olivier Gruber. Université Joseph Fourier. Projet ERODS (LIG)

Lecture 6 Consistency and Replication

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

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

Consistency and Replication

Consistency & Replication in Distributed Systems

Consistency and Replication. Why replicate?

Consistency & Replication

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

CSE 5306 Distributed Systems

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

Memory Consistency. Minsoo Ryu. Department of Computer Science and Engineering. Hanyang University. Real-Time Computing and Communications Lab.

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

Distributed Systems (5DV147)

CONSISTENCY IN DISTRIBUTED SYSTEMS

Consistency and Replication 1/65

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

Consistency and Replication 1/62

Replication. Consistency models. Replica placement Distribution protocols

Consistency and Replication

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

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

Consistency examples. COS 418: Distributed Systems Precept 5. Themis Melissaris

Distributed Systems: Consistency and Replication

Distributed Systems. Lec 11: Consistency Models. Slide acks: Jinyang Li, Robert Morris

DISTRIBUTED SHARED MEMORY

Indirect Communication

Module 7 - Replication

Time and distributed systems. Just use time stamps? Correct consistency model? Replication and Consistency

Replication and Consistency. Fall 2010 Jussi Kangasharju

COMP Parallel Computing. CC-NUMA (2) Memory Consistency

Last Class: Web Caching. Today: More on Consistency

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

Last Class: Consistency Models. Today: Implementation Issues

Distributed Systems. Catch-up Lecture: Consistency Model Implementations

CSE 513: Distributed Systems (Distributed Shared Memory)

Chapter 7 Consistency And Replication

Eventual Consistency. Eventual Consistency

Ch06. NoSQL Part III.

Distributed Shared Memory: Concepts and Systems

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

Replication in Distributed Systems

Consistency and Replication (part b)

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

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

Database Replication: A Tutorial

Shared Memory. SMP Architectures and Programming

CONSISTENCY MODELS IN DISTRIBUTED SHARED MEMORY SYSTEMS

What is consistency?

Replications and Consensus

Distributed Shared Memory

Lecture 16/17: Distributed Shared Memory. CSC 469H1F Fall 2006 Angela Demke Brown

Implementing caches. Example. Client. N. America. Client System + Caches. Asia. Client. Africa. Client. Client. Client. Client. Client.

Relaxed Memory-Consistency Models

Eventual Consistency Today: Limitations, Extensions and Beyond

11. Replication. Motivation

Exam in Distributed Systems

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

Strong Consistency and Agreement

Consistency in Distributed Storage Systems. Mihir Nanavati March 4 th, 2016

Weak Consistency and Disconnected Operation in git. Raymond Cheng

Exam in Distributed Systems

SCALABLE CONSISTENCY AND TRANSACTION MODELS

Consistency: Strict & Sequential. SWE 622, Spring 2017 Distributed Software Engineering

Basic vs. Reliable Multicast

Goals. Facebook s Scaling Problem. Scaling Strategy. Facebook Three Layer Architecture. Workload. Memcache as a Service.

Module 5: Performance Issues in Shared Memory and Introduction to Coherence Lecture 10: Introduction to Coherence. The Lecture Contains:

Eventual Consistency 1

CAP Theorem. March 26, Thanks to Arvind K., Dong W., and Mihir N. for slides.

Eventual Consistency Today: Limitations, Extensions and Beyond

Mutual consistency, what for? Replication. Data replication, consistency models & protocols. Difficulties. Execution Model.

Multiple-Writer Distributed Memory

Distributed Systems. 19. Spanner. Paul Krzyzanowski. Rutgers University. Fall 2017

ECE/CS 757: Homework 1

10. Replication. CSEP 545 Transaction Processing Philip A. Bernstein Sameh Elnikety. Copyright 2012 Philip A. Bernstein

Module 15: "Memory Consistency Models" Lecture 34: "Sequential Consistency and Relaxed Models" Memory Consistency Models. Memory consistency

Versioning, Consistency, and Agreement

Strong Consistency & CAP Theorem

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

Chapter 6: Distributed Systems: The Web. Fall 2012 Sini Ruohomaa Slides joint work with Jussi Kangasharju et al.

POSIX Threads: a first step toward parallel programming. George Bosilca

Replication architecture

Don t Give Up on Serializability Just Yet. Neha Narula

Lecture 13: Memory Consistency. + a Course-So-Far Review. Parallel Computer Architecture and Programming CMU , Spring 2013

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

Design and implementation of page based distributed shared memory in distributed database systems

Consistency in Distributed Systems

CSC630/COS781: Parallel & Distributed Computing

Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions

Transcription:

Today CSCI 5105 Data Replication Examples and Issues Data Consistency Consistency Models Instructor: Abhishek Chandra 2 Data Replication Using multiple copies of same data Why do we need data replication? Example: Distributed Shared Memory Multiprocessor system with per-cpu cache Different caches may hold same cache line Why do we need replication? What happens when a CPU writes a data item? 3 4 1

Example: DNS Each zone has multiple replicas One primary and other secondary Other servers/clients may cache data Why do we need replication? What happens if name resolution changes? Example: Web Caching Server is primary replica Web pages are cached at: Server replicas Client browsers Proxy caches Content-distributions networks (CDNs) Why do we need replication? What happens when a Web page changes? What about stock tickers, live sports scores, weather reports? 5 6 Data Replication: Issues What happens if multiple processes write concurrently? How do we propagate updates to all replicas? What is the cost of updation/consistency? Data Consistency How do we define consistency? What level of consistency is required in case of: DSM? DNS? Web caching? 7 8 2

Consistency Models Contract between processes and data store Guarantees on the view of data store visible to each process What writes will be visible to whom and when? Consistency Models Data-centric consistency models How to provide consistent views of the data store to all replicas? Typically assumes multiple concurrent writes/reads Client-centric consistency models How to provide consistent views of the data store to a client? Typically assumes limited concurrent writes, but client can move 9 10 Data-Centric Consistency Models Defined in terms of the values stored in the replicas How much can the values differ from each other? Consistency can be defined in terms of: Ordering of reads/writes Deviation in numerical values or staleness of replicas Ordering-based Consistency Different processes read and write to replicas of shared data concurrently What ordering will these reads and writes appear to different processes? 11 12 3

Strict Consistency Any read to x returns the most recent write to x Assumes notion of absolute global time W(x)a W(x)a R(x)NIL Sequential Consistency All processes see the same sequence of operations Each process s operations appear in program order Any valid interleaving of multiple process operations No notion of absolute time W(x)a W(x)b W(x)a W(x)b R(x)b Is it feasible in a distributed system? 13 14 Causal Consistency Causally related writes must be seen in the same order by all processes Concurrent writes can be seen in any order FIFO Consistency All writes from a process are seen in the same order by all processes Order is the order of issue Writes by different processes may be seen in different order W(x)a W(x)b W(x)c P3 R(x)b R(x)c P4 R(x)b R(x)c 15 16 4

Synchronization-based Consistency Many processes access shared data inside critical sections Do not care about all reads/writes to be consistent Only require values to be consistent at beginning and end of critical sections Do not need to pass intermediate updates Synchronization variables used to trigger data synchronizations Makes all copies consistent Weak Consistency At synchronization: All local writes are flushed out everywhere All remote writes are gathered in All accesses to synchronization variables are sequentially consistent Ensures sequential consistency on groups of operations W(x)a W(x)b S R(x)b S R(x)b P3 R(x)b S R(x)b 17 18 Variations of Weak Consistency Release Consistency: Separate synchronization operations for entry and exit from critical sections Gather remote writes on entry (acquire), flush out local writes on exit (release) Entry Consistency: Separate synchronization variable for each data item Avoids false sharing, multiple non-overlapping critical sections Summary of Ordering-based Data- Centric Consistency Models Strict: Absolute time-based Sequential: All processes see same order of operations Causal: Causally-related operations in same order FIFO: Ordered per-process basis Weak: Flush/gather at each synchronization 19 20 5

Continuous Consistency Consistency defined as a bound on deviations between replicas Bound on a continuous scale Could be numerical, time-based Conit: Consistency unit Data unit over which consistency is defined E.g.: Individual stocks in a stockticker, OR, whole set of stocks in an index What is the tradeoff between having a finegrained vs. coarse-grained conit? Continuous Consistency - Deviations Inconsistencies between replicas are measured in terms of deviations Numerical deviation: If data is numerical Absolute or relative Number of updates: Referred to as weight Staleness: How fresh is a replica? Must be updated with certain frequency 21 22 Eventual Consistency In absence of updates, all replicas converge towards identical copies Applied to a replicated data store with few updaters and many readers Only requirement: an update should eventually propagate to all replicas Nothing assumed about the timeliness of update propagation Cheap to implement E.g.: Web, DNS Client-Centric View of Data A client may only care about the data it is reading and writing E.g.: a user may only care about the posts on their Facebook wall These should be in consistent order. Can use: Data-centric consistency models. Problem? Eventual consistency model. Problem? 23 24 6

Client-Centric Consistency Models Defined in terms of the values seen by a single client at different replicas Assume: a client can move between replicas Useful for: Mobile applications Applications with multiple access points, e.g.: email Ordering-based consistency: In what order will a single client see its reads and writes on different replicas? Different combinations based on read vs. write ordering Monotonic Reads If a process reads a value of x, any successive read of x by it will return the same or a more recent value E.g.: Reading the posts from different locations L1 WS(x1) R(x1) WS(x1;x2) R(x2) L1 WS(x1) R(x1) WS(x2) R(x2) 25 26 Monotonic Writes If a process writes to x, this write will be completed before any successive write to x by it E.g.: All outgoing posts from different locations Read Your Writes A write to x by a process will always be seen by a successive read of x by it E.g.: You can see your earlier posts L1 W(x1) L1 W(x1) L1 W(x1) L1 W(x1) WS(x1) W(x2) W(x2) WS(x1; x2) R(x2) WS(x2) R(x2) 27 28 7

Writes Follow Reads If a process reads a value of x, any successive write to x by it will take place on the same or a more recent value Your post will reflect any postings you ve read earlier L1 WS(x1) R(x1) WS(x1;x2) W(x2) L1 WS(x1) R(x1) WS(x2) W(x2) Summary of Client-Centric Consistency Models Read first Write first Read next Monotonic Reads Read Your Writes Write next Writes Follow Reads Monotonic Writes 29 30 8