3. Consistency Model
Example:
• Assume that the following case occurs:
• The row X is replicated on nodes M and N
• The client A writes row X to node M
• After a period of time t, client B reads row X from node N
• The consistency model determines whether client B will
definitely see the write performed by client A, will definitely
not, or cannot depend on seeing the write.
4. Conflicting operations
• Read-write conflict: a read operation and a write operation act
concurrently
• Write-Write conflict: two concurrent write operation
5. Reasons for replication
Two primary reasons for replicating data
reliability and performance
However there is price to be paid when data is replicated
The problem is with replication that having multiple
copies may lead to consistency model i.e. when copy is
modified that copy becomes difference from the rest
6. Reasons for replication
Therefore modifications have to be caried out on all
copies to ensure consistency.
Exactly how and when those modifications need to
be carried out determines the price of replication.
7. Consistency Model
• Provides formal view of how memory system will appears to programmer
• Eliminates the gap between the behavior expected by the programmer
and actual behavior supported by the system
• It is used for contract between software and memory
• It says that if the software agrees to obey certain rule then the memory
promise to work properly
• Memory consistence model for shared address space specifies that in
which memory operations must appear to be performed i.e. visible to
processors with respect to one other.
8. Consistency Model
Consistency is different from coherence.
Coherence deals with maintaining a global order in
which writes to a single location or single variable are
seen by all processors i.e. how memory accesses are
coordinated among CPUs.
Consistency deals with the ordering of operations to
multiple locations with respect to all processors. i.e. when
memory writes shows up at another CPU.
9. Consistency Model
Consistency models define rules for the apparent order
and visibility of updates. There are two methods to
define and a categorize consistency models
1. issue: describes the restrictions that define how a
process can issue operations
2. View: defines the order of operations visible to
processes.
11. Consistency Models
1. Strict Consistency Model
2. Sequential Consistency Model
3. Causal Consistency Model
4. PRAM and Processor
5. Weak Consistency Model
6. Eventual Consistency Model
7. Release Consistency Model
12. Strict Consistency Model
1. It Is most strongest consistency model, i.e. model of rules
2. A write to a variable by any processor needs to be seen
instantaneously by all processors.
3. It is defined by following conditions
4. Any read to memory location x returns the value stored by the most
recent write operation of x
5. Disadvantage: number of messages increase between processors, as
single write operation may need to update on all processors
6. We can’t implement this model in all scenario.
7. It doesn't help in answering the question of conflict resolution in
concurrent writes to the same data item, because it assumes
concurrent writes to be impossible
13. Sequential Consistency Model
1. It is weaker memory model than strict consistency
model.
2. It is the most intuitive (with out conscious) model
greatly restrict the use of the many performance,
optimization used by the uniprocessor hardware and
compiler designers
3. Results of any execution is same as if the operations of
all the processors were executed in some sequential
order and the operations of each individual process
appears in the sequence in order specified by its
program
14. Sequential Consistency Model
1. Note that this rule says nothing about what order the
events happen in
2. Just that happen in some order
3. All instructions are executed atomically and there are no
recording between memory instructions
4. This is simple model however performance can’t be at
its best
5. One difficulty to bring all operations execute in
sequential order.
16. Causal consistency model
1. It represents a weaking of sequential consistency
2. It makes a distinguish between events that are
potentially causally related to and those are not.
3. Condition: writes that are potentially causally
related must be seen by all processing the same
order.
4. Operations are said to related to another if one
might have bee influenced by other operations
5. Operations that are not causally related are said to
be concurrent.
18. Weak consistency model
1. Not necessary to show the change in memory done by
every write operations to other processes. E.g. when a
process executes in a critical sections.
2. Process to synchronization variables are sequentially
consistent
3. No access to a synchronization variable allowed to
perform until all previous writes are complete every
where.
4. No data access write/read is allowed to be performed
until all process synchronize variables has been
performed
19. Eventual Consistency Model
• Based on client centric Model
• Many system: one or few processes perform updates, how frequently
these updates be made available to other read-only process.
• Examples: NIS (News information service), user information database,
only system admin update database, users only read data.
• Only naming authority allowed updates (hence no write-write
conflicts)
20. Monotonic Reads
• If a process reads the value of a data item x, any successive read
operation on x by that process will always return that same value or a
more recent value.
• Once read, subsequent reads on that data items return same or more
recent values.
• Example: Each time you connect to a different email server, the
server fletches all the updates form the server you previously visited.
• Example: automatically reading you personal calendar updates from
different servers. Monotonic reads guarantees that the user see all
updates, no matter from which server the automatic reading takes
place.
21. Monotonic Write
A write operation by a process on a data item x is completed
before any successive write operation on x by the same
process.
a write must be propagated to all replicas before a successive
write by the same process
Example: Updating a program at server S2, And ensuring that
all components on which compilation and linking depends are
also placed at S2.
Example: maintaining versions of replicated files in the correct
order everywhere (Propagate the previous version to the
server where the newest version is installed)
22. PRAM (Pipelined RAM) consistency model
1. Weaker consistency model so for
2. Only write operations is considers
3. Writes done by a single processor are received by all the
other processors in the order in which they were issued
4. Writes generates by different processors are concurrent.
5. Write operations performed by single process are in
pipelined
6. Simple and easy to implement
7. Also called as FIFO Consistency Model
23. Released Consistency Model
1. Enhancement of weak consistency model. In which
operations are performed in a synchronized way.
2. Use of two synchronization variables
a) Acquire(use to tell system is entering)
b) Release(use to tell system is just exited)