Professional Documents
Culture Documents
Chapter 5:
Consistency and
Replication
Problems
3
Content Delivery Network
4
1. Introduction
2. Data-centric consistency models
3. Client-centric consistency models
4. Replica management
5. Consistency protocols
1. Introduction
7
1.1. Why do we need replication
8
Reliability
Performance
Scalability (?)
Consistency
1.2. Consistency
9
10
2.1. Distributed data store
11
Local copy
Monotonic
writes
Client-centric
consistency
Read your
writes
Writes follow
reads
13
2.2. Continuous consistency
14
Replica A Replica B
Conit Conit
x = 6; y = 3 x = 2; y = 5
Time:?
Vector clock A = (15, 5) Vector clock B = (0, 11)
Oder:?
Order deviation =3 Order deviation =2
Value:?
Numerical deviation = (1, 5) Numerical deviation = (3, 6)
Size of conit
16
Monotonic
writes
Client-centric
consistency
Read your
writes
Writes follow
reads
17
2.4. Consistent Ordering of Operations
18
Concurrent programming
Parallel and distributed computing
Express the semantics of concurrent accesses when
shared resources are replicated
Deal with consistently ordering operations on
shared, replicated data.
Special notation
19
Monotonic
writes
Client-centric
consistency
Read your
writes
Writes follow
reads
20
Sequential consistency
21
Monotonic
writes
Client-centric
consistency
Read your
writes
Writes follow
reads
23
Causal consistency
24
29
3.1. Eventual Consistency
30
38
Content
provider
39
4.1. Replica server placement
40
Problem
N locations for replica placement
Determine K out of N locations
Solution 1
Distance between clients and locations
Select one server at a time
41
4.2. Content replication and placement
42
Permanent replicas
43
Server is active
The number of requests increased suddenly
Activate other replicas
C2
Server without
copy of file F
P
Client Server with
Q copy of F
C1
File F
Caching
Client manages the cache management, decides to
update the cache
Erase
Write
Policy caching
47
4.3. Content Distribution
48
Multicasting:
Appropriate in case 1 replica wants to promote updates
to (N-1) other copies in a data store
More efficient and economical than sending (N-1)
times
Appropriate for the push-based approach
Unicasting:
Appropriate for pull-based
5. Consistency protocols
5.1. Continuous consistency
5.2. Primary-based protocols
5.3. Replicated write
5.4. Cache coherence
52
5.1. Continuous consistency
53
Actual value of x
The threshold:
Bounding Staleness Deviation
56
1. Active replication
2. Quorum-based protocol
5.3.1. Active replication
62
Read quorum
A B C D A B C D
E F G H E F G H
I J K L I J K L
NR = 3, N W = 10 NR = 7, NW = 6
Write quorum
(a) (b)
A B C D
E F G H
I J K L
NR = 1, N W = 12
(c)