How to read and write from multiple cosmos db database present in different datacentres.

Willfin David 1 Reputation point
2023-02-13T07:02:17.28+00:00

I have a multitenant application which has multiple cosmosdb databases present in different datacentres. How can we efficiently read and write from multiple cosmos db database present in different datacentres.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,789 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 16,256 Reputation points
    2023-02-13T09:25:37.7333333+00:00

    Hi @Willfin David ,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand from the question, you want to know "How to read and write from multiple cosmos db database present in different datacenters"

    Please let me know if my understanding is otherwise.

    We can use the concept of Global Distribution in Cosmos DB. Here is the detailed tutorial for the same: Tutorial: Set up Azure Cosmos DB global distribution using the API for NoSQL

    And we can set PreferredLocations using the API for NoSQL illustrated here Connecting to a preferred region using the API for NoSQL.

    Based on the Azure Cosmos DB account configuration, current regional availability and the preference list specified, the most optimal endpoint will be chosen by the SQL SDK to perform write and read operations.

    Hope this information helps. If you have any further query do let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.