ADR: Support Mongo DB API on Cosmos DB
Request to Support Mongo DB API on Cosmos DB
Status
-
Proposed -
Trialing -
Under review -
Approved -
Retired
Context & Scope
SLB has made a contribution of as set of Well Delivery APIs to handle domain objects. The domain objects are stored in Cosmos DB and we are using Mongo DB APIs to avoid having to implement different Cosmos DB APIs depending on the cloud service provider. Today, Microsoft only supports Cosmos Core (SQL) APIs for Cosmos DB.
Option 1: Microsoft to add the ability to provide a Cosmos DB instance with Mongo DB API in the OSDU GitLab environment.
Option 2: Add Cosmos Core API to the Well Delivery APIs and add a configuration to enable using Mongo API or Core based on the deployment environment.
Decision
Rationale
Ideally we would like to keep only Mongo DB API to reduce testing and maintenance. The main reason of choosing MongoDB as the document DB is to achieve portability and to share the same implementation across multiple environments. Right now, we are not using any advanced feature in MongoDB that is not available in other document DBs. If the OSDU design approach is to have a common SPI with multiple implementations fit for each cloud environment best, we also follow this principle and built a SPI layer. So in theory if any cloud vendor wants to bring their own implementation based on their own technology, it is still possible. Azure CosmosDB provides MongoDB API as well, so in the current implementation we are able to use CosmosDB if it is provisioned with MongoDB API.
Consequences
Handling multiple APIs for Cosmos DB at the DMS level increases the code complexity, testing effort and maintenance.