ReviseAlgo Logo
Beginner8 min readFoundations of Distributed Systems

Consistency Models

Navigating absolute linearizability, casual ordering, session-guarantees, and eventual consistency boundaries.

What you'll learn

  • Linearizability (Strong Consistency)
  • Sequential Consistency
  • Causal Consistency
  • Read-Your-Writes (Session Consistency)
  • Monotonic Reads
  • Eventual Consistency

TL;DR

Navigating absolute linearizability, casual ordering, session-guarantees, and eventual consistency boundaries.

Visual System Topology

Consistency Models Execution Topology

Inbound Node Ingests request
Consistency Models Engine Processes operations
Target Replica Updates state

Concept Overview

Consistency models define the guarantees a distributed system makes about the ordering and visibility of read and write operations across replicas. They form a spectrum from the strongest (linearizability) to the weakest (eventual consistency), with each level trading correctness guarantees for performance and availability.

Understanding consistency models is critical because the correct choice fundamentally changes your database selection, application code (conflict resolution logic), and user experience. Most distributed databases expose multiple consistency levels, letting you tune per-operation.

The models from strongest to weakest: LinearizabilitySequential ConsistencyCausal ConsistencyRead-Your-Writes (Session Consistency)Monotonic ReadsEventual Consistency.

Key Architectural Pillars

1

Linearizability (Strong Consistency)

The strictest model. Every operation appears to execute atomically at a single point in time, and all operations are globally ordered. Any read returns the most recent write, regardless of which replica is queried. Requires coordination between replicas on every operation.

Example: After writing balance=500 to node A, reading from node B immediately returns 500. No stale reads are possible.
2

Sequential Consistency

All operations appear to execute in some sequential order consistent with each process's program order. Slightly weaker than linearizability: there may not be a single real-time global order, but within each process, operations appear ordered.

Example: Two clients writing A=1 and B=2 will be seen by all other clients as either A=1 first then B=2, or B=2 then A=1 — but all clients see the same order.
3

Causal Consistency

Operations that are causally related must be seen by all processes in the same causal order. Concurrent (causally unrelated) operations may be seen in different orders by different processes. Much more practical than linearizability for geo-distributed systems.

Example: If Alice posts a comment and Bob replies to it, all users must see Alice's comment before Bob's reply. Unrelated posts by Carol may appear in any order.
4

Read-Your-Writes (Session Consistency)

A client always sees its own writes reflected in subsequent reads, even if the write hasn't propagated to all replicas yet. Critical for basic usability: after a user changes their profile, they should immediately see the change.

Example: After changing your profile picture on Instagram, refreshing the page always shows your new picture — even if the change hasn't propagated to all edge nodes.
5

Monotonic Reads

If a client has seen a value at time T, it will never see an older value in subsequent reads. Reads may be stale but they don't go backward in time.

Example: If you see your post's like count as 100, a subsequent refresh will never show 95. It might show 100 or 105, but never less.
6

Eventual Consistency

The weakest model. If no new writes occur, all replicas will eventually converge to the same value. No guarantee on when convergence happens or what order reads reflect. Provides maximum availability and lowest latency.

Example: DNS caches: after updating a domain's IP address, different users around the world may see the old IP for up to 24 hours (TTL) before the change propagates.

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In
Consistency Models - Module 1: Foundations of Distributed Systems | System Design | Revise Algo