abp icon indicating copy to clipboard operation
abp copied to clipboard

New feature idea: Using ABP on Azure CosmosDB with the MongoDB API

Open rlavaud opened this issue 6 years ago • 7 comments

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:

  1. Cosmos DB really wants you to share a collection for multiple document type (to save money and be efficient)
  2. 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.

rlavaud avatar Dec 25 '19 22:12 rlavaud

Related: https://github.com/abpframework/abp/issues/386

maliming avatar Dec 26 '19 01:12 maliming

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.

hikalkan avatar Dec 26 '19 05:12 hikalkan

Hello @hikalkan sorry I can not see Volo.Abp.MongoDB.CosmosDB package

pramodbobde avatar Aug 18 '20 06:08 pramodbobde

hi @pramodbobde We haven't started yet.

maliming avatar Aug 18 '20 06:08 maliming

Now, Abp.io support CosmosDB or not? because I tried many ways to consume cosmmosDB but its my bad. @maliming @hikalkan please guide

pramodbobde avatar Aug 18 '20 06:08 pramodbobde

It's still in the roadmap.

#2532 CosmosDB integration with EF Core and MongoDB API

maliming avatar Aug 19 '20 02:08 maliming

See this new article: https://community.abp.io/articles/using-cosmosdb-with-the-abp-framework-via-mongodb-api-x47bjeik

hikalkan avatar Nov 24 '21 08:11 hikalkan