Eventual Consistency Today: Limitations, Extensions and Beyond

Similar documents
Eventual Consistency Today: Limitations, Extensions and Beyond

How Eventual is Eventual Consistency?

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

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

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

Conflict-free Replicated Data Types in Practice

Large-Scale Key-Value Stores Eventual Consistency Marco Serafini

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

SCALABLE CONSISTENCY AND TRANSACTION MODELS

Self-healing Data Step by Step

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

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

11. Replication. Motivation

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

Replication in Distributed Systems

10. Replication. Motivation

Strong Eventual Consistency and CRDTs

CS Amazon Dynamo

Distributed Key Value Store Utilizing CRDT to Guarantee Eventual Consistency

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

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

Conflict-free Replicated Data Types (CRDTs)

Consistency and Replication. Why replicate?

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

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

EECS 498 Introduction to Distributed Systems

Data Store Consistency. Alan Fekete

Lecture 6 Consistency and Replication

Alternative Data Models Toward NoSQL

Strong Eventual Consistency and CRDTs

CSE 5306 Distributed Systems. Consistency and Replication

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

INF-5360 Presentation

Distributed Data Management Replication

Design and Validation of Distributed Data Stores using Formal Methods

Last Class: Web Caching. Today: More on Consistency

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 }

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

Achieving the Potential of a Fully Distributed Storage System

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

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

Chapter 7 Consistency And Replication

Lasp: A Language for Distributed, Coordination-Free Programming

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

A Framework for Transactional Consistency Models with Atomic Visibility

DrRobert N. M. Watson

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

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

Designing and Evaluating a Distributed Computing Language Runtime. Christopher Meiklejohn Université catholique de Louvain, Belgium

Migrating Oracle Databases To Cassandra

Dynamo: Amazon s Highly Available Key-value Store

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

What Came First? The Ordering of Events in

Eventual Consistency 1

CSE 5306 Distributed Systems

Data Consistency Now and Then

Self Stabilization. CS553 Distributed Algorithms Prof. Ajay Kshemkalyani. by Islam Ismailov & Mohamed M. Ali

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

Basic vs. Reliable Multicast

(It s the invariants, stupid)

Ch06. NoSQL Part III.

Eventual Consistency. Eventual Consistency

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

Replication and Consistency. Fall 2010 Jussi Kangasharju

Distributed Systems (5DV147)

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Weak Consistency and Disconnected Operation in git. Raymond Cheng

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

Consistency and Replication

Introduction to Distributed Systems Seif Haridi

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

Recall: Primary-Backup. State machine replication. Extend PB for high availability. Consensus 2. Mechanism: Replicate and separate servers

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

Changing Requirements for Distributed File Systems in Cloud Storage

Probabilistically Bounded Staleness for Practical Partial Quorums

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

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

Choosing a MySQL HA Solution Today. Choosing the best solution among a myriad of options

Paxos and Raft (Lecture 21, cs262a) Ion Stoica, UC Berkeley November 7, 2016

TARDiS: A branch and merge approach to weak consistency

Distributed Systems. Lec 10: Distributed File Systems GFS. Slide acks: Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung

DISTRIBUTED EVENTUALLY CONSISTENT COMPUTATIONS

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

Replica Placement. Replica Placement

Virtual Synchrony. Jared Cantwell

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

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

BRANCH:IT FINAL YEAR SEVENTH SEM SUBJECT: MOBILE COMPUTING UNIT-IV: MOBILE DATA MANAGEMENT

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

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

Distributed Systems (ICE 601) Fault Tolerance

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

Strong Consistency & CAP Theorem

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

PRIMARY-BACKUP REPLICATION

Search: Advanced Topics and Conclusion

11/5/2018 Week 12-A Sangmi Lee Pallickara. CS435 Introduction to Big Data FALL 2018 Colorado State University

Building Consistent Transactions with Inconsistent Replication

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

Transcription:

Eventual Consistency Today: Limitations, Extensions and Beyond Peter Bailis and Ali Ghodsi, UC Berkeley Presenter: Yifei Teng Part of slides are cited from Nomchin Banga

Road Map Eventual Consistency: History and Concepts How eventual is eventual consistency? Programming eventual consistency Stronger than eventual Conclusions

CAP Theorem Maintaining single-system image has a cost Note that you can t sacrifice partition tolerance Consistency-availability tradeoffs Consistency-latency tradeoffs

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.

Compare SSI and Eventual Consistency The predictable order will not necessarily correspond to the execution order Order confusion Eventual consistency doesn t specify windows before converge Arbitrary value SSI provides eventual consistency, but not vice versa The eventual is immediate

Anti-entropy Anti-entropy policy Boardcast is the simpliest one Choose a winning when concurrent writes happen Asynchronous process Non blocking anti-entropy Broadcast

Great Properties Easy to implement: does not require writing difficult corner-case code to deal with complicated scenarios All operations complete locally: Low latency Systems can control the frequency of anti-entropy

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 system. Replicas will converge, but there are no guarantees with respect to what happens

Metrics and Mechanisms Metrics Window of consistency: How long for a write to be available to read? Version: How many version old will a returned value be? Mechanisms Measurement: How consistent is a store under the workload now? Prediction: How consistent will a store be under a given situation?

Probabilistically Bounded Staleness (PBS) Provide an expectation of recency for reads of data items 100 milliseconds after a write completes, 99.9 percent of reads will return the most recent version 85 percent of reads will return a version that is within two of the most recent Rate of anti-entropy Network Delay PBS Expected consistency Local process time

Eventual Consistency is good enough 13.6ms 202ms 500ms 200ms 12s

Programming Eventual Consistency Compensation: a way to achieve safety retroactively Restore guarantees to users Evaluate the benefit B: The benefit of weak consistency C: Cost of each compensation Maximize B - CR R: Rate of anomalies

Compensation by Design Compensation is error-prone and laborious Some researches provide compensation-free programming CALM theorem: consistency as logical monotonicity ACID 2.0: associativity, commutativity, idempotence, and distributed CRDT: commutative, replicated data types

CALM (Consistency as Logical Monotonicity) Monotonicity: compute an ever-growing set of facts and do not ever retract facts that they emit A program satisfies CALM can always be safely run on an eventually consistent store. Monotonic operations Initializing variables, add set members, and testing a threshold Non-monotonic operations variable overwrites, set deletion, counter resets, and negation

ACID 2.0 Associativity, commutativity, idempotence, and distributed Commutative and associative program can tolerate message re-ordering Idempotence allows the use of at-least-once message delivery Applying these design patterns can achieve logical monotonicity

CRDT (Commutative, Replicated Data Types ) CRDTs embodies CALM and ACID 2.0 principles Any program that correctly uses CRDTs is guaranteed to avoid any safety violations. A key property is separating data store and application-level consistency concerns. Enjoy strong application level consistency And the benefits of weak distributed read/write consistency G-Counter is a typical example

Stronger than Eventual Compensation requires dealing with inconsistency outside of systems CRDT limites the operations an application can employ Research shows that no consistency model stronger than causal consistency is available in the presence of partitions Causality can be added to eventual consistency

Causal Consistency guarantees each process s write are seen in order, transitive data dependencies hold

Pushing the Limits Causality COPS, Eiger provide causality with low latency and high availability. Many eventual consistent applications can be augmented with causality Re-architecting weak isolation databases in distributed environment Keep the same ACID properties High availability

Recognizing the Limits A fundamental cost to remaining highly available and low latency Staleness guarantees are impossible in a highly available system give me the latest value Cannot maintain arbitrary global correctness constraints create an account with ID 50 if the account does not exist

Conclusions Eventual consistency improves availability and performance at the cost of guarantees Eventual consistency not perfect for every task, but good enough for many applications. And eventual consistency will be admired in the future because of its performance and availability

Thanks You!