Support for Cosmos DB and possibly other NoSQL databases
See original GitHub issueSituation
JADNC provides excellent support for relational databases out of the box. However, the support for NoSQL databases such as Cosmos DB or MongoDB is comparably limited. For example, while there is an EF Core provider for Cosmos DB, that provider does not support joins, meaning that certain requests will lead to runtime errors. Owing to the limitations of MongoDB, the MongoRepository<TResource, TId>
provided by JsonApiDotNetCore.MongoDb also does not support relationships.
What would be great?
It would be great to have better support for NoSQL databases in JADNC. In the ideal case (in practice where reasonably possible), JADNC would offer the same API features (e.g., support for relationships) that are currently offered for SQL databases.
Status
I have implemented an IResourceService<TResource, TId>
for Cosmos DB (and possibly other NoSQL databases such as MongoDB) that supports relationships. It deals with secondary and included resources so that the IResourceRepository<TResource, TId>
does not have to handle includes or joins. Apart from that IResourceService<TResource, TId>
, I implemented a very slim IResourceRepository<TResource, TId>
that provides a workaround for exceptions thrown by the DeleteAsync()
method in certain cases. Otherwise, there are actually no dependencies on Cosmos DB specifically, meaning that only a database-specific IResourceRepository<TResource, TId>
implementation would be required to add support for the next NoSQL database.
Question
Would you be interested in adding this IResourceService<TResource, TId>
implementation to JADNC? I would love to contribute back to this project.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Hi @ThomasBarnekow, I’ve been following your updates closely. I’m currently working on introducing non-nullable reference types into the
openapi
branch which has proven to be quite a demanding task. Once I’ve finished this, your PR is up next on my list. Thanks again for getting involved, we’re both happy to see the increase in community involvement!Hi @bart-degreed and @maurei, I would be really keen on getting some feedback on my PR now. I’ve added instructions (in the PR), an example (CosmosDbExample), and a set of integration Tests (CosmosDbTests).