Need a layman's example of Linearizable Consistency model

In summary: From the stackoverflow topic you quoted, referring figure without a 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.Since 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
  • #1
user366312
Gold Member
89
3
TL;DR Summary
Distributed Systems: Replication & Consistency.
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:
Technology news on Phys.org
  • #2
user366312 said:
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.​
 

1. What is a layman's example of Linearizable Consistency model?

A layman's example of Linearizable Consistency model is a line at a grocery store. Each customer waits in line for their turn to check out. The first person in line is served first, and the last person in line is served last. This reflects the idea of linearizability, where the order of operations is preserved.

2. How does Linearizable Consistency model differ from other consistency models?

The main difference between Linearizable Consistency model and other consistency models is that it prioritizes the order of operations over availability or performance. This means that in the event of a system failure, the system may become temporarily unavailable in order to maintain the correct order of operations.

3. Why is Linearizable Consistency model important in distributed systems?

Linearizable Consistency model is important in distributed systems because it ensures that the results of operations are consistent and predictable across all nodes in the system. This is especially important in systems where multiple users are accessing and updating data simultaneously.

4. How does Linearizable Consistency model handle concurrent operations?

Linearizable Consistency model handles concurrent operations by using a technique called atomic operations. This means that each operation is treated as a single, indivisible unit and is executed one at a time. This ensures that the operations are performed in the correct order, even if they are requested at the same time.

5. What are the benefits of using Linearizable Consistency model?

One of the main benefits of using Linearizable Consistency model is that it guarantees the order of operations, which can prevent data inconsistencies and errors. It also simplifies the process of building and maintaining distributed systems, as developers do not need to worry about complex synchronization techniques. Additionally, it can improve the overall performance and scalability of a system by avoiding conflicts between concurrent operations.

Similar threads

  • Programming and Computer Science
Replies
1
Views
693
  • Programming and Computer Science
Replies
1
Views
977
  • Programming and Computer Science
Replies
13
Views
1K
  • Programming and Computer Science
Replies
23
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
Replies
1
Views
943
Replies
7
Views
215
  • High Energy, Nuclear, Particle Physics
Replies
2
Views
1K
  • Computing and Technology
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
988
Back
Top