Consistency and replication
Download
1 / 34

Consistency and Replication - PowerPoint PPT Presentation


  • 203 Views
  • Uploaded on

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?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Consistency and Replication' - mele


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Consistency and replication

Consistency and Replication

Chapter 7

Part II

Replica Management

&

Consistency Protocols


Replica management
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



Permanent replicas
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


Server initiated replicas 1
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


Server initiated replicas 2
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


Server initiated replicas 3
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.


Client initiated replicas
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



Design issues for update propagation
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


State versus operation propagation 1
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


State versus operation propagation 2
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?


Pull versus push
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


Pull versus push protocols
Pull versus Push Protocols

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


Leases
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


Unicast versus multicast
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


Consistency protocols
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


Primary based remote write protocol
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


Primary based remote write protocol cont
Primary-Based Remote-Write Protocol (cont.)

The principle of primary-backup protocol.


Sequential consistency
Sequential Consistency

process

process

process

FIFO

Channels

Switch

All Data Items (the set D)


Primary based remote write protocol cont1
Primary-Based Remote-Write Protocol (cont.)

Sequential consistency

Read Your Writes

The principle of primary-backup protocol.


Primary based remote write protocol cont2
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.


Primary based local write protocol
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


Primary based local write protocol cont
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.



No primary copy replicated write protocols
No Primary Copy follows? Replicated-Write Protocols

  • Active replication

  • Quorum-based protocol


Ordering guarantees
Ordering Guarantees follows?

  • Updates sent from different processes may be delivered in different orders at different sites

  • Totally-ordered multicast

  • Causally-ordered multicast


Ordering guarantees1
Ordering Guarantees follows?

  • 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


Active replication
Active Replication follows?

The problem of replicated invocations.


Active replication cont
Active Replication (cont.) follows?

Forwarding an invocation request from a replicated object.

Returning a reply to a replicated object.


Network partitions
Network Partitions follows?

  • 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!


Network partitions1
Network Partitions follows?

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.


Quorum based protocols
Quorum-Based Protocols follows?

  • N: Total #Replicas

  • NR: #Replicas in Read Quorum

  • NW: #Replicas in Write Quorum

  • Constraints:

    • NR + NW > N

    • NW > N/2


Quorum based protocols1
Quorum-Based Protocols follows?

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)


ad