Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 720 Replication 1.

Similar presentations


Presentation on theme: "CIS 720 Replication 1."— Presentation transcript:

1 CIS 720 Replication 1

2 Replica Management 2

3 Three Subproblems Your boss says to you, “Our system is too slow, make it faster.” You decide that replication of servers is the answer. What do you do next? What are the questions that need to be answered? Where to place servers? Where to place content? What replication algorithm to use? 3

4 Placing Servers Given a set of N locations, how do you place the K servers? What are the goals? What is the metric that is being optimized? One algorithm, each time you place a server, minimize the average remaining distance to clients. What is “distance”? Is “average” the right thing to minimize? What if one client accesses a lot, the other not so much. 4

5 One-copy equivalence Conditions to ensure one-copy equivalence: - a read and a write operation cannot happen at the same time - two write operations cannot happen at the same time 5

6 Quorum based protocols
Each copy p has a weight weight(p) For each data item d, - read quorum r(d) - write quorum w(d) Read quorum = any set of copies whose combined weight is >= r(d) Write quorum = any set of copies whose combined weight is >= w(d) 6

7 A B C 3 2 2 Read quorum: 3 { (A), (B, C), (A, B), (A, C), (A,B, C) } Write quorum: 4 { (A, B), (A, C), (B, C), (A,B, C)}

8 To ensure one-copy equivalence, we use the following rules:
r(d) + w(d) > total(d) w(d) > total(d)/2 total(d) = sum of the weights of all the replicas 8

9 A B C 3 2 2 Read quorum: 3 Write quorum: 4

10 A timestamp for each variable is maintained at each replica
To write x, - lock a write quorum - let max be the largest timestamps in the quorum for x - write x with timestamp max + 1 to the quorum 10

11 - read data items from the read quorum
To read x, - lock a read quorum - read data items from the read quorum - return the value with the largest timestamp 11

12 Lock granting rules Two or more read locks can be granted concurrently on a replica Two write locks or a read lock and a write lock cannot be granted at the same time. 12

13 Avoid deadlocks Acquire locks in the increasing order of replica ids
13

14 Common quorum protocols
Majority consensus: weight(p) = 1; N copies r(d) = N/2 + 1; w(d) = N/2 + 1 Read one/write all weight(p) = 1 r(d) = 1; w(d) = N Write one/read all 14

15 Fault tolerance Majority consensus: tolerate up to N/2 failures
Read one/write all writes will be blocked on any failure 15

16 Mesh-based quorums


Download ppt "CIS 720 Replication 1."

Similar presentations


Ads by Google