6. Strong Consistency
1
0 value = "foo"
value = "bar" 2
B
A
value = "bar"
2
C
2 value = "bar"
value = "bar"
After the update, any subsequent access will return the
updated value.
woensdag 21 juli 2010
7. Weak Consistency
B
0 value = "foo"
>1
1 value = "bar"
A
value = "bar" / "foo"
>1
C
value = "bar" / value = "bar" / "foo"
>1 "foo"
The system does not guarantee that at any given point in
the future subsequent access will return the updated
value
woensdag 21 juli 2010
8. Eventual Consistency
B
0 value = "foo"
1 value = "bar" t
A
value = "bar"
t
C
value = "bar"
t value = "bar"
t≥1
If no updates are made to the object, eventually all
accesses will return the last updated value.
woensdag 21 juli 2010
9. Causal Consistency
2 notification of update
B
0 value = "foo"
1 value = "bar" 3
A
value = "bar"
3
C
value = "foo"
Subsequent access by process B will return the updated
value, and a write is guaranteed to supersede the earlier
write.
woensdag 21 juli 2010
10. Read-your-writes
Consistency
B
0 value = "foo"
1 value = "bar"
A
C
2 value = "bar"
Process A, after updating a data item always access the
updated value and never sees an older value
woensdag 21 juli 2010
11. Session Consistency
B
Session 1
0 value = "foo"
1 value = "bar"
A 2 value = "bar"
2 value = "foo"
C
Session 2
Within the “session”, the system guarantees read-your-
writes consistency
woensdag 21 juli 2010
12. Monotonic Read
Consistency
B
0 value = "foo"
value = "bar"
A
3
1 value = "foo"
C
2 value = "foo"
4 value = "bar"
If a process has seen a particular value for the object, any
subsequent access will never return any previous values
woensdag 21 juli 2010
13. Monotonic Write
Consistency
B
0 value = "foo"
A
value = "bar"
1
2
C
value = "last"
The system guarantees to serialize the writes by the
same process
woensdag 21 juli 2010
14. Eventual Consistentency
in RDBMS
Log shipping
Primary Backup replica
A
1
async
2
3
Eventual consistency is not just a property of NoSQL
Solutions
woensdag 21 juli 2010
16. NRW
N The number of nodes that store replicates of the data
W The number of replicas that need to acknowledge the
receipt of the update before the update completes
R The number of replicas that are contacted when a data
object is accessed through a read operation
woensdag 21 juli 2010
17. Strong Consistency
W=3 value = "foo"
value = "foo"
A
value = "foo"
N=4
value = "foo"
R=2
W + R > N implies strong consistency
woensdag 21 juli 2010
18. Optimizations
• Optimize read: R = 1, N = W
• Optimize write: W = 1, N = R
woensdag 21 juli 2010
19. Design Considerations
• Clients implementing read-your-writes and monotonic
reads, by adding versions on writes, and discarding
everything the precedes the last-seen version.
woensdag 21 juli 2010