0% found this document useful (0 votes)
3 views25 pages

Consistency and Replication Slm.docx

The document outlines a course on Parallel & Distributed Computing, focusing on consistency and replication in distributed systems. It discusses the importance of replication for reliability and performance, the challenges of maintaining consistency among replicas, and various consistency models such as sequential and causal consistency. Additionally, it provides self-assessment questions and references for further learning on the topic.

Uploaded by

Syed Tahaseen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views25 pages

Consistency and Replication Slm.docx

The document outlines a course on Parallel & Distributed Computing, focusing on consistency and replication in distributed systems. It discusses the importance of replication for reliability and performance, the challenges of maintaining consistency among replicas, and various consistency models such as sequential and causal consistency. Additionally, it provides self-assessment questions and references for further learning on the topic.

Uploaded by

Syed Tahaseen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Department of Computer Science and

Engineering (RA)
COURSE NAME: PARALLEL &DISTRIBUTED COMPUTING
COURSE CODE: 22CS4106 R

TOPIC: CONSISTENCY & REPLICATION


SESSION OUTLINE

• REPLICATION
• Performance and scalability
• Data-centric consistency models
• CONSISTENT ORDERING OF OPERATIONS
-SEQUENTIAL CONSISTENCY
-CASUAL CONSISTENCY
• Client centric consistency model
-Monotonic Reads
-Monotonic writes
-Read your writes
-Writes follow reads
Example: Zookeeper

2
SESSION DESCRIPTION

Replication
Why replicate
Assume a simple model in which we make a copy of a specific part of a system (meaning code and data).
•Increase reliability: if one copy does not live up to specifications, switch over to the other copy while
repairing the failing one.
•Performance: simply spread requests between different replicated parts to keep load balanced, or to
ensure quick responses by taking proximity into account.

The problem
Having multiple copies, means that when any copy changes, that change should be made at all copies:
replicas need to be kept the same, that is, be kept consistent.

3
Performance and scalability
Main issue
To keep replicas consistent, we generally need to ensure that all conflicting operations are done in the
the same order everywhere
Conflicting operations: From the world of transactions
•Read–write conflict: a read operation and a write operation act concurrently
•Write–write conflict: two concurrent write operations

Issue
Guaranteeing global ordering on conflicting operations may be a costly operation, downgrading
scalability. Solution: weaken consistency requirements so that hopefully global synchronization can be
avoided

4
Data-centric consistency
models model
Consistency
A contract between a (distributed) data store and processes, in which the data store specifies precisely what the
results of read and write operations are in the presence of concurrency.
Essential
A data store is a distributed collection of storages:

5
Some notations
Read and write operations
•Wi (x )a: Process Pi writes value a to x
•Ri (x )b: Process Pi reads value b from x
•All data items initially have value NIL
Possible behavior
We omit the index when possible and draw according to time (x-axis):

6
Sequential consistency
Definition
The result of any execution is the same as if the operations of all processes were executed in some
sequential order, and the operations of each individual process appear in this sequence in the order
specified by its program.

A sequentially consistent data store A data store that is not sequentially consistent

7
Example
Three concurrent processes (initial values: 0)

Process P1 Process P2 Process P3

x ← 1; y ← 1; z ← 1;
print(y,z); print(x,z); print(x,y);

Example execution sequences

8
Causal consistency
Definition
Writes that are potentially causally related must be seen by all processes in the same order. Concurrent
writes may be seen in a different order by different processes.

A violation of a causally-consistent store A correct sequence of events in a causally-consistent


store

9
Eventual consistency

Definition
Consider a collection of data stores and (concurrent) write operations. The strores are eventually consistent
when in lack of updates from a certain moment, all updates to that point are propagated in such a way that
replicas will have the same data stored (until updates are accepted again).
Srong eventual consistency
Basic idea: if there are conflicting updates, have a globally determined resolution mechanism (for example,
using NTP, simply let the “most recent” update win).
Program consistency
P is a monotonic problem if for any input sets S and T , P(S) ⊆ P(T ). Observation: A program solving a
monotonic problem can start with incomplete information, but is guaranteed not to have to roll back when
missing information becomes available. Example: filling a shopping cart.
Important observation
In all cases, we are avoiding global synchronization.
10
Continuous Consistency
We can actually talk about a degree of consistency
•replicas may differ in their numerical value
•replicas may differ in their relative staleness
•there may be differences regarding (number and order) of performed update operations

Conit
Consistency unit ⇒ specifies the data unit over which consistency is to be measured.

11
Example: Conit

Conit (contains the variables g, p, and d )


•Each replica has a vector clock: ([known] time @ A, [known]
•A has three pending operations ⇒ order deviation = 3
time @ B)
•A missed two operations from B; max diff is 70 + 412
•B sends A operation [⟨5, B⟩ : g ← d + 45]; A has made this
operation permanent (cannot be rolled back)
units ⇒ (2, 482)

12
CLIENT CENTRIC CONSISTENCY MODEL

Basic architecture

The principle of a mobile user accessing different replicas of a distributed database

13
Client-centric consistency: notation
Notations
•W1(x2 ) is the write operation by process P1 that leads to version x2 of x
•W1(xi ; xj ) indicates P1 produces version xj based on a previous version
xi .
•W1(xi |xj ) indicates P1 produces version xj concurrently to version xi .

14
Monotonic reads

Example
Automatically reading your personal calendar updates from different servers. Monotonic reads
guarantees that the user sees all updates, no matter from which server the automatic reading takes
place.
Example
Reading (not modifying) incoming mail while you are on the move. Each time you connect to a different e-
mail server, that server fetches (at least) all the updates from the server you previously visited.

15
16
17
18
Example
Updating your Web page and guaranteeing that your Web
browser shows the newest version instead of its cached
copy.

19
Example
See reactions to posted articles only if you have the original posting (a read “pulls in” the
corresponding write operation).

20
21
SELF-ASSESSMENT QUESTIONS
1. Which of the following is the primary goal of replication in distributed
systems?
A) To improve system fault tolerance and availability
B) To minimize the network bandwidth usage
C) To reduce the complexity of data consistency
D) To guarantee that every replica is updated in real-time
Answer: A) To improve system fault tolerance and availability
2. Which consistency model guarantees that all replicas of a data item will
always return the same value, regardless of which replica is accessed?
A) Eventual consistency
B) Strong consistency
C) Weak consistency
D) Causal consistency
Answer: B) Strong consistency

22
3.What is a major disadvantage of achieving strong consistency in a distributed
system?
A) It requires more computational power on the client side.
B) It can result in higher latency due to synchronization between replicas.
C) It improves scalability by ensuring that updates are reflected immediately.
D) It increases the number of replicas that need to be managed.
Answer: B) It can result in higher latency due to synchronization between replicas.
4.Which of the following consistency models is designed to allow for greater
system availability while sacrificing some degree of consistency?
A) Strong consistency
B) Eventual consistency
C) Linearizability
D) Causal consistency
Answer: B) Eventual consistency

23
REFERENCES FOR FURTHER LEARNING OF THE
SESSION

Reference Books:

1. Chapman, Barbara Jost, Gabriele Pas, Ruud van der, Using OpenMP: portable shared
memory parallel programming, 2008, MIT Press.
2. Gadi Taubenfeld - Distributed Computing Pearls (2018, Morgan & Claypool Publishers)
3. Tanenbaum, Andrew S Steen, Maarten van-Distributed systems: principles and
paradigms. Pearson, 4th Edition

24
THANK YOU

parallel and distributed computing

CREATED BY K. VICTOR BABU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy