Mod 5
Mod 5
1. Strict Consistency :
Any read on a data item x returns a value corresponding to the
result of the most recent write on x. “All writes are
instantaneously visible to all processes”
2. Sequential Consistency :
Example :
Data Centric consistency models:
P3 and P4 disagree
on the order of the writes
a) A data store that is not sequentially consistent.
Data Centric consistency models:
3. Causal consistency
• Weaker than sequential consistency since it makes a
distinction between events that are potentially causally
related and those that are not.
Concurrent writes …
may be seen in a different order on different machines.
P1 W(x)a P1 W(x)a
P3 does not do an acquire before reading the shared data . Hence the
data store has no obligation to give it the current value of x. So
returning a is allowed.
Data Centric consistency models:
• Release consistency is also called eager release consistency
since -------→
All processes must see all shared accesses in the same order. Accesses are furthermore ordered
Linearizability
according to a (nonunique) global timestamp.
Sequential All processes see all shared accesses in the same order. Accesses are not ordered in time.
Causal All processes see causally-related shared accesses in the same order.
All processes see writes from each other in the order they were used. Writes from different processes
FIFO
may not always be seen in that order.
(a)
Consistency Description
Weak Shared data can be counted on to be consistent only after a synchronization is done.
Release Shared data are made consistent when a critical region is exited.
Entry Shared data pertaining to a critical region are made consistent when a critical region is entered.
42
(b)
Client Centric Consistency Models
Difference between data centric and client centric
consistency
With data centric, the objective is to specify a
system wide consistency on a set of shared data
items in the presence of concurrent read/write
operations .
For client centric consistency, consistency is defined
only concerning how one specific client experiences
the effects of read/write operations when moving
between locations.
Client Centric Consistency Models
Data centric consistency
Concurrent processes may be simultaneously
updating the data store and hence it is necessary to
provide consistency in the face of such concurrency
Characteristics of Client centric consistency
Lack of simultaneous updates
Most operations involve reading data
Client Centric Consistency Models
Eventual consistency
Eventual consistency model states that when no updates
occur for a long period of time, eventually all updates will
propagate through the system and all the replicas will be
consistent
Client Centric Consistency Models
Mobile users accesses the database connecting to
one of the replicas in a transparent way
Assume the user performs several update
operations and then disconnects again.
Later the user accesses the database again,
possibly after moving to a different location or by
using a different access device. The user may be
connected to a different replica.
What if the updates have not propagated? Could
be confusing to the user.
Solution : Use Client-centric consistency
Client Centric Consistency Models
Client-centric consistency provides guarantees
for a single client concerning the consistency of
accesses to a data store by that client.
No guarantees are given concerning concurrent
accesses by different clients.
Assumptions for client centric consistency
Data store is physically distributed across
multiple machines.
When a process accesses a data store, it
generally connects to its nearest available copy
All read and write operations are performed on
the local copy. Updates are eventually
propagated to other copies.
Client-Centric Consistency
(48)
Client Centric Consistency Models
1. Monotonic Read
If a process reads the value of a data item x, any successive
read operations on x by that process will always return that
same value or a more recent value.
• Example:
• Consider a distributed e-mail database
• In such a database, each user’s mailbox may be distributed and
replicated across multiple machines.
• Mail can be inserted in a mailbox at any location.
• Updates are propagated in a lazy (i.e., on demand) fashion.
• Assume that reads don’t change the mailbox.
• Suppose a user reads their e-mail in Vancouver and then flies to
Toronto and reads their e-mail.
• A monotonic read guarantees that the messages that were in the
mailbox in Vancouver will also be in the mailbox in Toronto.
Client Centric Consistency Models