Intro

Azure Cosmos DB offers five consistency levels: Strong, Bounded Staleness, Session, Consistent Prefix, and Eventual. The choice controls observable read order, staleness, regional availability, latency, and request-unit cost. Choose from an operation’s invariant and user experience, not from a product-wide “strong versus eventual” label.

Selection

LevelObservable promiseExample
StrongReads return the latest committed versionA globally ordered control record where stale reads are unacceptable
Bounded StalenessReads lag by at most configured versions or timeInventory dashboards with an explicit maximum lag
SessionOne client gets read-your-writes and related session guaranteesShopping profile and cart interactions
Consistent PrefixReads never observe writes out of order, but may lagA public activity feed where order matters more than freshness
EventualReplicas converge without ordering or freshness boundsDerived recommendations or counters tolerant of temporary anomalies

Concrete client flow

The .NET SDK captures session tokens from responses and sends them on later requests made through the same client. Reuse a singleton CosmosClient; creating one per request discards connection pools and makes session behavior harder to preserve. When a session crosses services, explicitly propagate the relevant token only if the API contract owns that guarantee.

Consistency can also be overridden downward for an individual read when the account default permits it. Do not silently weaken a read that enforces a business invariant.

References