• Tidak ada hasil yang ditemukan

Chapter 7 Consistency and Replication (1)

N/A
N/A
Protected

Academic year: 2019

Membagikan "Chapter 7 Consistency and Replication (1)"

Copied!
47
0
0

Teks penuh

(1)

DISTRIBUTED SYSTEMS

Principles and Paradigms

Second Edition

ANDREW S. TANENBAUM

MAARTEN VAN STEEN

Chapter 7

(2)

Plan

Motivation

Consistency models

Data-centric consistency

Client-centric consistency

Replica management

(3)

Replication

Examples

Many web servers with

same contents

(4)

Reasons for Replication

Data are replicated to

increase the reliability

of a system.

Replication for

performance

Scaling in numbers

Scaling in

(5)

Caveats

Cost of increased

bandwidth for maintaining

replication

Viability depends on ratio

between reads and writes

Possible

consistency

problems

What if Client writes to

Server 1…

Client reads from Server 2

before write is propagated?

May not always be a

problem…

(6)

Consistency Models

Data store

provides

Read and write operations

Write operations are propagated to other copies

Consistency model

Contract between processes and data store

(7)

Continuous Consistency

Defining inconsistencies

Deviation in numerical values between

replicas –

numerical error

E.g., $0.02 difference between to replicas of stock

price

Deviation in

staleness

between replicas

E.g., difference in when stock prize was last

updated

Deviation in the number of outstanding writes

order error

(8)

Continuous Consistency

Figure 7-2. An example of keeping track of consistency

deviations [adapted from (Yu and Vahdat, 2002)].

(9)

Continuous Consistency

May choose between

different levels of

acceptable errors for conit

E.g., bulletin board

Unseen messages:

numerical errors

Message delay: staleness

Message ordering per

newsgroup: order error

(10)

Continuous Consistency

(11)

Continuous Consistency

Figure 7-3. Choosing the appropriate granularity for a

conit.

(12)

Consistent Ordering

Augments continuous consistency

Need to reach agreement when tentative

updates need to be committed

(13)

Sequential Consistency (1)

Figure 7-4. Behavior of two processes operating

on the same data item. The horizontal axis is

time.

(14)

Sequential Consistency (2)

Concurrent operations by multiple processes

Sequential consistency:

All processes should see the same interleaving of

operations

The result of any execution is the same as if the (read

and write) operations by all processes on the data

store were executed in some sequential order

(15)

Sequential Consistency (3)

(16)

Sequential Consistency (4)

Figure 7-6. Three concurrently-executing

processes.

Write x

(17)

Sequential Consistency (5)

(18)

Causal Consistency (1)

Again concurrent operations by multiple

processes

Causal consistency:

P writes x, Q reads x, writes Q

The three events are potentially causally related

Must be seen by all processes in same order

Writes that are potentially causally related must be

seen by all processes in the same order

(19)

Causal Consistency (2)

(20)

Causal Consistency (3)

(21)

Causal Consistency (4)

(22)

Entry Consistency

Guard shared data with locks

Updates are performed with respect to

shared data when process acquires lock

(23)

Grouping Operations

Necessary criteria for correct synchronization:

An acquire access of a synchronization variable, not

allowed to perform until all updates to guarded shared

data have been performed with respect to that

process.

Before exclusive mode access to synchronization

variable by process is allowed to perform with respect

to that process, no other process may hold

synchronization variable, not even in nonexclusive

mode.

After exclusive mode access to synchronization

(24)

Client-Centric Consistency

Eventual consistency

No write-write conflicts, only read-write

conflicts

Propagate writes lazily

E.g., DNS, Web servers

What if client is mobile

(25)

Eventual Consistency

(26)

Monotonic Reads (1)

A data store is said to provide

monotonic-read consistency if the

following condition holds:

If a process reads the value of a data

item x …

(27)

Monotonic Reads (2)

Figure 7-12. The read operations performed by

a single process P at two different local copies of

the same data store.

(a) A monotonic-read consistent data store.

Set of write operations

(28)

Monotonic Reads (3)

Figure 7-12. The read operations performed by a single

(29)

Monotonic Writes (1)

In a monotonic-write consistent store, the

following condition holds:

A write operation by a process on a data

item x …

(30)

Monotonic Writes (2)

(31)

Monotonic Writes (3)

(32)

Read Your Writes (1)

A data store is said to provide

read-your-writes consistency, if the following

condition holds:

The effect of a write operation by a

process on data item x …

(33)

Read Your Writes (2)

(34)

Read Your Writes (3)

(35)

Writes Follow Reads (1)

A data store is said to provide

writes-follow-reads consistency, if the following

holds:

A write operation by a process on a data

item x following a previous read operation

on x by the same process …

(36)

Writes Follow Reads (2)

(37)

Writes Follow Reads (3)

Figure 7-15. (b) A data store that does

(38)

Replica Management

Questions to ask

Which servers should be replica servers?

(39)

Replica-Server Placement

Both a commercial and a technical (optimization)

problem

Minimum K-Median Problem

Input

NP-hard, a polynomial-time approximations exists

O(K N

2

)

: Problem for online recalculations – Slashdot effect…

(40)

Replica-Server Placement

Latency-driven replica placement

Select network regions

Groups of nodes with low inter-latency,

N

nodes in total

HotZone

algorithm

Place

K

replicas in most active cell

E.g., node with minimal distance to all other nodes in cell

??

Turns out that one can calculate this reasonably in constant time…

(41)

Content Replication and Placement

(42)

Permanent Replicas

Initial set of replicas

that constitute

distributed data store

E.g., web server

Replicated at a limited

number of nodes

Within ownership

domain

Mirrored at limited

number of nodes

(43)

Server-Initiated Replicas

Given a set of replica

servers, place contents

E.g.,

Maintain access threshold

for migrating file

Monitor possible access

threshold

(44)

Client-Initiated Replicas

(Client)

caches

(45)

Content Distribution

State versus Operations

Possibilities for what is to be propagated:

1.

Propagate only a notification of an

update.

2.

Transfer data from one copy to another.

3.

Propagate the update operation to other

copies.

(46)

Content Distribution

Pull versus Push Protocols

(47)

Summary

Consistency is essential in many

applications

Performance

Reliability

Consistency models

Data-centric consistency

Client-centric consistency

Replica management

Gambar

Figure 7-3. Choosing the appropriate granularity for a conit. (a) Two updates lead to update propagation
Figure 7-7. Four valid execution sequences for the processes of Fig. 7-6. The vertical axis is time.
Figure 7-13. The write operations performed by a single process P at two different local copies of the same data store
Figure 7-13. The write operations performed by a single process P at two different local copies of the same data store

Referensi

Dokumen terkait

Metode yang digunakan dalam pengujian kadar fenolat total yaitu metode Folin_Ciocalteu dan aktivitas antioksidan menggunakan metode DPPH.. Kata kunci : Kulit

Hasil penelitian menunjukan bahwa, pihak Bank Sumut juga mengalami perkreditan macet, nasabah yang memperoleh kredit dari Bank Sumut pada akhirnya ada beberapa

Analisis rantai nilai dan strategi pengembangan industri kreatif di kota bandung dan

Nyeri berhubungan dengan inflamasi ditandai dengan rubor, dolor, kalor, tumor, fungsiolaesa pada mukosa Tujuan : Nyeri berkurang setelah dilakukan tindakan keperawatan dan

Dengan ini diberitahukan bahwa setelah diadakan penelitian dan evaluasi oleh panitia menurut ketentuan – ketentuan yang berlaku terhadap dokumen penawaran dan dokumen

Chen (1975) membandingkan beberapa model hubungan indeks plastisitas dengan persentase mengembang seperti pada Gambar 2.11, pada penelitian ini akan mengusulkan hubungan

Analisis spasial ketersediaan air tanah di wilayah Bandung dengan menggunakan metode heraca air thornthwaite-matter.. Universitas Pendidikan Indonesia |

DAMPAK PENERAPAN PELATIHAN TABATA TERHADAP PENINGKATAN KEMAMPUAN KEKUATAN YANG CEPAT.. Universitas Pendidikan Indonesia | repository.upi.edu |