Skip to content

Support for Cosmos DB and possibly other NoSQL databases #1102

Closed
@ThomasBarnekow

Description

@ThomasBarnekow

Situation

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions