New feature idea: Using ABP on Azure CosmosDB with the MongoDB API
Hi all I have been learning a lot about ABP via this forum and I started using it in an application idea that I have. One thing I want to do is being able to use Cosmos DB on azure which is compatible with the MongoDB api. Technically speaking you can use the mongodb module provided out of the box and it should work but the devil is in the details. Here is where I run into issues:
- Cosmos DB really wants you to share a collection for multiple document type (to save money and be efficient)
- Cosmos DB has a concept of partition key for each collection. Using the partition key in a where clause will result in fact cheap queries but not having a partition key will result in full DB scan and is very expensive. Each logical partition can have a max of 10 gigs worth of data, it's a very important consideration during the design phase
Here is my feature idea 1 Create a new module Volo.Abp.CosmosDB which inherits from Volo.Abp.MongoDB 2 Add two new interfaces ITypedEntity and IPartitionedEntity ITypedEntity will add a fields named Type IPartitionedEntity will add a field named PartitionKey
ITypedEntity will hold a type name like 'User' or 'Order' etc to identify the type of entity pulled in the collection which multiple document type
IPartitionedEntity will have a value for the partition key to satisfy Cosmos DB
The new module would have a new ICosmosDBRepository which inherits from IMongoDBRepository to leverage existing mongo DB code as much as possible.
Is this a good idea or is this better left to each individual application to implement.
Related: https://github.com/abpframework/abp/issues/386
Thank you @rlavaud for your feature and implementation suggestions. I agree on your idea in general and added it to backlog.
Package name would be Volo.Abp.MongoDB.CosmosDB to reflect the dependency better.
Hello @hikalkan sorry I can not see Volo.Abp.MongoDB.CosmosDB package
hi @pramodbobde We haven't started yet.
Now, Abp.io support CosmosDB or not? because I tried many ways to consume cosmmosDB but its my bad. @maliming @hikalkan please guide
It's still in the roadmap.
#2532 CosmosDB integration with EF Core and MongoDB API
See this new article: https://community.abp.io/articles/using-cosmosdb-with-the-abp-framework-via-mongodb-api-x47bjeik