Data-centric Consistency Models
- Maintains a globally-accessible and
globally-consistent data store.
- Linearizability, sequential consistency, …
Client-centric Consistency Models
- Instead of a globally-consistent view,
maintains consistent views for individual
- Easier to deal with inconsistencies.
- Eventual consistency, monotonic reads, monotonic
writes, read your writes, writes following reads…
Monotonic reads (MR)
- If a client reads a data entry X, any successive
read of X by the same client returns the same
value or a more recent value.
Monotonic WRITES (MW)
- If a client first performs Write1 then Write2,
Write1 is ordered and executed before Write2
on all copies of the data.
Writes Following Reads (WFR)
- The client makes a write operation: Write1. Then, it eventually
observes result of Write1 with a ReadX, which is not necessarily
the successive operation of Write1. After ReadX, the client
makes a new write: Write2.
- On all copies of the entry, Write1 is ordered and executed before Write2.
- Happens-before relationship …
Read Your Writes (RYW)
- The effect of a write operation by a client on a
data entry X will always be seen by a
successive read operation on X by the same
Session Guarantees for Weakly ConsistentReplicated Data 
- Defines MR, MW, WFR and RYW guarantees using sessions.
- A client connects to the system and operates within the
boundaries of a session.
- It can talk to a single server or a set of servers, and it can
behave like a server.
- Consistency guarantees are either ensured by the session
manager in the client during the session, or the client learns
that the guarantees cannot be continued, which means that
the session has ended.
Highly Available Transactions: Virtues andLimitations 
- In the presence of arbitrary, indefinitely-long network
- High availability: If a client can contact to a non-failing server,
it eventually receives a response.
- Sticky availability: If a client’s transactions is executed against
a copy of the database that reflects all of its prior operations,
the client eventually receives a response.
- Any guarantee achievable in a highly-available system is also
achievable in a sticky-available system, but not vice-versa.
What does it mean?
- You can get linearizability and sequential consistency in
a CP system.
- You can get MR, MW, WFR in an AP system.
- If you have sticky sessions, you can get RYW in an AP
system. Otherwise, you need a CP system for it.
- MR + MW + RYW = PRAM consistency
- PRAM + WFR = Causal consistency
How does it work?
- RYW against MR, MW and WFR
- Delaying visibility of writes in MR, MW and WFR , 
How TO map these models to hazelcast?
- In a Hazelcast cluster:
- Each partition has a single owner and possibly
- All operations are executed on the partition owner.
- Partition operations are linearizable in a stable
DETECTING INCONSISTENCY CASES IN HAzELCAST
- Can we detect if there is a possibility of data inconsistency on
- A hypothetical ConsistencyLostListener implementation
- For the following examples, a single partition with 2 replicas is
considered. Additionally, lets assume partition operations
return partition version in responses and our proxy classes can
EXAMPLE #5: MW is lost. We need a Dirty flag.Same for WFR
- Linearizability and sequential consistency is achievable in CP
- Hazelcast already provides linearizability on partition level in a stable
cluster (e.g., no network partitioning or partition owner crash).
- In AP systems, causal consistency is achievable with sticky
- Hazelcast proxies already are already as they talk to partition owners.
- Hazelcast proxies can detect the possibility of inconsistency
- On partition owner failure, they can check if they continue the current
session or not.
 Terry, Douglas B., et al. "Session guarantees for weakly consistent replicated data." Parallel and Distributed
Information Systems, 1994., Proceedings of the Third International Conference on. IEEE, 1994.
 Bailis, Peter, et al. "Highly available transactions: Virtues and limitations." Proceedings of the VLDB Endowment 7.3