Download
cis 720 n.
Skip this Video
Loading SlideShow in 5 Seconds..
CIS 720 PowerPoint Presentation

CIS 720

127 Vues Download Presentation
Télécharger la présentation

CIS 720

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. CIS 720 Replication

  2. Replica Management

  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?

  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.

  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

  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)

  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

  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

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

  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.

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

  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

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

  16. Mesh-based quorums