You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/consistency-levels.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: sidandrews
6
6
ms.reviewer: mjbrown
7
7
ms.service: cosmos-db
8
8
ms.topic: conceptual
9
-
ms.date: 02/17/2022
9
+
ms.date: 09/26/2022
10
10
ms.custom: cosmos-db-video
11
11
---
12
12
# Consistency levels in Azure Cosmos DB
@@ -31,8 +31,6 @@ Each level provides availability and performance tradeoffs. The following image
31
31
32
32
:::image type="content" source="./media/consistency-levels/five-consistency-levels.png" alt-text="Consistency as a spectrum" border="false" :::
33
33
34
-
The consistency levels are region-agnostic and are guaranteed for all operations regardless of the region from which the reads and writes are served, the number of regions associated with your Azure Cosmos account, or whether your account is configured with a single or multiple write regions.
35
-
36
34
## Consistency levels and Azure Cosmos DB APIs
37
35
38
36
Azure Cosmos DB provides native support for wire protocol-compatible APIs for popular databases. These include MongoDB, Apache Cassandra, Gremlin, and Azure Table storage. When using Gremlin API and Table API, the default consistency level configured on the Azure Cosmos account is used. For details on consistency level mapping between Cassandra API or the API for MongoDB and Azure Cosmos DB's consistency levels see, [Cassandra API consistency mapping](cassandra/apache-cassandra-consistency-mapping.md) and [API for MongoDB consistency mapping](mongodb/consistency-mapping.md).
@@ -105,11 +103,11 @@ Clients outside of the session performing writes will see the following guarante
105
103
106
104
### Consistent prefix consistency
107
105
108
-
In consistent prefix option, updates that are returned contain some prefix of all the updates, with no gaps. Consistent prefix consistency level guarantees that reads never see out-of-order writes.
106
+
In consistent prefix, updates made as single document writes see eventual consistency. Updates made as a batch within a transaction, are returned consistent to the transaction in which they were committed. Write operations within a transaction of multiple documents are always visible together.
109
107
110
-
If writes were performed in the order `A, B, C`, then a client sees either `A`, `A,B`, or `A,B,C`, but never out-of-order permutations like `A,C` or `B,A,C`. Consistent Prefix provides write latencies, availability, and read throughput comparable to that of eventual consistency, but also provides the order guarantees that suit the needs of scenarios where order is important.
108
+
Assume two write operations are performed on documents Doc1 and Doc2, within transactions T1 and T2. When client does a read in any replica, the user will see either “Doc1 v1 and Doc2 v1” or “ Doc1 v2 and Doc2 v2”, but never “Doc1 v1 and Doc2 v2” or “Doc1 v2 and Doc2 v1” for the same read or query operation.
111
109
112
-
Below are the consistency guarantees for Consistent Prefix:
110
+
Below are the consistency guarantees for Consistent Prefix within a transaction context (single document writes see eventual consistency):
113
111
114
112
- Consistency for clients in same region for an account with single write region = [Consistent Prefix](#consistent-prefix-consistency)
115
113
- Consistency for clients in different regions for an account with single write region = [Consistent Prefix](#consistent-prefix-consistency)
0 commit comments