Eventual Consistency Today: Limitations, Extensions and Beyond

Similar documents
Eventual Consistency Today: Limitations, Extensions and Beyond

How Eventual is Eventual Consistency?

@ Twitter Peter Shivaram Venkataraman, Mike Franklin, Joe Hellerstein, Ion Stoica. UC Berkeley

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini

SCALABLE CONSISTENCY AND TRANSACTION MODELS

Bloom: Big Systems, Small Programs. Neil Conway UC Berkeley

Self-healing Data Step by Step

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

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

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

Achieving the Potential of a Fully Distributed Storage System

FIT: A Distributed Database Performance Tradeoff. Faleiro and Abadi CS590-BDS Thamir Qadah

Distributed Key Value Store Utilizing CRDT to Guarantee Eventual Consistency

Migrating Oracle Databases To Cassandra

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

10. Replication. Motivation

Design and Validation of Distributed Data Stores using Formal Methods

Data Store Consistency. Alan Fekete

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

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

CS Amazon Dynamo

Lock Granularity and Consistency Levels (Lecture 7, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley February 7, 2018

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

Conflict-free Replicated Data Types in Practice

Replication in Distributed Systems

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

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

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

Database Availability and Integrity in NoSQL. Fahri Firdausillah [M ]

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

Dynamo: Amazon s Highly Available Key-value Store

COURSE 1. Database Management Systems

Webinar Series TMIP VISION

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

Strong Eventual Consistency and CRDTs

Overview of Transaction Management

Alternative Data Models Toward NoSQL

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

Modern Database Concepts

TRANSACTION MANAGEMENT

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

Just-Right Consistency. Centralised data store. trois bases. As available as possible As consistent as necessary Correct by design

Last Class: Web Caching. Today: More on Consistency

DrRobert N. M. Watson

Consistency and Replication. Why replicate?

A Framework for Transactional Consistency Models with Atomic Visibility

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

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

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

Genie. Distributed Systems Synthesis and Verification. Marc Rosen. EN : Advanced Distributed Systems and Networks May 1, 2017

11. Replication. Motivation

Probabilistically Bounded Staleness for Practical Partial Quorums

Intro to Transaction Management

Transactions & Update Correctness. April 11, 2018

Transactions and ACID

Distributed Systems. 09. State Machine Replication & Virtual Synchrony. Paul Krzyzanowski. Rutgers University. Fall Paul Krzyzanowski

Distributed Systems. Catch-up Lecture: Consistency Model Implementations

Distributed Systems (5DV147)

Intuitive distributed algorithms. with F#

INF-5360 Presentation

Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitionin

DISTRIBUTED EVENTUALLY CONSISTENT COMPUTATIONS

Trade- Offs in Cloud Storage Architecture. Stefan Tai

Eventual Consistency 1

Conflict-free Replicated Data Types (CRDTs)

Distributed Data Store

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

Spotify. Scaling storage to million of users world wide. Jimmy Mårdell October 14, 2014

EECS 498 Introduction to Distributed Systems

Serializability of global history

Consumer-view of consistency properties: definition, measurement, and exploitation

CAP and the Architectural Consequences

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

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

This talk is about. Data consistency in 3D. Geo-replicated database q: Queue c: Counter { q c } Shared database q: Queue c: Counter { q c }

CS October 2017

Transaction Management & Concurrency Control. CS 377: Database Systems

doc. RNDr. Tomáš Skopal, Ph.D.

! Replication comes with consistency cost: ! Reasons for replication: Better performance and availability. ! Replication transforms client-server

Strong Eventual Consistency and CRDTs

CSE 444: Database Internals. Lectures 13 Transaction Schedules

Consistency and Scalability

ZHT: Const Eventual Consistency Support For ZHT. Group Member: Shukun Xie Ran Xin

Failures, Elections, and Raft

Basic vs. Reliable Multicast

Exam 2 Review. October 29, Paul Krzyzanowski 1

(It s the invariants, stupid)

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

Lecture 6 Consistency and Replication

Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services

FAQs Snapshots and locks Vector Clock

Overview. Introduction to Transaction Management ACID. Transactions

Technical Report TR Design and Evaluation of a Transaction Model with Multiple Consistency Levels for Replicated Data

Lasp: A Language for Distributed, Coordination-Free Programming

CSC 261/461 Database Systems Lecture 21 and 22. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

Introduction TRANSACTIONS & CONCURRENCY CONTROL. Transactions. Concurrency

h p:// Authors: Tomáš Skopal, Irena Holubová Lecturer: Mar n Svoboda, mar

Don t Give Up on Serializability Just Yet. Neha Narula

Coordination-Free Computations. Christopher Meiklejohn

Transcription:

Eventual Consistency Today: Limitations, Extensions and Beyond Peter Bailis and Ali Ghodsi, UC Berkeley - Nomchin Banga

Outline Eventual Consistency: History and Concepts How eventual is eventual consistency? Programming eventual consistency Stronger guarantees than eventual consistency Conclusion

Brewer s CAP Theorem Cost of maintaining a single-system image Cannot sacrifice partition tolerance Consistency-Availability trade-off Consistency-Latency trade-off

Eventual Consistency changes made to one copy eventually migrate to all. If all update activity stops, after a period of time all replicas of the database will converge to be logically equivalent: each copy of the database will contain, in a predictable order, the same documents; replicas of each document will contain the same fields.

Eventual v/s Strong Consistency EVENTUAL System can return any data Does not specify which value is eventually chosen Predictable order of execution may differ from that of a single system image database STRONG System will always return correct, consistent and last updated data Consistency is immediate Fixed set of rules for determining order of executions Window of inconsistency Single system image

Implementing Eventual Consistency Anti-entropy To ensure convergence, replicas must exchange information about which write they have seen Implicit Assumptions: system partitions eventually heal and converge, OR partitioned nodes eventually die Asynchronous all-to-all broadcast

Quantifying Eventual Consistency Metrics Time : how long will it take for writes to become visible for reads Version : how many versions old will a given read be Mechanisms Measurement : how consistent is my store under current workload Prediction : how consistent will my store be under a given workload and configuration

Benefits of Eventual Consistency Easy to implement no difficult corner cases to handle failed replicas and network partitions All operations complete locally low latency Data durability might be at risk write to multiple nodes Rate of anti-entropy determined by system

Safety and Liveness Safety nothing bad happens every value that is read was, at some point in time, written to the database Liveness all requests eventually receive a response Eventual Consistency is purely a liveness property. Replicas agree but there are no guarantees with respect to what happens

Probabilistic Bounded Staleness Expectation of recency for reads of data items 100ms after a write completes, 99.9% of reads will return the most recent version 85% of reads will return a version that is within two of the most recent Degree of inconsistency determined by Rate of anti-entropy Network delay Local processing delay at each node

Inconsistency Window of Major DDBS 13.6 ms 200 ms 500 ms 202 ms 12 s Eventual Consistency is good enough

Designing Eventually Consistent System Compensation way to achieve safety retroactively Choosing Eventually Consistent system Benefit of weak consistency Cost of each inconsistency anomaly Rate of anomalies Maximize B-CR Design for compensation Need for compensation Possible anomalies and the correct apologies

Compensation by Design Programming for Compensation error prone State-of-the-art : compensation-free programming CALM/ACID 2.0 Consistency As Logical Monotonicity CRDTs Commutative, Replicative Data Types

CALM/ACID 2.0 Monotonicity - programs compute an ever-growing set of facts and do not ever retract the facts they emit Monotonic programs provide safety guarantees Examples of operations Monotonic : Initializing variables, accumulating set members Non-monotonic : Variable overwrites, set deletion, counter resets

CALM/ACID 2.0 Programmers can use ACID 2.0 for achieving logical monotonicity ACID 2.0 Associativity, Commutativity, Idempotence, Distributed Associativity and Commutativity can tolerate message re-ordering in eventual consistency Idempotence allows at-least-once message delivery, instead of atmost-once

Commutative, Replicated Data Types (CRDT) Use CALM and ACID 2.0 within standard data types like graphs Example : increment-only counter replicated on two servers Separate data store and application-level consistency weak distributed read/write consistency strong application consistency semantic guarantee Existing systems that use CRDTs Statebox, Riak, Bloom language

Stronger than Eventual Causal Consistency guarantees each process s write are seen in order, transitive data dependencies hold P1: W(a) W(c) P2: R(a) W(b) R(c) P3: R(a) R(b) R(c) P4: R(a) R(b)

Stronger than Eventual Causal consistency Not possible to have a stronger model without violating high availability or high convergence Causality bolted-on top of eventual consistency (safety and liveness decoupled) COPS, Eiger systems less than 7% overhead for one of Facebook s workload Re-architecting distributed databases using ACID properties Transactional atomicity SQL Read Committed and Repeatable Read

Recognizing the Limits Inherent cost for choosing high availability and low latency Cannot maintain global correctness constraints Ex: Uniqueness requirements Cannot guarantee correctness constraints on individual data items Ex: Bank balance should be non-negative

Research Scope Re-thinking distributed transaction algorithms to incorporate stronger consistency models like Repeatable Reads Rule-based concurrency model for transactions in Cassandra that places a deterministic bound on predictable order of transactions Use CRDTs as a client-side enhancement in Spark to provide stronger safety guarantees

Thank You!