You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
The project has a direct dependency on MongoDB. Product owners are considering implementing an abstraction layer:
We have considered in the past providing Database Adapters on top of TypeORM [1] to make the developer experience seemingly across different infrastructures, that can support a range of OSI-compliant DB and MongoDB, which would be our main choice. After some investigation, in the current state what prevents FerretDB from being a drop-in replacement is the lack of support for the $lookup aggregation pipeline [2] and our choice to use virtual populates. With TypeORM support this would need to change anyway and these are architectural decisions to save disk space due to our constrained resources but flexible and easy to replace with a foreign key strategy. Also, NestJS modularity [3] and domain-driven design combined with its extensibility make it possible for the community to create their own interfaces with the platform resources, much like MediaWiki allow with its extension system. In that way it's technically possible to support any kind of DB as long as the resource interfaces are respected. [1] https://github.com/typeorm/typeorm [2] FerretDB/FerretDB#1427 [3] https://docs.nestjs.com/modules#feature-modules
Further technical proof of implementation of TypeORM would be needed beyond the theoretical possibility. To be followed up via support email by @kagaba
I created this repository with a POC on how NestJS can be used to create abstractions to have different code flows based on the desired DB but keeping the interfaces cohesive and functioning in the architectural design. In this POC I demonstrated a functioning CRUD interface for a resource going through the same API but storing on different databases (MongoDB and PostgreSQL) depending on an environment configuration.
I decided to just showcase plain NestJS and Typescript interfaces because this approach allows a much broader set of alternatives. Also, I did my best to keep it simple and complete the POC as soon as possible due to time constraints.
I'm not betting that TypeORM can be a silver bullet, especially if you want to support FerretDB (which I'm not familiar with btw). But as I mentioned before, even if you can do that easily, our code contains aggregations pipelines not supported by FerretDB yet. The DB abstractions strategy should work but interfaces should be implemented for the target databases.
Bound to Ory hosted version, ask if any feature is not present on the open source version.
Technical proof of replacing Mongo, beyond general NextJS framework capabilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Platform IndependenceApplications that need additional work to achieve platform independenceReviewer CheckinApplications to be discussed in the next reviewer check-inSupportApplications that need additional support from the review team
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Public Link : https://app.digitalpublicgoods.net/a/10585