Replications and Consensus

Size: px
Start display at page:

Download "Replications and Consensus"

Transcription

1 CPSC 426/526 Replications and Consensus Ennan Zhai Computer Science Department Yale University

2 Recall: Lec-8 and 9 In the lec-8 and 9, we learned: - Cloud storage and data processing - File system: Google file system - MapReduce - BigTable Google Application, e.g., Gmail MapReduce BigTable Google File System (GFS)

3 Lecture Roadmap Consistency Issues Consistency Models Two-Phase Commit Consensus Case Study: Paxos

4 Replication Technique Distributed systems replicate data across multiple servers - Replication provides fault-tolerance if servers fail - Allowing clients to access different servers potentially increasing scalability (max throughput) - What is the problem? Replica1 Replica2 Replica3 Server1 Server2 Server3

5 Replication Technique Distributed systems replicate data across multiple servers - Replication provides fault-tolerance if servers fail - Allowing clients to access different servers potentially increasing scalability (max throughput) - What is the problem? Replica1 Replica2 Replica3 Server1 Server2 Server3

6 Replication Technique Distributed systems replicate data across multiple servers - Replication provides fault-tolerance if servers fail - Allowing clients to access different servers potentially increasing scalability (max throughput) - What is the problem? Client (Beijing) Replica1 Replica2 Replica3 Client (DC) Server1 Server2 Server3

7 Replication Technique Distributed systems replicate data across multiple servers - Replication provides fault-tolerance if servers fail - Allowing clients to access different servers potentially increasing scalability (max throughput) - What is the problem? Client (Beijing) Replica1 Replica2 Replica3 Client (DC) Server1 Server2 Server3

8 Consistency Problem Client (Beijing) X=0 X=0 X=0 Client (DC) Server1 Server2 Server3

9 Consistency Problem Client (Beijing) W(X,1) X=0 X=0 X=0 Client (DC) Server1 Server2 Server3

10 Consistency Problem R(X) = 1 or 0? Client (Beijing) W(X,1) X=1 X=? X=? Client (DC) Server1 Server2 Server3

11 Consistency Problem Client W(X,1) X=1 X=1 X=1 R(X)=1 Client (DC) (Beijing) Server1 Server2 Server3

12 Consistency Problem Client W(X,1) X=1 X=1 X=1 R(X)=1 Client (DC) (Beijing) Server1 Server2 Server3 Client W(X,1) X=1 X=0 X=0 R(X)=0 Client (DC) (Beijing) Server1 Server2 Server3

13 Lecture Roadmap Consistency Issues Consistency Models Two-Phase Commit Consensus Case Study: Paxos

14 Consistency Models A consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, data will be consistent. A consistency model basically refers to the degree of consistency that should be maintained for the shared data. If a system supports the stronger consistency model, then the weaker consistency model is automatically supported. But stronger consistency models sacrifice more availability and fault tolerance.

15 Consistency Models A consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, data will be consistent. A consistency model basically refers to the degree of consistency that should be maintained for the shared data. If a system supports the stronger consistency model, then the weaker consistency model is automatically supported. But stronger consistency models sacrifice more availability and fault tolerance.

16 Consistency Models A consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, data will be consistent. A consistency model basically refers to the degree of consistency that should be maintained for the shared data. If a system supports the stronger consistency model, then the weaker consistency model is automatically supported. But stronger consistency models sacrifice more availability and fault tolerance.

17 Consistency Models A consistency model specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, data will be consistent. A consistency model basically refers to the degree of consistency that should be maintained for the shared data. If a system supports the stronger consistency model, then the weaker consistency model is automatically supported. But stronger consistency models sacrifice more availability and fault tolerance.

18 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Weaker Consistency Models Eventual consistency These models describe when and how different nodes in a distributed system view the order of operations

19 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Why we have so many consistency models? Causal consistency Eventual consistency Weaker Consistency Models They are used for different application scenarios that balance the trade-off between consistency/availability/fault-tolerance. These models describe when and how different nodes in a distributed system view the order of operations

20 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Weaker Consistency Models Eventual consistency These models describe when and how different nodes in a distributed system view the order of operations

21 Strict Consistency Strongest consistency model we will consider - Any read on a data item X returns value corresponding to result of the most recent write on X Need an absolute global time - Most recent needs to be unambiguous - Corresponds to when operation was issued - Impossible to implement in real-world (network delays)

22 Strict Consistency Strongest consistency model we will consider - Any read on a data item X returns value corresponding to result of the most recent write on X Need an absolute global time - Most recent needs to be unambiguous - Corresponds to when operation was issued - Impossible to implement in real-world (network delays) Server 1 Server 2 Server 3 W(x,a) 0=R(x) a=r(x)

23 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Weaker Consistency Models Eventual consistency These models describe when and how different nodes in a distributed system view the order of operations

24 Strong Consistency Provide behavior of a single copy of object: - Read should return the most recent write - Subsequent reads should return same value, until next write

25 Strong Consistency Provide behavior of a single copy of object: - Read should return the most recent write - Subsequent reads should return same value, until next write Telephone intuition: - 1. Alice updates Facebook post - 2. Alice calls Bob on phone: Check my Facebook post! - 3. Bob read s Alice s wall, sees her post

26 Strong Consistency? Server 1 Server 2 Server 3 write(a,1) success

27 Strong Consistency? write(a,1) Server 1 Server 2 Server 3 read(a) 1

28 Strong Consistency? write(a,1) Server 1 Server 2 Server 3 read(a) 1 Phone call: Ensures happens-before relationship, even though out-of-band communication

29 Strong Consistency? write(a,1) Server 1 Server 2 Server 3 read(a) 1 Cool idea: Delay responding to writes/ops until committed

30 Strong Consistency? This is buggy! Server 1 Server 2 write(a,1) Server 3 read(a) 1? or 0? - Isn t sufficient to return value of server3: It does not know precisely when op is globally committed - Instead: Need to actually order read operation

31 Strong Consistency? This is buggy! Server 1 Server 2 write(a,1) success Server 3 committed read(a) 1 - Isn t sufficient to return value of server3: It does not know precisely when op is globally committed - Instead: Need to actually order read operation

32 Strong Consistency!!! Server 1 Server 2 write(a,1) write success on all servers Server 3 read(a) 1 - Order all operations via (1) leader and (2) agreement

33 Strong Consistency = Linearizability Linearizability: - All servers execute all ops in some identical sequential order - Global ordering preserves each client s own local ordering - Global ordering preserves real-time guarantee All operations receive global time-stamp via a sync d clock If TS(x)<TS(y), then OP(x) precedes OP(y) in the sequence Once write completes, all later reads should return value of that write or value of later write Once read returns particular value, all later reads should return that value or value of later write

34 Intuition: Real-time ordering Server 1 Server 2 write(a,1) Server 3 committed read(a) 1 Once write completes, all later reads should return value of that write or value of later write Once read returns particular value, all later reads should return that value or value of later write

35 Intuition: Real-time ordering Server 1 Server 2 write(a,1) Server 3 committed read(a) 1 Once write completes, all later reads should return value of that write or value of later write Once read returns particular value, all later reads should return that value or value of later write

36 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Eventual consistency Weaker Consistency Models These models describe when and how different nodes in a distributed system view the order of operations

37 Weaker: Sequential Consistency Sequential = linearizability - real-time ordering

38 Weaker: Sequential Consistency Sequential = linearizability - real-time ordering Linearizability: - All servers execute all ops in some identical sequential order - Global ordering preserves each client s own local ordering - Global ordering preserves real-time guarantee All operations receive global time-stamp via a sync d clock If TS(x)<TS(y), then OP(x) precedes OP(y) in the sequence

39 Weaker: Sequential Consistency Sequential = linearizability - real-time ordering Linearizability Sequential: - All servers execute all ops in some identical sequential order - Global ordering preserves each client s own local ordering - Global ordering preserves real-time guarantee All operations receive global time-stamp via a sync d clock If TS(x)<TS(y), then OP(x) precedes OP(y) in the sequence

40 Weaker: Sequential Consistency Sequential consistency: All (read/write) operations on data store were executed in some sequential order, and the operations of each individual process appear in this sequence With concurrent ops, reordering of ops acceptable, but all servers must see same order: - linearizability cares about time but sequential consistency cares about program order

41 Sequential Consistency write(a,1) Server 1 Server 2 Server 3 read(a) 0 In this example, system orders read(a) before write(a, 1)

42 Implementing Sequential Consistency Nodes use vector clocks to determine if two events had distinct happens-before relationship: - lf timestamp(a) < timestamp(b) => a b If ops are concurrent (i,j, a[i]<b[i] and a[j]>b[j]): - Hosts can order ops a, b arbitrarily but consistently OP2 OP4 OP1 OP3

43 Building Block: Vector Clock Initially all clocks are zero Each time a process experiences an internal event, it increments its own logical clock in the vector by one Each time for a process to send a message, it increments its own clock and then sends a copy of its own vector Each time a process receives a message, it increments its own logical clock by one and updates each element in its vector by max(own, received)

44 Building Block: Vector Clock A A:0 B B:0 C C:0

45 Building Block: Vector Clock A A:0 B B:0 B:1 C:1 C C:0 C:1

46 Building Block: Vector Clock A A:0 A:1 B:2 C:1 B B:0 B:1 C:1 B:2 C:1 C C:0 C:1

47 Building Block: Vector Clock A A:0 A:1 B:2 C:1 A:2 B:2 C:1 B B:0 B:1 C:1 B:2 C:1 B:3 C:1 A:2 B:4 C:1 C C:0 C:1 B:3 C:2

48 Building Block: Vector Clock A A:0 A:1 B:2 C:1 A:2 B:2 C:1 A:3 B:3 C:3 B B:0 B:1 C:1 B:2 C:1 B:3 C:1 A:2 B:4 C:1 C C:0 C:1 B:3 C:2 B:3 C:3

49 Building Block: Vector Clock A A:0 B B:0 B:1 C:1 A:1 B:2 C:1 B:2 C:1 B:3 C:1 A:2 B:2 C:1 A:2 B:4 C:1 A:2 B:5 C:1 A:3 B:3 C:3 C C:0 C:1 B:3 C:2 B:3 C:3 A:2 B:5 C:4

50 Building Block: Vector Clock A A:0 B B:0 B:1 C:1 A:1 B:2 C:1 B:2 C:1 B:3 C:1 A:2 B:2 C:1 A:2 B:4 C:1 A:2 B:5 C:1 A:3 B:3 C:3 A:4 B:5 C:5 C C:0 C:1 B:3 C:2 B:3 C:3 A:2 B:5 C:4 A:2 B:5 C:5

51 Implementing Sequential Consistency Nodes use vector clocks to determine if two events had distinct happens-before relationship: - lf timestamp(a) < timestamp(b) => a b If ops are concurrent (i,j, a[i]<b[i] and a[j]>b[j]): - Hosts can order ops a, b arbitrarily but consistently OP2 OP4 OP1 OP3

52 Implementing Sequential Consistency Host1: OP 1, 2, 3, 4 Host2: OP 1, 2, 3, 4 OP2 OP4 OP1 OP3

53 Implementing Sequential Consistency Host1: OP 1, 2, 3, 4 Host2: OP 1, 2, 3, 4 Host1: OP 1, 3, 2, 4 Host2: OP 1, 3, 2, 4 OP2 OP4 OP1 OP3

54 Implementing Sequential Consistency Host1: OP 1, 2, 3, 4 Host2: OP 1, 2, 3, 4 Host1: OP 1, 3, 2, 4 Host2: OP 1, 3, 2, 4 Host1: OP 1, 2, 3, 4 Host2: OP 1, 3, 2, 4 OP2 OP4 OP1 OP3

55 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) b=r(x) a=r(x) a=r(x) Is this valid sequential consistency? - It is, because Server 3 and 4 agree on order of ops

56 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) b=r(x) a=r(x) a=r(x) Is this valid sequential consistency? - It is, because Server 3 and 4 agree on order of ops

57 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) a=r(x) a=r(x) b=r(x) Is this valid sequential consistency? - No, because Server 3 and 4 do not agree on order of ops. - In practice, does not matter when events took place on different machine, as long as server agree on order

58 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) a=r(x) a=r(x) b=r(x) Is this valid sequential consistency? - No, because Server 3 and 4 do not agree on order of ops. - In practice, does not matter when events took place on different machine, as long as server agree on order

59 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) a=r(x) a=r(x) b=r(x) Is this valid sequential consistency? - No, because Server 3 and 4 do not agree on order of ops. - In practice, does not matter when events took place on different machine, as long as server agree on order Causal consistency

60 Sequential Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) b=r(x) a=r(x) a=r(x) A valid sequential consistency

61 Sequential Consistency W(x,a) Server 1 Server 2 Server 3 Server 4 W(x,b) b=r(x) b=r(x) a=r(x) a=r(x) A valid sequential consistency or not?

62 Sequential Consistency W(x,a) Server 1 Server 2 Server 3 Server 4 W(x,b) b=r(x) b=r(x) a=r(x) a=r(x) A valid sequential consistency or not? - No, because it does not preserve local ordering

63 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Eventual consistency Weaker Consistency Models Weak consistency model These models describe when and how different nodes in a distributed system view the order of operations

64 Causal consistency: Causal Consistency - Causal consistency is one of weak consistency models - Causally related writes must be seen by all processes in the same order - Concurrent writes may be seen in different orders on different machines

65 Causal Consistency Server 1 Server 2 W(x,a) a=r(x) W(x,b) Server 3 b=r(x) a=r(x) Server 4 a=r(x) b=r(x) Not valid Causally related writes must be seen by all processes in the same order

66 Causal Consistency Server 1 Server 2 Server 3 Server 4 W(x,a) W(x,b) b=r(x) a=r(x) a=r(x) b=r(x) Valid

67 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Eventual consistency Weaker Consistency Models Weak consistency model These models describe when and how different nodes in a distributed system view the order of operations

68 Eventual Consistency Eventual consistency: - Achieve high availability - If no new updates are made to a given data item, eventually all accesses to the data will return the last updated value. Eventual consistency is commonly used: - Git repo, iphone sync - Dropbox and Amazon Dynamo

69 Consistency Models Strict consistency Strong consistency (Linearizability) Sequential consistency Causal consistency Eventual consistency Weaker Consistency Models Weak consistency model These models describe when and how different nodes in a distributed system view the order of operations

70 Lecture Roadmap Consistency Issues Consistency Models Two-Phase Commit Consensus Case Study: Paxos

71 Two-Phase Commit Goal: Reliably agree to commit or abort a collection of sub-transactions All the operations happens at single master node - Concurrent machines - Failure and recovery of machines Achieve strong consistency!

72 Intuitive Example You want to organize outing with 3 friends at 6pm Tue - Go out only if all friends can make it What do you do? - Call each of them and ask if can do 6pm Tue (voting phase) - If all can do Tue, call each friend back to ACK (commit) - If one cannot do Tue, call others to cancel (abort)

73 Intuitive Example You want to organize outing with 3 friends at 6pm Tue - Go out only if all friends can make it What do you do? - Call each of them and ask if can do 6pm Tue (voting phase) - If all can do Tue, call each friend back to ACK (commit) - If one cannot do Tue, call others to cancel (abort) This is exactly how two-phase commit works

74 Two-Phase Commit Protocol Phase 1: Voting phase - Get commit agreement from every participant - A single no response means that we will have to abort Coordinator commit? commit? commit? commit? Participant Participant Participant Participant

75 Two-Phase Commit Protocol Phase 1: Voting phase - Get commit agreement from every participant - A single no response means that we will have to abort yes yes Participant Participant Coordinator yes yes Participant Participant

76 Two-Phase Commit Protocol Phase 1: Voting phase - Get commit agreement from every participant - A single no response means that we will have to abort yes yes Participant Participant Coordinator yes yes Participant Participant

77 Two-Phase Commit Protocol Phase 2: Commit phase - Send the results of the vote to every participant - Send abort if any participant voted no in Phase 1 Coordinator commit commit commit commit Participant Participant Participant Participant

78 Two-Phase Commit Protocol Phase 2: Commit phase - Get committed acknowledgements from every participant - A single no response means that we will have to abort ack ack Participant Participant Coordinator ack ack Participant Participant

79 Two-Phase Commit Protocol Two-phase commit assumes a fail-recover model - Any failed system will eventually recover A recovered system cannot change its mind - If a node agreed to commit and then crashed, it must be willing and able to commit upon recovery If the leader fails? - Lose availability: system not longer live

80 Two-Phase Commit Protocol

81 Lecture Roadmap Consistency Issues Consistency Models Two-Phase Commit Consensus Case Study: Paxos

82 Consensus / Agreement Problem Definition: - A general agreement about something - An idea or opinion that is shared by all the people in a group Given a set of processors, each with an initial value: - Termination: All non-faulty processes eventually decide on a value - Agreement: All processes that decide do so on the same value - Validity: The value that has been decided must have proposed by some process

83 Consensus / Agreement Problem Goal: N processes want to agree on a value Correctness (safety): - All N nodes agree on the same value - The agreed value has been proposed by some node Fault-tolerance: - If <= F faults in a window, consensus reached eventually - Liveness not guaranteed: If > F faults, no consensus - Given goal of F, what is N? Depends on fault model ( Crash fault need 2F+1; Byzantine fault needs 3F+1)

84 Consensus / Agreement Problem Goal: N processes want to agree on a value Correctness (safety): - All N nodes agree on the same value - The agreed value has been proposed by some node Fault-tolerance: - If <= F faults in a window, consensus reached eventually - Liveness not guaranteed: If > F faults, no consensus - Given goal of F, what is N? Depends on fault model ( Crash fault need 2F+1; Byzantine fault needs 3F+1)

85 Consensus / Agreement Problem Goal: N processes want to agree on a value Correctness (safety): - All N nodes agree on the same value - The agreed value has been proposed by some node Fault-tolerance: - If <= F faults in a window, consensus reached eventually - Liveness not guaranteed: If > F faults, no consensus - Given goal of F, what is N? Depends on fault model ( Crash fault need 2F+1; Byzantine fault needs 3F+1)

86 Lecture Roadmap Consistency Issues Consistency Models Two-Phase Commit Consensus Case Study: Paxos

87 Paxos

88 Paxos Safety: - Only a single value is chosen - Only a proposed value can be chosen - Only chosen values are learned by processes Liveness: - Some proposed value eventually chosen if fewer than half of processes fail - If value is chosen, a process eventually learns it

89 Three conceptual roles: Paxos - Proposers: propose values - Acceptors: accept values, where chosen if majority accept - Learners: learn the outcome (the chosen value) In reality, a process can play any/all roles Ordering: proposal is tuple [proposal #, value] = [n,v] - Proposal # strictly increasing, globally unique - Globally unique? Trick: set low-order bits to proposer s ID

90 Three conceptual roles: Paxos - Proposers: propose values - Acceptors: accept values, where chosen if majority accept - Learners: learn the outcome (the chosen value) In reality, a process can play any/all roles Ordering: proposal is tuple [proposal #, value] = [n,v] - Proposal # strictly increasing, globally unique - Globally unique? Trick: set low-order bits to proposer s ID

91 Three conceptual roles: Paxos - Proposers: propose values - Acceptors: accept values, where chosen if majority accept - Learners: learn the outcome (the chosen value) In reality, a process can play any/all roles Ordering: proposal is tuple [proposal #, value] = [n,v] - Proposal # strictly increasing, globally unique - Globally unique? Trick: set low-order bits to proposer s ID

92 Paxos Proposer A Proposer B Acceptor A Acceptor B Acceptor C Learner Prepare request [n=2, v=5]

93 Paxos Proposer A Proposer B Acceptor A Prepare request [n=2, v=5] [n=2, v=5] Acceptor B [n=2, v=5] Acceptor C Learner

94 Paxos Proposer A Proposer B Acceptor A Prepare request [n=2, v=5] [n=2, v=5] Prepare response [no previous] Prepare response [no previous] Acceptor B [n=2, v=5] Acceptor C Learner

95 Paxos Proposer A Proposer B Prepare request [n=2, v=5] Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] Acceptor A [n=2, v=5] Acceptor B [n=2, v=5] Acceptor C Learner

96 Paxos Proposer A Proposer B Prepare request [n=2, v=5] Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] Acceptor A [n=2, v=5] Acceptor B [n=2, v=5] Acceptor C [n=4, v=8] Learner

97 Paxos Proposer A Proposer B Prepare request [n=2, v=5] Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] Prepare response [no previous] Acceptor A [n=2, v=5] Acceptor B [n=2, v=5] Acceptor C [n=4, v=8] Learner

98 Proposer A Proposer B Acceptor A Prepare request [n=2, v=5] [n=2, v=5] Paxos Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] Prepare response [n=2, v=5] Prepare response [n=2, v=5] Acceptor B [n=2, v=5] Acceptor C [n=4, v=8] Learner

99 Paxos Proposer A Proposer B Acceptor A Prepare request [n=2, v=5] [n=2, v=5] Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] [n=4, v=8] Accept request [n=4, v=8] Acceptor B [n=2, v=5] [n=4, v=8] Acceptor C Learner [n=4, v=8] [n=4, v=8]

100 Paxos Proposer A Proposer B Acceptor A Prepare request [n=2, v=5] [n=2, v=5] Prepare response [no previous] Prepare request [n=4, v=8] Prepare response [no previous] [n=4, v=8] Accept request [n=4, v=8] Acceptor B [n=2, v=5] [n=4, v=8] Acceptor C Learner [n=4, v=8] [n=4, v=8] Chosen value [v=8]

101 Paxos + Two-Phase Commit Use Paxos for view-change - If anybody notices current master unavailable, or one or more replicas unavailable - Propose view change Paxos to establish new group: Value agreed upon = <2PC Master, {2PC Replicas} >. Use two-phase commit for actual data - Writes go to master for two-phase commit - Reads go to acceptors and/or master

102 Distributed System Basics are done! UseNet [~1980] PageRank P2P lookup service Attacks in P2P systems P2P Computing Trust/Reputation Google file system & Xen MapReduce BigTable Firewall and NATs Cloud Computing

103 Next Lecture In the lec-11, I will cover: - Preserving privacy in the cloud - Basic cryptographic knowledge - CryptDB

Time and distributed systems. Just use time stamps? Correct consistency model? Replication and Consistency

Time and distributed systems. Just use time stamps? Correct consistency model? Replication and Consistency Correct consistency model? Replication and Consistency B COS 58: dvanced Computer Systems Lecture 3 Let s say and B send an op. ll readers see B? ll readers see B? Michael Freedman Some see B and others

More information

Strong Consistency & CAP Theorem

Strong Consistency & CAP Theorem Strong Consistency & CAP Theorem CS 240: Computing Systems and Concurrency Lecture 15 Marco Canini Credits: Michael Freedman and Kyle Jamieson developed much of the original material. Consistency models

More information

Strong Consistency and Agreement

Strong Consistency and Agreement 1 Lee Lorenz, Brent Sheppard Jenkins, if I want another yes man, I ll build one! Strong Consistency and Agreement COS 461: Computer Networks Spring 2011 Mike Freedman hap://www.cs.princeton.edu/courses/archive/spring11/cos461/

More information

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

CS6450: Distributed Systems Lecture 11. Ryan Stutsman Strong Consistency CS6450: Distributed Systems Lecture 11 Ryan Stutsman Material taken/derived from Princeton COS-418 materials created by Michael Freedman and Kyle Jamieson at Princeton University. Licensed

More information

CS6450: Distributed Systems Lecture 15. Ryan Stutsman

CS6450: Distributed Systems Lecture 15. Ryan Stutsman Strong Consistency CS6450: Distributed Systems Lecture 15 Ryan Stutsman Material taken/derived from Princeton COS-418 materials created by Michael Freedman and Kyle Jamieson at Princeton University. Licensed

More information

Consistency examples. COS 418: Distributed Systems Precept 5. Themis Melissaris

Consistency examples. COS 418: Distributed Systems Precept 5. Themis Melissaris Consistency examples COS 418: Distributed Systems Precept 5 Themis Melissaris Plan Midterm poll Consistency examples 2 Fill out this poll: http://tinyurl.com/zdeq4lr 3 Linearizability 4 Once read returns

More information

Replication in Distributed Systems

Replication in Distributed Systems Replication in Distributed Systems Replication Basics Multiple copies of data kept in different nodes A set of replicas holding copies of a data Nodes can be physically very close or distributed all over

More information

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

Distributed Systems. Lec 12: Consistency Models Sequential, Causal, and Eventual Consistency. Slide acks: Jinyang Li Distributed Systems Lec 12: Consistency Models Sequential, Causal, and Eventual Consistency Slide acks: Jinyang Li (http://www.news.cs.nyu.edu/~jinyang/fa10/notes/ds-eventual.ppt) 1 Consistency (Reminder)

More information

Recall our 2PC commit problem. Recall our 2PC commit problem. Doing failover correctly isn t easy. Consensus I. FLP Impossibility, Paxos

Recall our 2PC commit problem. Recall our 2PC commit problem. Doing failover correctly isn t easy. Consensus I. FLP Impossibility, Paxos Consensus I Recall our 2PC commit problem FLP Impossibility, Paxos Client C 1 C à TC: go! COS 418: Distributed Systems Lecture 7 Michael Freedman Bank A B 2 TC à A, B: prepare! 3 A, B à P: yes or no 4

More information

Versioning, Consistency, and Agreement

Versioning, Consistency, and Agreement Lee Lorenz, Brent Sheppard Jenkins, if I want another yes man, I ll build one! Versioning, Consistency, and Agreement COS 461: Computer Networks Spring 2010 (MW 3:00 4:20 in CS105) Mike Freedman hip://www.cs.princeton.edu/courses/archive/spring10/cos461/

More information

Causal Consistency and Two-Phase Commit

Causal Consistency and Two-Phase Commit Causal Consistency and Two-Phase Commit CS 240: Computing Systems and Concurrency Lecture 16 Marco Canini Credits: Michael Freedman and Kyle Jamieson developed much of the original material. Consistency

More information

CPSC 426/526. Cloud Computing. Ennan Zhai. Computer Science Department Yale University

CPSC 426/526. Cloud Computing. Ennan Zhai. Computer Science Department Yale University CPSC 426/526 Cloud Computing Ennan Zhai Computer Science Department Yale University Recall: Lec-7 In the lec-7, I talked about: - P2P vs Enterprise control - Firewall - NATs - Software defined network

More information

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

Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitionin Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitioning (Different data at different sites More space Better

More information

Cryptographic Systems

Cryptographic Systems CPSC 426/526 Cryptographic Systems Ennan Zhai Computer Science Department Yale University Recall: Lec-10 In lec-10, we learned: - Consistency models - Two-phase commit - Consensus - Paxos Lecture Roadmap

More information

Two phase commit protocol. Two phase commit protocol. Recall: Linearizability (Strong Consistency) Consensus

Two phase commit protocol. Two phase commit protocol. Recall: Linearizability (Strong Consistency) Consensus Recall: Linearizability (Strong Consistency) Consensus COS 518: Advanced Computer Systems Lecture 4 Provide behavior of a single copy of object: Read should urn the most recent write Subsequent reads should

More information

Distributed Systems Consensus

Distributed Systems Consensus Distributed Systems Consensus Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Consensus 1393/6/31 1 / 56 What is the Problem?

More information

Replication of Data. Data-Centric Consistency Models. Reliability vs. Availability

Replication of Data. Data-Centric Consistency Models. Reliability vs. Availability CIS 505: Software Systems Lecture Note on Consistency and Replication Instructor: Insup Lee Department of Computer and Information Science University of Pennsylvania CIS 505, Spring 2007 Replication of

More information

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

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf Distributed systems Lecture 6: distributed transactions, elections, consensus and replication Malte Schwarzkopf Last time Saw how we can build ordered multicast Messages between processes in a group Need

More information

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita Proseminar Distributed Systems Summer Semester 2016 Paxos algorithm stefan.resmerita@cs.uni-salzburg.at The Paxos algorithm Family of protocols for reaching consensus among distributed agents Agents may

More information

Consensus a classic problem. Consensus, impossibility results and Paxos. Distributed Consensus. Asynchronous networks.

Consensus a classic problem. Consensus, impossibility results and Paxos. Distributed Consensus. Asynchronous networks. Consensus, impossibility results and Paxos Ken Birman Consensus a classic problem Consensus abstraction underlies many distributed systems and protocols N processes They start execution with inputs {0,1}

More information

Recovering from a Crash. Three-Phase Commit

Recovering from a Crash. Three-Phase Commit Recovering from a Crash If INIT : abort locally and inform coordinator If Ready, contact another process Q and examine Q s state Lecture 18, page 23 Three-Phase Commit Two phase commit: problem if coordinator

More information

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

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication Important Lessons Lamport & vector clocks both give a logical timestamps Total ordering vs. causal ordering Other issues in coordinating node activities Exclusive access to resources/data Choosing a single

More information

Distributed Systems (5DV147)

Distributed Systems (5DV147) Distributed Systems (5DV147) Replication and consistency Fall 2013 1 Replication 2 What is replication? Introduction Make different copies of data ensuring that all copies are identical Immutable data

More information

Distributed Systems 11. Consensus. Paul Krzyzanowski

Distributed Systems 11. Consensus. Paul Krzyzanowski Distributed Systems 11. Consensus Paul Krzyzanowski pxk@cs.rutgers.edu 1 Consensus Goal Allow a group of processes to agree on a result All processes must agree on the same value The value must be one

More information

Exam 2 Review. October 29, Paul Krzyzanowski 1

Exam 2 Review. October 29, Paul Krzyzanowski 1 Exam 2 Review October 29, 2015 2013 Paul Krzyzanowski 1 Question 1 Why did Dropbox add notification servers to their architecture? To avoid the overhead of clients polling the servers periodically to check

More information

CS 425 / ECE 428 Distributed Systems Fall 2017

CS 425 / ECE 428 Distributed Systems Fall 2017 CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy) Nov 7, 2017 Lecture 21: Replication Control All slides IG Server-side Focus Concurrency Control = how to coordinate multiple concurrent

More information

Distributed Systems. replication Johan Montelius ID2201. Distributed Systems ID2201

Distributed Systems. replication Johan Montelius ID2201. Distributed Systems ID2201 Distributed Systems ID2201 replication Johan Montelius 1 The problem The problem we have: servers might be unavailable The solution: keep duplicates at different servers 2 Building a fault-tolerant service

More information

Security (and finale) Dan Ports, CSEP 552

Security (and finale) Dan Ports, CSEP 552 Security (and finale) Dan Ports, CSEP 552 Today Security: what if parts of your distributed system are malicious? BFT: state machine replication Bitcoin: peer-to-peer currency Course wrap-up Security Too

More information

Consensus, impossibility results and Paxos. Ken Birman

Consensus, impossibility results and Paxos. Ken Birman Consensus, impossibility results and Paxos Ken Birman Consensus a classic problem Consensus abstraction underlies many distributed systems and protocols N processes They start execution with inputs {0,1}

More information

Replication. Feb 10, 2016 CPSC 416

Replication. Feb 10, 2016 CPSC 416 Replication Feb 10, 2016 CPSC 416 How d we get here? Failures & single systems; fault tolerance techniques added redundancy (ECC memory, RAID, etc.) Conceptually, ECC & RAID both put a master in front

More information

Distributed Systems. 10. Consensus: Paxos. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 10. Consensus: Paxos. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 10. Consensus: Paxos Paul Krzyzanowski Rutgers University Fall 2017 1 Consensus Goal Allow a group of processes to agree on a result All processes must agree on the same value The value

More information

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

Performance and Forgiveness. June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences Performance and Forgiveness June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences Margo Seltzer Architect Outline A consistency primer Techniques and costs of consistency

More information

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol Global atomicity In distributed systems a set of processes may be taking part in executing a task Their actions may have to be atomic with respect to processes outside of the set example: in a distributed

More information

Consistency and Replication. Why replicate?

Consistency and Replication. Why replicate? Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency models Lecture 15, page 1 Why replicate? Data replication versus compute replication Data

More information

Consistency and Replication. Why replicate?

Consistency and Replication. Why replicate? Consistency and Replication Today: Introduction Consistency models Data-centric consistency models Client-centric consistency models Thoughts for the mid-term Lecture 14, page 1 Why replicate? Data replication:

More information

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems Consistency CS 475, Spring 2018 Concurrent & Distributed Systems Review: 2PC, Timeouts when Coordinator crashes What if the bank doesn t hear back from coordinator? If bank voted no, it s OK to abort If

More information

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

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1 Computing Parable The Archery Teacher Courtesy: S. Keshav, U. Waterloo Lecture 16, page 1 Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency

More information

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

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson Distributed systems Lecture 6: Elections, distributed transactions, and replication DrRobert N. M. Watson 1 Last time Saw how we can build ordered multicast Messages between processes in a group Need to

More information

EECS 498 Introduction to Distributed Systems

EECS 498 Introduction to Distributed Systems EECS 498 Introduction to Distributed Systems Fall 2017 Harsha V. Madhyastha Replicated State Machines Logical clocks Primary/ Backup Paxos? 0 1 (N-1)/2 No. of tolerable failures October 11, 2017 EECS 498

More information

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

TAPIR. By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton TAPIR By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton Outline Problem Space Inconsistent Replication TAPIR Evaluation Conclusion Problem

More information

Consensus in Distributed Systems. Jeff Chase Duke University

Consensus in Distributed Systems. Jeff Chase Duke University Consensus in Distributed Systems Jeff Chase Duke University Consensus P 1 P 1 v 1 d 1 Unreliable multicast P 2 P 3 Consensus algorithm P 2 P 3 v 2 Step 1 Propose. v 3 d 2 Step 2 Decide. d 3 Generalizes

More information

There Is More Consensus in Egalitarian Parliaments

There Is More Consensus in Egalitarian Parliaments There Is More Consensus in Egalitarian Parliaments Iulian Moraru, David Andersen, Michael Kaminsky Carnegie Mellon University Intel Labs Fault tolerance Redundancy State Machine Replication 3 State Machine

More information

Failures in Distributed Systems

Failures in Distributed Systems CPSC 426/526 Failures in Distributed Systems Ennan Zhai Computer Science Department Yale University Recall: Lec-14 In lec-14, we learned: - Difference between privacy and anonymity - Anonymous communications

More information

Recall use of logical clocks

Recall use of logical clocks Causal Consistency Consistency models Linearizability Causal Eventual COS 418: Distributed Systems Lecture 16 Sequential Michael Freedman 2 Recall use of logical clocks Lamport clocks: C(a) < C(z) Conclusion:

More information

Introduction to Distributed Systems Seif Haridi

Introduction to Distributed Systems Seif Haridi Introduction to Distributed Systems Seif Haridi haridi@kth.se What is a distributed system? A set of nodes, connected by a network, which appear to its users as a single coherent system p1 p2. pn send

More information

Causal Consistency. CS 240: Computing Systems and Concurrency Lecture 16. Marco Canini

Causal Consistency. CS 240: Computing Systems and Concurrency Lecture 16. Marco Canini Causal Consistency CS 240: Computing Systems and Concurrency Lecture 16 Marco Canini Credits: Michael Freedman and Kyle Jamieson developed much of the original material. Consistency models Linearizability

More information

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

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5. Question 1 What makes a message unstable? How does an unstable message become stable? Distributed Systems 2016 Exam 2 Review Paul Krzyzanowski Rutgers University Fall 2016 In virtual sychrony, a message

More information

Basic vs. Reliable Multicast

Basic vs. Reliable Multicast Basic vs. Reliable Multicast Basic multicast does not consider process crashes. Reliable multicast does. So far, we considered the basic versions of ordered multicasts. What about the reliable versions?

More information

Replication and Consistency

Replication and Consistency Replication and Consistency Today l Replication l Consistency models l Consistency protocols The value of replication For reliability and availability Avoid problems with disconnection, data corruption,

More information

CS6450: Distributed Systems Lecture 13. Ryan Stutsman

CS6450: Distributed Systems Lecture 13. Ryan Stutsman Eventual Consistency CS6450: Distributed Systems Lecture 13 Ryan Stutsman Material taken/derived from Princeton COS-418 materials created by Michael Freedman and Kyle Jamieson at Princeton University.

More information

EECS 498 Introduction to Distributed Systems

EECS 498 Introduction to Distributed Systems EECS 498 Introduction to Distributed Systems Fall 2017 Harsha V. Madhyastha Dynamo Recap Consistent hashing 1-hop DHT enabled by gossip Execution of reads and writes Coordinated by first available successor

More information

Today: Fault Tolerance

Today: Fault Tolerance Today: Fault Tolerance Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Paxos Failure recovery Checkpointing

More information

Availability versus consistency. Eventual Consistency: Bayou. Eventual consistency. Bayou: A Weakly Connected Replicated Storage System

Availability versus consistency. Eventual Consistency: Bayou. Eventual consistency. Bayou: A Weakly Connected Replicated Storage System Eventual Consistency: Bayou Availability versus consistency Totally-Ordered Multicast kept replicas consistent but had single points of failure Not available under failures COS 418: Distributed Systems

More information

AGREEMENT PROTOCOLS. Paxos -a family of protocols for solving consensus

AGREEMENT PROTOCOLS. Paxos -a family of protocols for solving consensus AGREEMENT PROTOCOLS Paxos -a family of protocols for solving consensus OUTLINE History of the Paxos algorithm Paxos Algorithm Family Implementation in existing systems References HISTORY OF THE PAXOS ALGORITHM

More information

Today: Fault Tolerance. Fault Tolerance

Today: Fault Tolerance. Fault Tolerance Today: Fault Tolerance Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Paxos Failure recovery Checkpointing

More information

Memory Consistency. Minsoo Ryu. Department of Computer Science and Engineering. Hanyang University. Real-Time Computing and Communications Lab.

Memory Consistency. Minsoo Ryu. Department of Computer Science and Engineering. Hanyang University. Real-Time Computing and Communications Lab. Memory Consistency Minsoo Ryu Department of Computer Science and Engineering 2 Distributed Shared Memory Two types of memory organization in parallel and distributed systems Shared memory (shared address

More information

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

Chapter 4: Distributed Systems: Replication and Consistency. Fall 2013 Jussi Kangasharju Chapter 4: Distributed Systems: Replication and Consistency Fall 2013 Jussi Kangasharju Chapter Outline n Replication n Consistency models n Distribution protocols n Consistency protocols 2 Data Replication

More information

Replication and Consistency. Fall 2010 Jussi Kangasharju

Replication and Consistency. Fall 2010 Jussi Kangasharju Replication and Consistency Fall 2010 Jussi Kangasharju Chapter Outline Replication Consistency models Distribution protocols Consistency protocols 2 Data Replication user B user C user A object object

More information

DrRobert N. M. Watson

DrRobert N. M. Watson Distributed systems Lecture 15: Replication, quorums, consistency, CAP, and Amazon/Google case studies DrRobert N. M. Watson 1 Last time General issue of consensus: How to get processes to agree on something

More information

Recap. CSE 486/586 Distributed Systems Paxos. Paxos. Brief History. Brief History. Brief History C 1

Recap. CSE 486/586 Distributed Systems Paxos. Paxos. Brief History. Brief History. Brief History C 1 Recap Distributed Systems Steve Ko Computer Sciences and Engineering University at Buffalo Facebook photo storage CDN (hot), Haystack (warm), & f4 (very warm) Haystack RAID-6, per stripe: 10 data disks,

More information

Beyond FLP. Acknowledgement for presentation material. Chapter 8: Distributed Systems Principles and Paradigms: Tanenbaum and Van Steen

Beyond FLP. Acknowledgement for presentation material. Chapter 8: Distributed Systems Principles and Paradigms: Tanenbaum and Van Steen Beyond FLP Acknowledgement for presentation material Chapter 8: Distributed Systems Principles and Paradigms: Tanenbaum and Van Steen Paper trail blog: http://the-paper-trail.org/blog/consensus-protocols-paxos/

More information

CPS 512 midterm exam #1, 10/7/2016

CPS 512 midterm exam #1, 10/7/2016 CPS 512 midterm exam #1, 10/7/2016 Your name please: NetID: Answer all questions. Please attempt to confine your answers to the boxes provided. If you don t know the answer to a question, then just say

More information

Distributed Systems. Day 9: Replication [Part 1]

Distributed Systems. Day 9: Replication [Part 1] Distributed Systems Day 9: Replication [Part 1] Hash table k 0 v 0 k 1 v 1 k 2 v 2 k 3 v 3 ll Facebook Data Does your client know about all of F s servers? Security issues? Performance issues? How do clients

More information

Building Consistent Transactions with Inconsistent Replication

Building Consistent Transactions with Inconsistent Replication DB Reading Group Fall 2015 slides by Dana Van Aken Building Consistent Transactions with Inconsistent Replication Irene Zhang, Naveen Kr. Sharma, Adriana Szekeres, Arvind Krishnamurthy, Dan R. K. Ports

More information

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions CSE 544 Principles of Database Management Systems Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions Transactions Main issues: Concurrency control Recovery from failures 2 Distributed Transactions

More information

Building Consistent Transactions with Inconsistent Replication

Building Consistent Transactions with Inconsistent Replication Building Consistent Transactions with Inconsistent Replication Irene Zhang Naveen Kr. Sharma Adriana Szekeres Arvind Krishnamurthy Dan R. K. Ports University of Washington {iyzhang, naveenks, aaasz, arvind,

More information

Practice: Large Systems Part 2, Chapter 2

Practice: Large Systems Part 2, Chapter 2 Practice: Large Systems Part 2, Chapter 2 Overvie Introduction Strong Consistency Crash Failures: Primary Copy, Commit Protocols Crash-Recovery Failures: Paxos, Chubby Byzantine Failures: PBFT, Zyzzyva

More information

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems Transactions CS 475, Spring 2018 Concurrent & Distributed Systems Review: Transactions boolean transfermoney(person from, Person to, float amount){ if(from.balance >= amount) { from.balance = from.balance

More information

Distributed Consensus Protocols

Distributed Consensus Protocols Distributed Consensus Protocols ABSTRACT In this paper, I compare Paxos, the most popular and influential of distributed consensus protocols, and Raft, a fairly new protocol that is considered to be a

More information

Applications of Paxos Algorithm

Applications of Paxos Algorithm Applications of Paxos Algorithm Gurkan Solmaz COP 6938 - Cloud Computing - Fall 2012 Department of Electrical Engineering and Computer Science University of Central Florida - Orlando, FL Oct 15, 2012 1

More information

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

Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions Distributed Systems Day 13: Distributed Transaction To Be or Not to Be Distributed.. Transactions Summary Background on Transactions ACID Semantics Distribute Transactions Terminology: Transaction manager,,

More information

Lecture 6 Consistency and Replication

Lecture 6 Consistency and Replication Lecture 6 Consistency and Replication Prof. Wilson Rivera University of Puerto Rico at Mayaguez Electrical and Computer Engineering Department Outline Data-centric consistency Client-centric consistency

More information

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

Consistency: Relaxed. SWE 622, Spring 2017 Distributed Software Engineering Consistency: Relaxed SWE 622, Spring 2017 Distributed Software Engineering Review: HW2 What did we do? Cache->Redis Locks->Lock Server Post-mortem feedback: http://b.socrative.com/ click on student login,

More information

Distributed System. Gang Wu. Spring,2018

Distributed System. Gang Wu. Spring,2018 Distributed System Gang Wu Spring,2018 Lecture4:Failure& Fault-tolerant Failure is the defining difference between distributed and local programming, so you have to design distributed systems with the

More information

Distributed Systems Intro and Course Overview

Distributed Systems Intro and Course Overview Distributed Systems Intro and Course Overview COS 418: Distributed Systems Lecture 1 Wyatt Lloyd Distributed Systems, What? 1) Multiple computers 2) Connected by a network 3) Doing something together Distributed

More information

Data Consistency and Blockchain. Bei Chun Zhou (BlockChainZ)

Data Consistency and Blockchain. Bei Chun Zhou (BlockChainZ) Data Consistency and Blockchain Bei Chun Zhou (BlockChainZ) beichunz@cn.ibm.com 1 Data Consistency Point-in-time consistency Transaction consistency Application consistency 2 Strong Consistency ACID Atomicity.

More information

DISTRIBUTED COMPUTER SYSTEMS

DISTRIBUTED COMPUTER SYSTEMS DISTRIBUTED COMPUTER SYSTEMS CONSISTENCY AND REPLICATION CONSISTENCY MODELS Dr. Jack Lange Computer Science Department University of Pittsburgh Fall 2015 Consistency Models Background Replication Motivation

More information

CS October 2017

CS October 2017 Atomic Transactions Transaction An operation composed of a number of discrete steps. Distributed Systems 11. Distributed Commit Protocols All the steps must be completed for the transaction to be committed.

More information

Distributed Systems. Lec 11: Consistency Models. Slide acks: Jinyang Li, Robert Morris

Distributed Systems. Lec 11: Consistency Models. Slide acks: Jinyang Li, Robert Morris Distributed Systems Lec 11: Consistency Models Slide acks: Jinyang Li, Robert Morris (http://pdos.csail.mit.edu/6.824/notes/l06.txt, http://www.news.cs.nyu.edu/~jinyang/fa09/notes/ds-consistency.pdf) 1

More information

Topics in Reliable Distributed Systems

Topics in Reliable Distributed Systems Topics in Reliable Distributed Systems 049017 1 T R A N S A C T I O N S Y S T E M S What is A Database? Organized collection of data typically persistent organization models: relational, object-based,

More information

Intuitive distributed algorithms. with F#

Intuitive distributed algorithms. with F# Intuitive distributed algorithms with F# Natallia Dzenisenka Alena Hall @nata_dzen @lenadroid A tour of a variety of intuitivedistributed algorithms used in practical distributed systems. and how to prototype

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Distributed System Engineering: Spring Exam II

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Distributed System Engineering: Spring Exam II Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.824 Distributed System Engineering: Spring 2017 Exam II Write your name on this cover sheet. If you tear

More information

Distributed Algorithms Benoît Garbinato

Distributed Algorithms Benoît Garbinato Distributed Algorithms Benoît Garbinato 1 Distributed systems networks distributed As long as there were no machines, programming was no problem networks distributed at all; when we had a few weak computers,

More information

Fundamentals Large-Scale Distributed System Design. (a.k.a. Distributed Systems 1)

Fundamentals Large-Scale Distributed System Design. (a.k.a. Distributed Systems 1) Fundamentals Large-Scale Distributed System Design (a.k.a. Distributed Systems 1) https://columbia.github.io/ds1-class/ 1 Interested in... 1. scalable web services? 2. big data? 3. and the large-scale

More information

Viewstamped Replication to Practical Byzantine Fault Tolerance. Pradipta De

Viewstamped Replication to Practical Byzantine Fault Tolerance. Pradipta De Viewstamped Replication to Practical Byzantine Fault Tolerance Pradipta De pradipta.de@sunykorea.ac.kr ViewStamped Replication: Basics What does VR solve? VR supports replicated service Abstraction is

More information

Fault Tolerance via the State Machine Replication Approach. Favian Contreras

Fault Tolerance via the State Machine Replication Approach. Favian Contreras Fault Tolerance via the State Machine Replication Approach Favian Contreras Implementing Fault-Tolerant Services Using the State Machine Approach: A Tutorial Written by Fred Schneider Why a Tutorial? The

More information

Distributed Systems. Catch-up Lecture: Consistency Model Implementations

Distributed Systems. Catch-up Lecture: Consistency Model Implementations Distributed Systems Catch-up Lecture: Consistency Model Implementations Slides redundant with Lec 11,12 Slide acks: Jinyang Li, Robert Morris, Dave Andersen 1 Outline Last times: Consistency models Strict

More information

MDCC MULTI DATA CENTER CONSISTENCY. amplab. Tim Kraska, Gene Pang, Michael Franklin, Samuel Madden, Alan Fekete

MDCC MULTI DATA CENTER CONSISTENCY. amplab. Tim Kraska, Gene Pang, Michael Franklin, Samuel Madden, Alan Fekete MDCC MULTI DATA CENTER CONSISTENCY Tim Kraska, Gene Pang, Michael Franklin, Samuel Madden, Alan Fekete gpang@cs.berkeley.edu amplab MOTIVATION 2 3 June 2, 200: Rackspace power outage of approximately 0

More information

MYE017 Distributed Systems. Kostas Magoutis

MYE017 Distributed Systems. Kostas Magoutis MYE017 Distributed Systems Kostas Magoutis magoutis@cse.uoi.gr http://www.cse.uoi.gr/~magoutis Data-centric Consistency Models The general organization of a logical data store, physically distributed and

More information

Replication. Consistency models. Replica placement Distribution protocols

Replication. Consistency models. Replica placement Distribution protocols Replication Motivation Consistency models Data/Client-centric consistency models Replica placement Distribution protocols Invalidate versus updates Push versus Pull Cooperation between replicas Client-centric

More information

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

Distributed Systems. 09. State Machine Replication & Virtual Synchrony. Paul Krzyzanowski. Rutgers University. Fall Paul Krzyzanowski Distributed Systems 09. State Machine Replication & Virtual Synchrony Paul Krzyzanowski Rutgers University Fall 2016 1 State machine replication 2 State machine replication We want high scalability and

More information

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

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB s C. Faloutsos A. Pavlo Lecture#23: Distributed Database Systems (R&G ch. 22) Administrivia Final Exam Who: You What: R&G Chapters 15-22

More information

CS Amazon Dynamo

CS Amazon Dynamo CS 5450 Amazon Dynamo Amazon s Architecture Dynamo The platform for Amazon's e-commerce services: shopping chart, best seller list, produce catalog, promotional items etc. A highly available, distributed

More information

CSE 5306 Distributed Systems. Fault Tolerance

CSE 5306 Distributed Systems. Fault Tolerance CSE 5306 Distributed Systems Fault Tolerance 1 Failure in Distributed Systems Partial failure happens when one component of a distributed system fails often leaves other components unaffected A failure

More information

Differential Privacy

Differential Privacy CPSC 426/526 Differential Privacy Ennan Zhai Computer Science Department Yale University Recall: Lec-11 In lec-11, we learned: - Cryptographic basics - Symmetric key cryptography - Public key cryptography

More information

Consensus and related problems

Consensus and related problems Consensus and related problems Today l Consensus l Google s Chubby l Paxos for Chubby Consensus and failures How to make process agree on a value after one or more have proposed what the value should be?

More information

Paxos and Distributed Transactions

Paxos and Distributed Transactions Paxos and Distributed Transactions INF 5040 autumn 2016 lecturer: Roman Vitenberg Paxos what is it? The most commonly used consensus algorithm A fundamental building block for data centers Distributed

More information

CISC 7610 Lecture 2b The beginnings of NoSQL

CISC 7610 Lecture 2b The beginnings of NoSQL CISC 7610 Lecture 2b The beginnings of NoSQL Topics: Big Data Google s infrastructure Hadoop: open google infrastructure Scaling through sharding CAP theorem Amazon s Dynamo 5 V s of big data Everyone

More information

Consistency and Replication

Consistency and Replication Topics to be covered Introduction Consistency and Replication Consistency Models Distribution Protocols Consistency Protocols 1 2 + Performance + Reliability Introduction Introduction Availability: proportion

More information