Skip to content
Back to Blog
2 min read

Azure Cosmos DB Consistency Levels Explained

I wrote “Azure Cosmos DB Consistency Levels Explained” to share practical, production-minded guidance on this topic.

The Five Levels

1. Strong

  • Reads always return most recently committed write
  • Global ordering of operations
  • Highest latency, lowest throughput
  • Use when: Financial transactions, inventory systems

2. Bounded Staleness

  • Reads lag behind writes by at most K versions or T time
  • Global ordering guarantee
  • Use when: Gaming leaderboards, stock quotes

3. Session (Default)

  • Strong consistency within a session
  • Monotonic reads, writes, and read-your-writes
  • Best balance for most applications
  • Use when: User profiles, shopping carts

4. Consistent Prefix

  • Reads never see out-of-order writes
  • No gaps in sequence
  • Use when: Analytics, social feeds

5. Eventual

  • No ordering guarantees
  • Lowest latency, highest throughput
  • Use when: Likes/retweets, non-critical counters

Setting Consistency

from azure.cosmos import CosmosClient, PartitionKey

# Account-level default
client = CosmosClient(url, credential, consistency_level='Session')

# Per-request override (weaker only)
container.read_item(
    item='123',
    partition_key='partition1',
    consistency_level='Eventual'
)

Cost Impact

LevelRU CostLatency
Strong2xHighest
Bounded Staleness2xHigh
Session1xMedium
Consistent Prefix1xLow
Eventual1xLowest

Strong and Bounded Staleness cost double because reads wait for quorum.

Practical Guidance

Start with Session - it provides intuitive consistency for users while maintaining good performance. Only go stronger when you have proven requirements.\n\n## Takeaways\n\nAdd a concise, personal takeaway and recommended next steps here.\n

Michael John Peña

Michael John Peña

Senior Data Engineer based in Sydney. Writing about data, cloud, and technology.