Large-Scale Key-Value Stores Eventual Consistency Marco Serafini

Similar documents
CS Amazon Dynamo

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

SCALABLE CONSISTENCY AND TRANSACTION MODELS

Self-healing Data Step by Step

Dynamo: Amazon s Highly Available Key-Value Store

Dynamo: Amazon s Highly Available Key-value Store

Building Consistent Transactions with Inconsistent Replication

CAP Theorem, BASE & DynamoDB

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

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

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

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

10. Replication. Motivation

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

Presented By: Devarsh Patel

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

Transactions and ACID

Eventual Consistency Today: Limitations, Extensions and Beyond

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

EECS 498 Introduction to Distributed Systems

Integrity in Distributed Databases

DrRobert N. M. Watson

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Transactions. ACID Properties of Transactions. Atomicity - all or nothing property - Fully performed or not at all

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

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

Strong Consistency & CAP Theorem

Dynamo: Key-Value Cloud Storage

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

Causal Consistency and Two-Phase Commit

Scaling KVS. CS6450: Distributed Systems Lecture 14. Ryan Stutsman

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5.

CSE 530A ACID. Washington University Fall 2013

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

Apache Cassandra - A Decentralized Structured Storage System

Topics in Reliable Distributed Systems

EECS 498 Introduction to Distributed Systems

Megastore: Providing Scalable, Highly Available Storage for Interactive Services & Spanner: Google s Globally- Distributed Database.

Replication in Distributed Systems

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

CS6450: Distributed Systems Lecture 15. Ryan Stutsman

Haridimos Kondylakis Computer Science Department, University of Crete

SQL: Transactions. Introduction to Databases CompSci 316 Fall 2017

Databases. Laboratorio de sistemas distribuidos. Universidad Politécnica de Madrid (UPM)

Chapter 24 NOSQL Databases and Big Data Storage Systems

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

Scaling Out Key-Value Storage

Administration Naive DBMS CMPT 454 Topics. John Edgar 2

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich

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

Distributed Hash Tables Chord and Dynamo

Large-Scale Data Stores and Probabilistic Protocols

SQL: Transactions. Announcements (October 2) Transactions. CPS 116 Introduction to Database Systems. Project milestone #1 due in 1½ weeks

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

CS 655 Advanced Topics in Distributed Systems

Advances in Data Management - NoSQL, NewSQL and Big Data A.Poulovassilis

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS

The CAP theorem. The bad, the good and the ugly. Michael Pfeiffer Advanced Networking Technologies FG Telematik/Rechnernetze TU Ilmenau

Modern Database Concepts

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

Goal of the presentation is to give an introduction of NoSQL databases, why they are there.

CS October 2017

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

Lectures 8 & 9. Lectures 7 & 8: Transactions

CSE 444: Database Internals. Lecture 25 Replication

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

Transactions. 1. Transactions. Goals for this lecture. Today s Lecture

On the Study of Different Approaches to Database Replication in the Cloud

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

Why distributed databases suck, and what to do about it. Do you want a database that goes down or one that serves wrong data?"

TRANSACTION MANAGEMENT

PRIMARY-BACKUP REPLICATION

CAP and the Architectural Consequences

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 10: Transaction processing. November 14, Lecturer: Rasmus Pagh

Database Management Systems

CMPT 354: Database System I. Lecture 11. Transaction Management

CompSci 516 Database Systems

Introduction to NoSQL

NewSQL Database for New Real-time Applications

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

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

TAPIR. By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton

Building Consistent Transactions with Inconsistent Replication

Database Architectures

Eventual Consistency Today: Limitations, Extensions and Beyond

CSE 530A. Non-Relational Databases. Washington University Fall 2013

Lecture 21. Lecture 21: Concurrency & Locking

Intuitive distributed algorithms. with F#

Riak. Distributed, replicated, highly available

Distributed Hash Tables

Don t Give Up on Serializability Just Yet. Neha Narula

Distributed Systems (5DV147)

Transaction Management & Concurrency Control. CS 377: Database Systems

Synchronization. Chapter 5

Distributed Data Management Replication

Consistency and Replication. Why replicate?

References. NoSQL Motivation. Why NoSQL as the Solution? NoSQL Key Feature Decisions. CSE 444: Database Internals

SCALABLE CONSISTENCY AND TRANSACTION MODELS THANKS TO M. GROSSNIKLAUS

Transcription:

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini COMPSCI 590S Lecture 13

Goals of Key-Value Stores Export simple API put(key, value) get(key) Simpler and faster than a DBMS Less complexity, faster execution Varied forms of consistency Typically no support for transactions (multi-key) Sometimes even updates to the same key are not consistent 3 3

NoSQL Key-value stores are a typical NoSQL system Properties of NoSQL Do not require relational schema Do not use SQL Weak consistency 44

CAP: Three Properties Consider a distributed data store for key-value pairs Data is replicated for fault tolerance and latency Three properties are desirable Consistency: system behaves as if non-replicated Availability: every client request is served Partition tolerance: system can withstand network partitions 55

CAP Theorem C, A, P: pick two Examples A+C: Strongly consistent system, no P A+P: Weakly consistent system, no C C+P: Trivial (no A required, system does nothing) DBMS are typically A+C systems Replication is good for fault tolerance, bad for latency NoSQL stores are typically A+P Replication is good for latency, bad for consistency 66

ACID Properties Typical required properties of a DBMS Atomicity: All or nothing Consistency: Respect application invariants (e.g. balance > 0) Isolation: Transactions run as if no concurrency Durability: Committed transactions are persisted Consistency here has a different meaning! Consistency in CAP relates to Isolation in ACID 7

Consistency Properties Consider a service that offers certain operations Consistency constrains operation results Single-object service Linearizability: total order of operations, follows real-time Eventual consistency: eventual convergence when conflicts stop Many other semantics 8

Consistency with Multiple Objects Multi-object service with transactions Serializability: total order of transactions Strict serializability: total order of transactions, real-time Snapshot isolation: read from snapshots, forbid conflicts Many other semantics Today we focus on single-object (single-key) case 99

Example implementations Linearizability Paxos group Contact a majority quorum for every write Eventual Consistency Each storage node commits locally Commits are pushed asynchronously Conflicts are merged with deterministic criteria 1010

Dynamo Large scale key-value store Partitioned, fault tolerant Strict Service-Level Agreement (SLA) Upper bound on 99.9% percentile low latency This is called tail latency 111

Replication and Eventual Consistency Each key is replicated in a preference list of nodes Eventually consistent Updates go to first W healthy nodes in preference list Read and write quorums might not intersect Later reconciliation in presence of inconsistency If a node in preference list is not reachable, skip and try to recontact later (hinted handoff) 1212

Quorums Sequential consistency: W+R > N Weak consistency: W+R<=N Q: How to set W and R to achieve persistency with f crashes AND weak consistency? 1313

Versioning: Vector Clocks One entry per node Node increments its entry when updates v 1 > v 2 if every entry of v 1 is >= than the one of v 2 and at least one is > If two vectors cannot be ordered, conflict Figure 3: Version evolution of an object over time 1414