Integrating Cosmos DB with MongoDB

By following these steps, you can successfully integrate Cosmos DB with MongoDB:


  1. Setting Up Cosmos DB
    To initiate the integration of Cosmos DB with MongoDB, start by creating a Cosmos DB Account specifically configured for MongoDB.
    • Creating a Cosmos DB Account (Cosmos for MongoDB).
    • Select Cosmos for MongoDB option while creating Cosmos account in Azure.
    Note: Ensure that the total throughput limit is sufficiently high, with a minimum of 40,000 Request Units per second (RU/s).
  2. Download and Install Link
    For installing Link, see the earlier chapters related to Link installation.
    Note: To utilize Cosmos DB with Link, if Link is already installed, it is recommended to uninstall the existing installation and then perform a fresh installation. This ensures that the installation process is aligned with the Cosmos DB configuration requirements and helps prevent any potential conflicts or issues that may arise from an existing installation. Follow the uninstallation guidelines provided in this guide before initiating the reinstallation process to ensure a clean and seamless integration with Cosmos DB.
  3. Link Configuration
    Configure the database connection settings to establish the link between Cosmos DB and MongoDB.
    • Database Connection Settings: Update the config.yaml file and ensure that the Cosmos DB URI is correctly specified for linking with Cosmos DB.
    • Authentication and Authorization: No changes are required in the authentication and authorization settings.
  4. Data Migration
    During the installation of the link, the mdb and rdb_XXXXX databases will be created under Cosmos DB. All predefined collections and documents will be generated, ensuring a seamless migration of existing data.
  5. Restart Link
  6. Test and Deployment
    • Conduct thorough testing of the integration.
    • Deploy the integration to the production environment after successful testing.