Chapter 4. Consistency and Replication - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Chapter 4. Consistency and Replication

Description:

Pusan National University. STEM-PNU. Replication and Consistency. Reasons for Replication ... Pusan National University. STEM-PNU. Example: Shared Objects ... – PowerPoint PPT presentation

Number of Views:162
Avg rating:3.0/5.0
Slides: 24
Provided by: iselCsP
Category:

less

Transcript and Presenter's Notes

Title: Chapter 4. Consistency and Replication


1
Chapter 4. Consistency and Replication
2
Replication and Consistency
  • Reasons for Replication
  • Reliability
  • Performance e.g. scalability
  • Drawbacks
  • Performance and Scalability to maintain
    consistency
  • When updates take place more often than simple
    accesses
  • Update propagation to maintain consistency

Replica
Replica
Update
Replica
3
Example Shared Objects
  • Handling concurrent accesses of a shared object

4
Example Replicated Object
Distributed system is responsible for replica
management
Replication-Aware Distributed Objects
5
Approach
  • Goal
  • Scalability by replication
  • Without loss of consistency
  • Problem
  • Updates take long time to propagate them to
    replicas
  • Approach A compromise
  • Loosen consistency constraint
  • Copies are not same at all time
  • Classification
  • Data Centric Approach Global Consistency
  • Client Centric Approach Consistency to each
    client

6
Data-Centric Approach vs. Client-Centric
Approach
7
Data-Centric Approach Strict Consistency
  • Strict Consistency
  • Any read on a data item x returns a value
    corresponding to the result of the most recent
    write on x.
  • But it is impossible to realize strict
    consistency. Why ?
  • History order of executions (interleaved or not)

time
Strict Consistent
Not Strict Consistent
8
Data-Centric Approach Sequential Consistency
  • No matter what operations really take place
  • cf. Strict Consistency
  • Orders seen by different machine should be same
  • Weaker than Strict Consistency
  • What problems in realizing sequential consistency
    ?
  • Comparison with serializability

Sequentially Consistent
Sequentially Inconsistent
9
Sequential Consistency Example
  • 6!(720) orders wrt execution orders
  • 64 results wrt print output
  • 000000 not allowed, since no respect on
    execution order
  • 001001 not allowed, since no respect on
    sequential consistency

10
Data-Centric Approach Causal Consistency
  • Distinction between
  • Concurrent operations not causally related
  • Causally related operations
  • Example. P1 W(x), P2 R(x), W(y)
  • W(y) in P2 is causally related with R(x) in P2
  • Causally Related Operations Should respect
    order
  • Weaker than Sequential Consistency

Causally Consistent
11
Data-Centric Approach FIFO Consistency
  • Two types of writing orders
  • Writing order in a machine
  • Writing order in several machine
  • FIFO Consistency
  • Only respect writing order in a machine
  • Weaker than Causal Consistency

12
Data-Centric Approach Weak Consistency
  • No consistency except Explicit Synchronization
    Request
  • Synchronize Operation
  • All writes on a machine should be propagated to
    all copies
  • No operation on a synchronized variable is
    allowed until all previous writes have completed
    everywhere.
  • No read or write operations are allowed until
    all previous operation to synchronization
    variables have been completed

Weak Consistency
Not Weak Consistency
13
Release Consistency and Entry Consistency
  • Release Consistency
  • Explicit Specification on Critical Section
  • Acquire and Release
  • Like Enter_CS and Leave_CS
  • Programmer should specify
  • Entry Consistency
  • Like Release Consistency
  • But explicit specification for each data item

14
Summary of Data-Centric Consistency
15
Eventual Consistency and Client-Centric
Consistency
  • Rare Updates
  • For a certain period of time, inconsistency can
    be tolerated.
  • Client-Centric Consistency
  • Lazy update propagation

16
Client-Centric Consistency
  • Client-Centric Consistency
  • Not all copies must be consistent
  • Consistency from the viewpoint of client (or
    process)
  • Lazy update propagation
  • Example Web pages
  • Four types of Consistency
  • Monotonic Read Consistency
  • Monotonic Write Consistency
  • Read-your-writes Consistency
  • Writes-follow-reads Consistency

17
Monotonic Read Consistency
  • Guarantee
  • If a read by a process returns a value, any
    other reads by this process at a later time
    should notreturn an old value
  • Suppose a mobile client, the order of reads by
    this clientshould be respected the order
    wherever it is.
  • Update Propagation for Read Order
  • Mobile Client has consistent Read

Monotonic-Read Consistent
Not Monotonic-Read Consistent
18
Monotonic Write Consistency
  • Guarantee
  • Order of writes by a same process wherever they
    are performed
  • Suppose a mobile client, the order of writes by
    this clientshould be respected the order
    wherever it is.
  • Update Propagation for Write-Order
  • Mobile Client has consistent Writes

Monotonic-Write Consistent
Not Monotonic-Write Consistent
19
Implementation Issues Distribution Protocol
  • Replication
  • Deciding Where, When, and by Whom to duplicate
  • Update Propagation
  • A Conceptual Classification

20
Server-Initiated Replication
  • Server-Initiated Replicas
  • Replicas made by server to enhance performance
  • How to decide when and where ?
  • Keep Access Count
  • Del(S,F) Threshold for deleting a replica
  • Rep(S,F) Threshold for making a replica

21
Client-Initiated Replication
  • Client caches
  • on the client machine but not necessarily
  • on a machine in its LAN
  • Good when no update happens
  • For a short time
  • Cache Replacement
  • Hit Ratio

22
Update Propagation
  • State vs. Operation What to propagate ?
  • Notification of update
  • Transfer new data
  • Update Operation
  • Pull vs. Push Protocol
  • Push Protocol (Server-based Protocol)
  • Updates are propagated to other copies WITHOUT
    requests
  • Often between Permanent and Server-initiated
    Copies
  • When High Degree of Consistency is required
  • Pull Protocol (Client-based Protocol)
  • Update propagation when requested
  • Often client cache
  • When Read-to-update ratio is low

23
Comparison of Push and Pull Protocol
  • Comparison
  • Uni-casting vs. Multicasting
  • Multicasting is convenient for push protocol
Write a Comment
User Comments (0)
About PowerShow.com