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

Similar documents
CONSISTENT FOCUS. Building reliable distributed systems at a worldwide scale demands trade-offs between consistency and availability.

Dynamo: Amazon s Highly Available Key-value Store

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

Dynamo: Amazon s Highly Available Key-value Store

CAP Theorem, BASE & DynamoDB

CS655: Advanced Topics in Distributed Systems [Fall 2013] Dept. Of Computer Science, Colorado State University

SCALABLE CONSISTENCY AND TRANSACTION MODELS

The material in this lecture is taken from Dynamo: Amazon s Highly Available Key-value Store, by G. DeCandia, D. Hastorun, M. Jampani, G.

Distributed Hash Tables Chord and Dynamo

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

CSE-E5430 Scalable Cloud Computing Lecture 10

Reprise: Stability under churn (Tapestry) A Simple lookup Test. Churn (Optional Bamboo paper last time)

Eventual Consistency 1

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

11. Replication. Motivation

L22: NoSQL. CS3200 Database design (sp18 s2) 4/5/2018 Several slides courtesy of Benny Kimelfeld

Chapter 7 Consistency And Replication

CS Amazon Dynamo

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

A Cloud Storage Adaptable to Read-Intensive and Write-Intensive Workload

SCALABLE CONSISTENCY AND TRANSACTION MODELS THANKS TO M. GROSSNIKLAUS

CS 655 Advanced Topics in Distributed Systems

CS 138: Dynamo. CS 138 XXIV 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Dynamo: Amazon s Highly Available Key-value Store

DISTRIBUTED FILE SYSTEMS CARSTEN WEINHOLD

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

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey

DISTRIBUTED FILE SYSTEMS CARSTEN WEINHOLD

Distributed Systems (5DV147)

10. Replication. Motivation

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Final Exam Logistics. CS 133: Databases. Goals for Today. Some References Used. Final exam take-home. Same resources as midterm

NoSQL systems: sharding, replication and consistency. Riccardo Torlone Università Roma Tre

Improving Logical Clocks in Riak with Dotted Version Vectors: A Case Study

Load Balancing Technology Based On Consistent Hashing For Database Cluster Systems

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

Performance and Forgiveness. June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences

Dynamo: Key-Value Cloud Storage

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

Dynamo: Amazon s Highly- Available Key- Value Store

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

Report to Brewer s original presentation of his CAP Theorem at the Symposium on Principles of Distributed Computing (PODC) 2000

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

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

Module 7 - Replication

NoSQL Concepts, Techniques & Systems Part 1. Valentina Ivanova IDA, Linköping University

10.0 Towards the Cloud

A Transaction Model for Management for Replicated Data with Multiple Consistency Levels

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini

NoSQL and Database as a Service

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

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

Dynamo: Amazon s Highly Available Key-Value Store

CompSci 516 Database Systems

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

Lecture 6 Consistency and Replication

Eventual Consistency Today: Limitations, Extensions and Beyond

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

Replication in Distributed Systems

Eventual Consistency Today: Limitations, Extensions and Beyond

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

Frequently asked questions from the previous class survey

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

CS655: Advanced Topics in Distributed Systems [Fall 2013] Dept. Of Computer Science, Colorado State University

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2015 Lecture 14 NoSQL

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

4/9/2018 Week 13-A Sangmi Lee Pallickara. CS435 Introduction to Big Data Spring 2018 Colorado State University. FAQs. Architecture of GFS

Introduction to store data in Redis, a persistent and fast key-value database

Defining Weakly Consistent Byzantine Fault-Tolerant Services

Consistency & Replication in Distributed Systems

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

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Cassandra- A Distributed Database

CA464 Distributed Programming

Apache Cassandra - A Decentralized Structured Storage System

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

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

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

CS370: Operating Systems [Fall 2018] Dept. Of Computer Science, Colorado State University

Replication and Consistency

Selective Hearing: An Approach to Distributed, Eventually Consistent Edge Computation

Transactions and ACID

Data Management for Big Data Part 1

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

Riak. Distributed, replicated, highly available

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Chapter 6: Weak Isolation and Distribution

Building Consistent Transactions with Inconsistent Replication

Scaling Out Key-Value Storage

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Frequently asked questions from the previous class survey

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

Weak Consistency as a Last Resort

Distributed Systems. replication Johan Montelius ID2201. Distributed Systems ID2201

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

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

Dynamo. Smruti R. Sarangi. Department of Computer Science Indian Institute of Technology New Delhi, India. Motivation System Architecture Evaluation

Transcription:

CS 555: DISTRIBUTED SYSTEMS [REPLICATION & CONSISTENCY] Frequently asked questions from the previous class survey Shrideep Pallickara Computer Science Colorado State University L25.1 L25.2 Topics covered in this lecture Eventual Consistency Amazon Dynamo EVENTUALLY CONSISTENT Contents based on Werner Vogels: Eventually Consistent. ACM Queue 6(6): 14-19 (2008) L25.3 L25.4 Amazon systems use replication techniques ubiquitously Predictable performance Availability Replication helps with these goals, but Not necessarily transparent Under a number of conditions consequences of using replication techniques come to the fore Network partitions Node failures L25.5 L25.6 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.1

Ideal world One consistency model When an update is made all observers see that update Distribution transparency To the user of the system it appears as if there is only one system Instead of a number of collaborating systems Approach taken in such systems? Better to fail the complete system rather than break this transparency L25.7 L25.8 In the mid-90s these practices were revisited Larger internet systems For the first time, availability was being considered the most important property BREWER S CAP THEOREM L25.9 L25.10 Brewer s CAP Theorem By Eric Brewer in 2000 Three properties of shared-data systems 1 Data consistency 2 System availability 3 Tolerance to network partitions Brewer s CAP: Consequences In large-scale distributed systems, network partitions are common So, consistency and availability cannot be achieved at the same time Of these three only two can be achieved at a given time L25.11 L25.12 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.2

Two choices on what to drop Relax consistency to allow system to be available under partitionable conditions Make consistency a priority and the system will be unavailable under certain conditions The choices requires the developer to be aware of what is being offered by system If consistency is emphasized? Developer must account for system unavailability If a write fails? n Plan on what will be done with the data that must be written If availability is emphasized? System may always accept writes but n Under certain conditions a read will not reflect the results of a recently completed write L25.13 L25.14 The C in ACID is a different kind of consistency {Atomicity, Consistency, Isolation and Durability} When a transaction is finished, the database is in a consistent state For e.g., when money is transferred between two accounts? The total money in the two accounts should not change This kind of consistency is the responsibility of the developer writing the transaction Database assists via managing integrity constraints The I in ACID Isolation Ensures concurrent execution of transactions results in a final system state similar to what would be achieved if transactions were executed serially L25.15 L25.16 Consistency: Two ways to look at this Client-side How do clients observe updates? Server-side How do updates flow through the system? What guarantees can systems give with respect to updates? CLIENT-SIDE CONSISTENCY L25.17 L25.18 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.3

Client-side consistency [1/2] Consider a storage system Process A that writes and reads from the storage system Process B and C are independent of A Write and read from the storage system too Client-side consistency [2/2] How and when do observers (A, B, and C) see updates made to a data object? Strong consistency: After update completes, any subsequent access by (A, B, or C) will return updated value Weak consistency: No guarantee that subsequent accesses will return updated value Number of conditions to be met before value is returned L25.19 L25.20 The inconsistency window Period between The update and When any observer will always see the updated value Eventual consistency A form of weak consistency Storage system guarantees that if no new updates are made to the object? Eventually all accesses will return last updated value If no failures occur, size of the inconsistency window is determined by: Communication delays, system load, and number of replicas L25.21 L25.22 Eventual consistency variations Causal consistency Read-your-writes consistency Session consistency As long as session exists, system guarantees read-your-writes consistency Guarantees do not overlap sessions Monotonic read consistency Monotonic write consistency RDBMS implement replication in different modes Synchronous Replica update is part of the transaction Asynchronous Updates arrive at the backup in a delayed manner n Log shipping If primary fails before the logs were shipped? n Reading from promoted backup will produce old, inconsistent values L25.23 L25.24 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.4

Other RDBMS approaches to improve speed RDBMSs have also started to provide ability to read from backup Classic case of eventual consistency Size of the inconsistency window in such a setting? Periodicity of the log shipping SERVER SIDE CONSISTENCY L25.25 L25.26 Server-side consistency Based on how updates flow through the system N: Number of nodes that store replicas of data W: Number of replicas that need to acknowledge receipt of update before it completes R: Number of replicas that are contacted when data object is accessed through read operation W+R > N? The write-set and read-set overlap Possible to guarantee strong consistency Primary-backup RDBMS With synchronous replication n N=2, W=2 and R =1 n Client always reads a consistent answer With asynchronous replication n N=2, W=1 and R=1 n Consistency cannot be guaranteed L25.27 L25.28 In distributed storage systems the number of replicas is higher than two Systems that focus on fault tolerance use N=3 With W=2 and R=2 Systems that serve very high read loads Replicate data beyond what is needed for fault tolerance N can 10s to 100s of nodes R will be set to 1 n A single read will return the result For consistency W=N for updates n Decreases the probability of write succeeding For systems concerned about fault tolerance but not consistency W=1 Minimal durability Rely on lazy (epidemic) techniques to update other replicas L25.29 L25.30 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.5

Configuring values of N, R and W Depends on the common case Performance path that needs to be optimized If R=1 and N=W? We optimize for the read case If W=1 and R=N? We optimize for a very fast write Durability is not guaranteed If W < (N+1)/2 there is a possibility of conflicting writes when the writesets do not overlap Weak/eventual consistency Arises when W+ R <= N Possibility that the read and write set will not overlap If its deliberate and not based on failure cases? Hardly makes sense to set R to anything but 1 L25.31 L25.32 Weak/eventual consistency: Two common cases where R=1 Massive replication for read scaling When data access is more complicated In simple <key, value> systems easy to compare versions to determine latest written value When set of objects are returned, reasoning gets more complicated When partitions occur Some nodes cannot reach a set of other nodes With a classic majority quorum approach Partition that has W nodes of the replica set continues to take updates The other partition becomes unavailable L25.33 L25.34 For some applications unavailability of partitions is unacceptable Important that clients, that reach a partition, can progress Merge operation is executed when partition heals Amazon shopping-cart? Write-always system Customer can continue to put items in the cart even when original cart lives on other partitions DYNAMO: AMAZON S HIGHLY AVAILABLE MATERIAL BASED ON: KEY-VALUE STORE Giuseppe DeCandia, Deniz Hastorun, Madan Jampani, Gunavardhan Kakulapati, Avinash Lakshman, Alex Pilchin, Swaminathan Sivasubramanian, Peter Vosshall, Werner Vogels: Dynamo: Amazon's Highly Available Key-value Store. SOSP 2007: 205-220 L25.35 L25.36 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.6

Lesson learned at Amazon: Reliability & Scalability depends on Application state & How it is managed Amazon architecture Service oriented architecture (SOA) Decentralized Loosely-coupled Hundreds of services up and running Needs storage scheme that is always available E.g. Shopping cart service n Must be able to read/write from its data store L25.37 L25.38 Amazon s operational requirements Performance Scalable Reliability Financial consequences Impacts customer trust Storage technologies at Amazon Simple Storage Service (S3) SimpleDB Distributed database Written in Erlang Dynamo L25.39 L25.40 The contents of this slide-set are based on the following references Distributed Systems: Principles and Paradigms. Andrew S. Tanenbaum and Maarten Van Steen. 2nd Edition. Prentice Hall. ISBN: 0132392275/978-0132392273. [Chapter 7] Werner Vogels: Eventually Consistent. ACM Queue 6(6): 14-19 (2008) Giuseppe DeCandia, Deniz Hastorun, Madan Jampani, Gunavardhan Kakulapati, Avinash Lakshman, Alex Pilchin, Swaminathan Sivasubramanian, Peter Vosshall, Werner Vogels: Dynamo: Amazon's Highly Available Key-value Store. SOSP 2007: 205-220 L25.41 SLIDES CREATED BY: SHRIDEEP PALLICKARA L25.7