How to query secondary replicas in Azure Cosmos DB
Clash Royale CLAN TAG#URR8PPP
How to query secondary replicas in Azure Cosmos DB
As per this article, https://docs.microsoft.com/en-us/azure/cosmos-db/distribute-data-globally, each partition consists of four replicas for high availability.
Also, I understand that Stored procedures always run against the primary replica (where all writes go).
When we use DocumentClient to issue client side queries, there are options to set to query across specific regions. But I am not able to find how to query the secondary replicas.
ConsistencyLevel
DocumentClient
@NickChapsas Do the queries from Stored procedures also hit the secondary or just the queries from the client side?
– vmn
Aug 5 at 22:35
I don't think it is done on the client side but don't quote me on that.
– Nick Chapsas
Aug 5 at 22:43
1 Answer
1
How to query secondary replicas in Azure Cosmos DB
You may could get the answer from this document.
Azure Cosmos DB provides global distribution out of the box for availability and low latency reasons. You do not need to setup replicas etc. All writes are always durably quorum committed in a any region where you write while providing performance guarantees.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You don't query the secondary replicas. CosmosDB does this for you. You can however provide the
ConsistencyLevel
as part of youDocumentClient
initialisation which will affect the replica querying– Nick Chapsas
Aug 5 at 19:08