Reputation: 6172
From the Microsoft documentation I don't fully understand whether or not CosmosDB using session consistency garantuees no out of order writes. The following quote makes it seem like it has the same garantuees as cosistent prefix:
The reads are guaranteed to honor the consistent-prefix (assuming a single “writer” session), ...
Although from the baseball example further down the page it seems like a reader could get a completely random order back, similar to eventual consistency. From other sources online I also can't find a definitive anwser, apart from the images shown on the Azure Portal that seem to implicitly suggest the same order as the writer.
Upvotes: 1
Views: 948
Reputation: 8515
(I'm from the Cosmos DB team)
A given client using session consistency will see its own writes in order, but see other clients' writes with eventual consistency (assuming using a different session token).
We're gonna update the docs to make that more clear. New text will read something like this:
Session: Within a single client session reads are guaranteed to honor the consistent-prefix (assuming a single “writer” session), monotonic reads, monotonic writes, read-your-writes, and write-follows-reads guarantees. Clients outside of the session performing writes will see eventual consistency.
Upvotes: 3
Reputation: 23782
Per my research, i think session consistency level can't guarantee the clients always read the value in the order.
My evidence is from this link:
As above said,the staleness window is dependent on your actual workload if you choose Session Consistency Level. So,if you do concern about the read order, i suggest you using bounded staleness or even Strong Consistency Level.
Upvotes: 1