1 / 34

Consistency and Replication

Consistency and Replication. Chapter 7. Part II Replica Management & Consistency Protocols. Replica Management. Replica-Server Placement Replica Placement: Where is a replica placed? When is a replica created? Who creates the replica? How do we distribute updates between replicas?

mele
Download Presentation

Consistency and Replication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols

  2. Replica Management • Replica-Server Placement • Replica Placement: • Where is a replica placed? • When is a replica created? • Who creates the replica? • How do we distribute updates between replicas? • Update propagation

  3. Types of Replicas

  4. Permanent Replicas • Initial set of replicas • Other replicas can be created from them • Small and static set • Example: Web site horizontal distribution • Replicate Web site on a limited number of machines on a LAN • Distribute request in round-robin • Replicate Web site on a limited number of machines on a WAN (mirroring) • Clients choose which sites to talk to

  5. Server-Initiated Replicas (1) • Dynamically created at the request of the owner of the DS • Example: push-based caches • Owners: web owners for CNN, Yahoo • Web hosting services: that provided by Akamai • Web hosting servers can dynamically create replicas close to the demanding client • Need dynamic policy to create, migrate and delete replicas

  6. Server-Initiated Replicas (2) Server P F Server Q • One is to keep track of Web page hits • Keep a counter and access-origin list for each page

  7. Server-Initiated Replicas (3) • Count access requests from different clients: cntQ(P, F), if it is more than ½ * requests for F at Q, then Q attempts to migrate F to P.

  8. Client-Initiated Replicas • These are caches • Temporary storage (expire fast) • Managed by clients • Cache hit: return data from cache • Cache miss: load copy from original server • Kept on the client machine, or on the same LAN • Multi-level caches

  9. Multi-Level Caches

  10. Design Issues for Update Propagation • A process modified a replica. • Based on the consistency model supported, the update is then propagated to all other replicas at its proper time • How to carry out update propagation and make two replicas consistent with each other? • Propagate state or operation • Pull or Push protocols • Unicast or multicast propagation

  11. State versus Operation Propagation (1) • Propagate a notification of update • Invalidate protocols • When data item x is changed at a replica, it is invalidated at other replicas • An attempt to read the item causes an “item-fault” triggering updating the local copy before the read can complete • Uses little network bandwidth • When is good to use this distribution protocol? • When read-to-write ratio is low or high? • Good when read-to-write ratio is low

  12. State versus Operation Propagation (2) When read-to-write ratio is high: • Transfer modified data or a log of changes • High network bandwidth usage • Propagate the update operation • Each replica must have a process capable of performing the update • Very low network bandwidth usage • Other trade-off between this two protocols?

  13. Pull versus Push • Push: updates are propagated to other replicas without solicitation • Typically, from permanent to server-initiated replicas • Used to achieve a high degree of consistency • Pull: A replica asks another for an update • Typically, from client-initiated replica • Inconsistent cache results in longer response time

  14. Pull versus Push Protocols A comparison between push-based and pull-based protocols in the case of multiple client, single server systems.

  15. Leases • Combined push and pull • A server promise • push updates for a certain time • a lease expires => the client • polls the server or requests a new lease • length of a lease? • different types of leases • age based: {time to last modification} • renewal-frequency based: long-lasting leases to active users • state-space overhead: increasing utilization of a server => lower expiration times of new leases

  16. Unicast versus Multicast • Unicast: a replica sends separate n-1 updates to every other replica • Multicast: a replica sends one update to multiple replicas • Network takes care of multicasting • Can be cheaper • Suits push-based protocols

  17. Consistency Protocols • Actual implementation of consistency models • For instance, how to implement sequential consistency? • Whether primary copy exists or not • Primary-based protocols • Replicated-write protocols

  18. Primary-Based Remote-Write Protocol • Primary copy and backups for each data item • Read from local copy • Write to the (remote) primary server • Update backups • Blocking vs. non-blocking update

  19. Primary-Based Remote-Write Protocol (cont.) The principle of primary-backup protocol.

  20. Sequential Consistency … process process process FIFO Channels Switch All Data Items (the set D)

  21. Primary-Based Remote-Write Protocol (cont.) Sequential consistency Read Your Writes The principle of primary-backup protocol.

  22. Primary-Based Remote-Write Protocol (cont.) X W3’ Sequential consistency Read Your Writes Sequential consistency Read Your Writes W3’X The principle of primary-backup protocol.

  23. Primary-Based Local Write Protocol • Primary copy and backups for each data item • Read from local copy • Move primary copy to local server and write to it • Update backups

  24. Primary-Based Local-Write Protocol (cont.) Sequential consistency Read Your Writes Example: Mobile PC  primary server for items to be needed Primary-backup protocol in which the primary migrates to the process wanting to perform an update.

  25. Which consistency protocol does DNS (Domain Name System) follows?

  26. No Primary Copy Replicated-Write Protocols • Active replication • Quorum-based protocol

  27. Ordering Guarantees • Updates sent from different processes may be delivered in different orders at different sites • Totally-ordered multicast • Causally-ordered multicast

  28. Ordering Guarantees • The sequencer approach • All requests must be sent to a sequencer, where they are given an identifier • The sequencer assigns consecutive increasing identifiers as it receives requests • Requests arriving at sites are held back until they are next in sequence

  29. Active Replication The problem of replicated invocations.

  30. Active Replication (cont.) Forwarding an invocation request from a replicated object. Returning a reply to a replicated object.

  31. Network Partitions • Primary-based • Remote-write protocol • Local-write protocol • Replicated-write protocol • Totally-ordered multicast approach • Sequencer approach • None of them work if network is partitioned!

  32. Network Partitions Well-known Solution: Quorum-Based Protocols • Idea? • Use Majority • Write • Read • Read • Retrieve number of replicas in read quorum • Select the one with the latest version. • Perform a read on it • Write • Retrieve number of replicas in write quorum. • Find the latest version and increment it. • Perform a write on the entire write quorum.

  33. Quorum-Based Protocols • N: Total #Replicas • NR: #Replicas in Read Quorum • NW: #Replicas in Write Quorum • Constraints: • NR + NW > N • NW > N/2

  34. Quorum-Based Protocols Three examples of the voting algorithm for N = 12 replicas (a) A correct choice of read and write set (b) A choice that may lead to write-write conflicts (c) A correct choice, known as ROWA (read one, write all)

More Related