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/tutorial-global-distribution-table.md
+7-9Lines changed: 7 additions & 9 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: akshanka
6
6
ms.service: cosmos-db
7
7
ms.subservice: cosmosdb-table
8
8
ms.topic: tutorial
9
-
ms.date: 12/02/2019
9
+
ms.date: 01/30/2020
10
10
ms.reviewer: sngun
11
11
---
12
12
# Set up Azure Cosmos DB global distribution using the Table API
@@ -22,19 +22,17 @@ This article covers the following tasks:
22
22
23
23
## Connecting to a preferred region using the Table API
24
24
25
-
In order to take advantage of [global distribution](distribute-data-globally.md), client applications can specify the ordered preference list of regions to be used to perform document operations. This can be done by setting the [TableConnectionPolicy.PreferredLocations](/dotnet/api/microsoft.azure.documents.client.connectionpolicy.preferredlocations?view=azure-dotnet) property. The Azure Cosmos DB Table API SDK picks the best endpoint to communicate with based on the account configuration, current regional availability and the supplied preference list.
25
+
In order to take advantage of the [global distribution](distribute-data-globally.md), client applications should specify the current location where their application is running. This is done by setting the `CosmosExecutorConfiguration.CurrentRegion` property. The `CurrentRegion` property should contain a single location. Each client instance can specify their own region for low latency reads. The region must be named by using their [display names](https://msdn.microsoft.com/library/azure/gg441293.aspx) such as "West US".
26
26
27
-
The PreferredLocations should contain a comma-separated list of preferred (multi-homing) locations for reads. Each client instance can specify a subset of these regions in the preferred order for low latency reads. The regions must be named using their [display names](https://msdn.microsoft.com/library/azure/gg441293.aspx), for example, `West US`.
27
+
The Azure Cosmos DB Table API SDK automatically picks the best endpoint to communicate with based on the account configuration and current regional availability. It prioritizes the closest region to provide better latency to clients. After you set the current `CurrentRegion` property, read and write requests are directed as follows:
28
28
29
-
All reads are sent to the first available region in the PreferredLocations list. If the request fails, the client will fail down the list to the next region, and so on.
29
+
***Read requests:**All read requests are sent to the configured `CurrentRegion`. Based on the proximity, the SDK automatically selects a fallback geo-replicated region for high availability.
30
30
31
-
The SDK attempts to read from the regions specified in PreferredLocations. So, for example, if the Database Account is available in three regions, but the client only specifies two of the non-write regions for PreferredLocations, then no reads will be served out of the write region, even in the case of failover.
31
+
***Write requests:** The SDK automatically sends all write requests to the current write region. In a multi master account, current region will serve the writes requests as well. Based on the proximity, the SDK automatically selects a fallback geo-replicated region for high availability.
32
32
33
-
The SDK automatically sends all writes to the current write region.
33
+
If you don't specify the `CurrentRegion` property, the SDK uses the current write region for all operations.
34
34
35
-
If the PreferredLocations property is not set, all requests will be served from the current write region.
36
-
37
-
That's it, that completes this tutorial. You can learn how to manage the consistency of your globally replicated account by reading [Consistency levels in Azure Cosmos DB](consistency-levels.md). And for more information about how global database replication works in Azure Cosmos DB, see [Distribute data globally with Azure Cosmos DB](distribute-data-globally.md).
35
+
For example, if an Azure Cosmos account is in "West US" and "East US" regions. If "West US" is the write region and the application is present in "East US". If the CurrentRegion property is not configured, all the read and write requests are always directed to the "West US" region. If the CurrentRegion property is configured, all the read requests are served from "East US" region.
0 commit comments