Real-World Case Studies: Consistency Models

✅ Source-checked. Each deep dive names its source, and we kept only what that source says. Found an error, or something the source doesn't support? Report it on the tracking issue.

The consistency spectrum as real products expose it: Spanner at the strong end, Azure Cosmos DB with five selectable levels, and DynamoDB's per-request choice between eventual and strong reads.


🏢 Deep Dive 1: Google Spanner, External Consistency

Source: Spanner: Google's Globally-Distributed Database (Corbett et al., OSDI 2012). Everything in this section comes from the paper.


🌐 Deep Dive 2: Azure Cosmos DB, Five Levels You Can Choose

Sources: Microsoft Learn, Consistency levels in Azure Cosmos DB and Manage consistency levels. Everything in this section comes from those pages.

"From strongest to weakest, the levels are: Strong, Bounded staleness, Session, Consistent prefix, Eventual."

Level What the docs promise
Strong "a linearizability guarantee": reads return "the most recent committed version of an item"
Bounded staleness the lag between regions "is always less than a specified amount": K versions or T time, "whichever is reached first"
Session within one client session, "read-your-writes, and write-follows-reads guarantees"
Consistent prefix writes in one multi-document transaction "are always visible together"
Eventual a read may hit a replica that is "lagging and could return stale or no data"

⚡ Deep Dive 3: Amazon DynamoDB, Choose per Read

Source: AWS docs, DynamoDB read consistency. Everything in this section comes from it.


ℹ️ An earlier version of this page claimed NTP clocks drift "100ms to 250ms" across data centers, and described Netflix pinning sessions to replicas and letting bookmarks lag "2 to 5 seconds". We couldn't find sources for those claims, so we replaced them with the documented Cosmos DB and DynamoDB behaviour.

🎯 System Design Interview Takeaways

  1. Name the anomaly each level prevents. Session consistency in Cosmos DB, for example, guarantees you read your own writes. Eventual consistency doesn't.
  2. Strong consistency costs real money. Cosmos DB halves read throughput and DynamoDB doubles read cost for the stronger option.
  3. Session guarantees need plumbing. If requests from one user can hit different app servers, the session token (or equivalent) must travel with them.