Migration and synch from one Azure Cosmos DB for MongoDB to another Azure Cosmos DB for MongoDB

Sreenath HS 45 Reputation points
2024-07-11T20:39:11.79+00:00

Hello

I have task to create a read only replica of Azure Cosmos DB for MongoDB. We currently have a Azure Cosmos DB for MongoDB setup in two regions with Multi-region writes enabled. We have application services in each region pointing to this with no Preferred Region in connection string. We are looking to create read-only replica that will be used for analytics and reporting purpose. Since multi-region writes is enabled we cannot have read-only copy.

From what I have seen I see below potential solution

  1. Create a third writable region. Update connection string such that
    1. we can application to respective specific region using Preferred Region in connection string
    2. Analytics or Reporting solution points to the new third region using Preferred Region in connection Theoretically above solution should work, but I am concerned that we may have have potential performance issue when one of the first two regions fails and cosmos DB start processing application request in the region dedicated for Analytics or reporting. Since it multi-region there is no concept of failover so we cannot set failover priority.
  2. Create a new Azure Cosmos DB for MongoDB dedicated for analytics and reporting
    1. Perform one time migration using may be using one of the below option
      1. Point In Time Restore (PiTR) option
      2. Azure Data Factory
      3. Azure Cosmos DB Desktop Data Migration Tool (I am not sure if this supports Cosmos DB for MongoDB)
    2. Ongoing data synch using one of the below option
      1. Change feed
      2. Azure Data Factory (I am not sure if Copy data supports delta copy in Cosmos DB for MongoDB)

I looked at several document but it was not clear if those options are supported in case of Cosmos DB for MongoDB.

It would be helpful if this community can share some suggestions and recommendations on this.

Thank you

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

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 15,341 Reputation points
    2024-07-12T09:20:11.0833333+00:00

    Hi Sreenath HS •,

    Welcome to Microsoft Q&A forum.

    As I understand, you want to migrate and sync from one Azure Cosmos DB for MongoDB to another Azure Cosmos DB for MongoDB.

    As mentioned by you the 2 approaches, please try Azure Data Factory approach and let us know if you face any issue in doing the same.

    https://learn.microsoft.com/en-us/azure/data-factory/connector-azure-cosmos-db-mongodb-api?tabs=data-factory

    Also if you want to get the changes made to the collection or to the items in a single shard, use Change Streams as described here: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/change-streams?tabs=javascript

    Let us know if this helped or you have a different ask.

    Thanks

    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.