Need a layman's example of Linearizable Consistency model

  • Thread starter Thread starter user366312
  • Start date Start date
  • Tags Tags
    Example Model
Click For Summary
SUMMARY

The Linearizable Consistency model is a data-centric and strong consistency model ensuring that all clients experience the same data and ordering from a single data store. In scenarios with linearizability, operations on shared data are synchronized, whereas asynchronous database replication can lead to inconsistencies. The discussion highlights the difference between a system with linearizability, which uses synchronous replication, and one without, where a Primary node and a Follower node can yield outdated data due to replication lag. To achieve linearizability, synchronous replication must be implemented to ensure immediate visibility of changes across nodes.

PREREQUISITES
  • Understanding of Linearizable Consistency model
  • Familiarity with synchronous and asynchronous database replication
  • Knowledge of Primary and Follower node architecture
  • Concept of strong consistency in distributed systems
NEXT STEPS
  • Research synchronous replication techniques in distributed databases
  • Learn about the implications of strong consistency in cloud databases
  • Explore the differences between linearizability and eventual consistency
  • Investigate tools for monitoring replication lag in database systems
USEFUL FOR

Software architects, database engineers, and developers working with distributed systems who need to understand consistency models and their implications on data integrity.

user366312
Gold Member
Messages
88
Reaction score
3
TL;DR
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
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.​
 

Similar threads

Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
Replies
8
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
Replies
1
Views
3K
Replies
7
Views
3K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
8K