CAP + Clocks Time keeps on slipping, slipping…. Logistics Last week’s slides online Sign up on Piazza now – No really, do it now Papers are loaded in.

Slides:



Advertisements
Similar presentations
Dynamo: Amazon’s Highly Available Key-value Store
Advertisements

Impossibility of Distributed Consensus with One Faulty Process
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 6 Instructor: Haifeng YU.
Case Study - Amazon. Amazon r Amazon has many Data Centers r Hundreds of services r Thousands of commodity machines r Millions of customers at peak times.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
1 CS 194: Elections, Exclusion and Transactions Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
6.852: Distributed Algorithms Spring, 2008 Class 7.
Distributed Systems Overview Ali Ghodsi
Life after CAP Ali Ghodsi CAP conjecture [reminder] Can only have two of: – Consistency – Availability – Partition-tolerance Examples.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Announcements. Midterm Open book, open note, closed neighbor No other external sources No portable electronic devices other than medically necessary medical.
Consensus Algorithms Willem Visser RW334. Why do we need consensus? Distributed Databases – Need to know others committed/aborted a transaction to avoid.
Distributed Systems Spring 2009
LEADER ELECTION CS Election Algorithms Many distributed algorithms need one process to act as coordinator – Doesn’t matter which process does the.
Ordering and Consistent Cuts Presented By Biswanath Panda.
CS 582 / CMPE 481 Distributed Systems
1 Principles of Reliable Distributed Systems Lecture 5: Failure Models, Fault-Tolerant Broadcasts and State-Machine Replication Spring 2005 Dr. Idit Keidar.
1 Distributed Databases CS347 Lecture 16 June 6, 2001.
SynchronizationCS-4513, D-Term Synchronization in Distributed Systems CS-4513 D-Term 2007 (Slides include materials from Operating System Concepts,
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Mutual Consistency Detection of mutual inconsistency in distributed systems (Parker, Popek, et. al.) Distributed system with replication for reliability.
Synchronization in Distributed Systems CS-4513 D-term Synchronization in Distributed Systems CS-4513 Distributed Computing Systems (Slides include.
Ordering of events in Distributed Systems & Eventual Consistency Jinyang Li.
Ordering and Consistent Cuts Presented by Chi H. Ho.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Amazon’s Dynamo System The material is taken from “Dynamo: Amazon’s Highly Available Key-value Store,” by G. DeCandia, D. Hastorun, M. Jampani, G. Kakulapati,
Cloud Storage – A look at Amazon’s Dyanmo A presentation that look’s at Amazon’s Dynamo service (based on a research paper published by Amazon.com) as.
1. Big Data A broad term for data sets so large or complex that traditional data processing applications ae inadequate. 2.
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Trade-offs in Cloud.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Data Versioning Lecturer.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
TRANSACTION MANAGEMENT R.SARAVANAKUAMR. S.NAVEEN..
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
An Efficient and Fault-Tolerant Solution for Distributed Mutual Exclusion by D. Agrawal, A.E. Abbadi Presentation by Peter Tsui for COEN 317, F/03.
CSE 486/586 Distributed Systems Consistency --- 3
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Advanced Database CS-426 Week 6 – Transaction. Transactions and Recovery Transactions A transaction is an action, or a series of actions, carried out.
Big Data Yuan Xue CS 292 Special topics on.
Reliability of Disk Systems. Reliability So far, we looked at ways to improve the performance of disk systems. Next, we will look at ways to improve the.
Storage Systems CSE 598d, Spring 2007 Lecture 13: File Systems March 8, 2007.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
Introduction Many distributed systems require that participants agree on something On changes to important data On the status of a computation On what.
CS 440 Database Management Systems
Greetings. Those of you who don't yet know me... Today is... and
Trade-offs in Cloud Databases
Dynamo: Amazon’s Highly Available Key-value Store
Database Concepts.
CAP THEOREM Have the rules really changed?
CSE 486/586 Distributed Systems Consistency --- 3
EECS 498 Introduction to Distributed Systems Fall 2017
CS 440 Database Management Systems
PERSPECTIVES ON THE CAP THEOREM
Distributed Transactions
EECS 498 Introduction to Distributed Systems Fall 2017
Causal Consistency and Two-Phase Commit
Transaction Properties: ACID vs. BASE
Chapter 5 (through section 5.4)
CSE 486/586 Distributed Systems Consistency --- 3
Presentation transcript:

CAP + Clocks Time keeps on slipping, slipping…

Logistics Last week’s slides online Sign up on Piazza now – No really, do it now Papers are loaded in HotCRP – Sign up for account at – I will make you a PC member so you can enter “reviews” – Do review preferences

Logistics (2) Some changes to the schedule – NENS field trip – Moved other stuff down Don’t forget about project proposals – Details on content on the website

Logistics (3) Audit policy – You must present at least one paper – You must read all of them and contribute to the discussion (no dead weight) – No project or project presentation requirement

CAP “Theorem” and Implications

Desirable properties of data systems ACID transactions – Atomic: Either all of the transaction happens or none – Consistent: After a transaction, all uniqueness properties are maintained – Isolation: One transaction does not affect another – Durable: Once complete, the transaction remains complete

Move to distributed environment CAP – Consistency: updates to data are applied to all or none – Availability: must be able to access all data – Partitions: failures can partition network into subtrees Why should we want all three? Is it possible?

Eric Brewer’s CAP “theorem” The Brewer Conjecture – No system can simultaneously achieve C and A and P – Implication: must perform tradeoffs to obtain 2 at the expense of the 3rd – Never published, but widely recognized

CAP Examples 9 Write (key, 1) Replicate (key, 2) Read  Availability – Client can always read Impact of partitions – Not consistent (key, 1) Write (key, 1) Replicate (key, 2) Read  Consistency  Reads always return accurate results  Impact of partitions  No availability Error: Service Unavailable A+P C+P What about C+A? Doesn’t really exist Partitions are always possible Tradeoffs must be made to cope with them

Proof of Theorem Strong proof when no clocks – No way to reliably stay consistent What changes with clocks?

Weak consistency Use clocks, impose partial ordering – Allows a form of “eventual consistency” Key result that drives many of today’s systems – “return most of the data most of the time” – “usually correct results” Where is this not ok?

12 years later: Have the “rules” changed? What if partitions are rare? – Then most of the time C/A are maintained CAP don’t need to be binary properties Choosing between C or A is not a fixed decision, can change over time

How long is the partition? We can’t “choose” to never have P – But we can put constraints on how the system operates within some threshold time – Primary partitions enable partial availability – But require knowing invariants to reconcile consistency after partition is done

So what do you do when there is a partition? Detection Enter “partition mode” – Why? Recover after partition is done – What are the challenges?

Recovery We’ve all done this – (CVS, SVN, git, hg) How does it work? – Commutative operations – Commutative replicated data types Special data types will come up again and again

Exercise Let’s match popular applications to consistency/availability models

Time and Clocks

Time It’s pretty important, eh? It marches on Only goes forward …

Time It defines a distributed system “…message transmission time is not negligible compared to the time between events in a single process”

Partial time ordering No way for all clocks to have exactly the same time all the time – Why? Instead, focus on a partial ordering – “happens before” relationship – use it to build a (arbitrary) total ordering – this does not use physical time What is the difference?

Scalar Clocks General technique described by Leslie Lamport – Explicitly maps out time as a sequence of version numbers at each participant (from 1978!!) Key idea – Each process maintains a counter (“clock”) – When it sends a message, it includes the counter – When receiving message, each process updates its clock to be greater than timestamp in message 21

Nice applications of Logical Clocks Fully distributed – Mutual exclusion – Fairness – Liveness

Physical clocks What do they give us?

Vector clocks The idea – A vector clock is a list of (node, counter) pairs – Every version of every object has one vector clock Detecting causality – If all of A’s counters are less-than-or-equal to all of B’s counters, then A is ancestor of B, and can be forgotten – Intuition: A was applied to every node before B was applied to any node. Therefore, A precedes B Use vector clocks to perform syntactic reconciliation

Simple Vector Clock Example Key features – Writes always succeed – Reconcile on read Possible issues – Large vector sizes – Need to be trimmed Solution – Add timestamps – Trim oldest nodes – Can introduce error D1 ([Sx, 1]) D2 ([Sx, 2]) D3 ([Sx, 2], [Sy, 1]) D4 ([Sx, 2], [Sz, 1]) D5 ([Sx, 2], [Sy, 1], [Sz, 1]) D5 ([Sx, 2], [Sy, 1], [Sz, 1]) Write by Sx Write by SzWrite by Sy Read  reconcile 25

Vector clock properties Isomorphic: Timestamps can be used to get causal ordering (and vice versa) Strong consistency Event counting Useful for distributed debugging, causal ordering, etc

Matrix time Add another dimension – Everyone has a consistent view of everyone else’s clock – Can be used to “prune” stale information

Take-aways Consistency, Availability, Partitions – Can we do them all together? – Depends on goals, time Time is relative – Order matters – Logical ordering and causality can give us total ordering consistency