Skip to the content.

🧩 Data Consistency & Its Levels

Definition:

Data consistency ensures that all users and systems see the same data at any given point, following defined rules and constraints.

In distributed systems, consistency levels define how up-to-date or synchronized replicas are.


1️⃣ Types / Levels of Consistency

Level Description Example / Use Case
Strong Consistency All reads always return the latest write. Banking transactions, inventory systems
Eventual Consistency Data will eventually become consistent, but may be stale temporarily. DNS, social media feeds, shopping cart views
Causal Consistency Reads reflect causal relationships; if write A causes B, then B is visible after A. Collaborative editing (Google Docs)
Read-Your-Write Consistency A client always sees its own writes immediately. User profile updates in apps
Session Consistency All operations within a session see a consistent view. Web sessions in a shopping app
Monotonic Read/Write Ensures reads/writes don’t go backward in time. Messaging apps, logs

2️⃣ Why Consistency Matters


3️⃣ Consistency vs Latency / Availability

Text Diagram:

Client → Read/Write → Database Replicas
  |
  ├─ Strong Consistency: Read always latest write
  ├─ Eventual Consistency: Read may be stale
  └─ Session/Read-Your-Write: Client sees own writes immediately

4️⃣ Analogy


💡 Key takeaway: