Need a layman's example of Linearizable Consistency model

  • Thread starter user366312
  • Start date
  • #1
user366312
Gold Member
71
3

Summary:

Distributed Systems: Replication & Consistency.

Main Question or Discussion Point

As far as I understand,

Linearizable Consistency model is a Data-centric and Strong consistency model:

Data-centric means:
  1. All clients experience the consistency
  2. All clients access the same data store
  3. All clients experience the same ordering
  4. Non-mobile clients. I.e. replica used doesn’t change. I.e. replicas are not affected by synchronization delays.
Strong means:
  1. Operations on shared data are synchronized
this link has a good and easy to follow example. But, I a confused about one thing.

In the first image, he is showing only one data-store:
242653


But, in the second image, he is showing two data stores:
242654


Why is that?

Isn't it possible to show the example with only one data-store in the second case?
 
Last edited by a moderator:

Answers and Replies

  • #2
33,508
5,193
Isn't it possible to show the example with only one data-store in the second case?
No, because the author of the post you quoted makes a distinction between a scenario with linearizability (the first figure) and one without linearizability (the second figure).
From the stackoverflow topic you quoted, referring figure with the Follower datastore:
This time, we don’t have a single registry or a single source of truth. Our system uses asynchronous database replication, and we have a Primary node that takes both reads and writes and a Follower node used for read operations only.​
Because replication happens asynchronously, there’s a lag between the Primary node row modification and the time when the Follower applies the same change.​
One database connection changes the account balance from 50 to 10 and commits the transaction. Right after, a second transaction reads from the Follower node, but since replication did not apply the balance modification, the value of 50 is read.​
Therefore, this system is not linearizable since changes don’t appear to happen instantaneously. In order to make this system linearizable, we need to use synchronous replication, and the Primary node UPDATE operation will not complete until the Follower node also applies the same modification.​
 

Related Threads on Need a layman's example of Linearizable Consistency model

Replies
3
Views
6K
  • Last Post
Replies
4
Views
730
Replies
8
Views
4K
  • Last Post
Replies
2
Views
2K
Replies
1
Views
2K
Replies
22
Views
2K
Replies
2
Views
423
Replies
16
Views
1K
Replies
12
Views
2K
Replies
1
Views
587
Top