-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loose coupling MongoDB #80
Comments
I noticed that anyproto is working on a MongoDB alternative: https://github.com/anyproto/any-store
I'm not sure about the specific goals, but I think we can take a look at FerretDB. It's a MongoDB alternative that uses PostgreSQL or SQLite as a database engine and is licensed under Apache-2.0. Additionally, there is lungo, a MongoDB-compatible embeddable database. FerretDB is also embeddable https://github.com/FerretDB/embedded-example |
https://github.com/anyproto/any-store is not a replacement MongoDB, it's planned to be mostly client-side db |
Cool, what do you think about https://github.com/FerretDB/embedded-example It's embeddable, built on top of SQLite, MIT license, well tested, and it has stable APIs for more than a year https://github.com/FerretDB/FerretDB/releases/tag/v1.0.0 |
I was thinking of test-driving FerretDB as drop-in replacement of MongoDB in the full Compose setup. Will report back any outcomes of this experiment. |
Actually I tried it with any-sync*, some mongo APIs were missing. But I hope I played it in a wrong way. Good luck! And the lungo works great: https://github.com/hellodword/anytype-all/blob/master/patches/any-sync-coordinator-v0.3.25.patch |
FerretDB seems like a good choice if your server-side is mostly based on PostgreSQL but you need to adopt some parts that require MongoDB. Consensus and Coordinator nodes were written and tested with MongoDB as the database. The consensus node uses MongoDB replication and some atomic features, and it has been well-tested, including with fuzzy tests. In my opinion, the best solution is to write a single self-hosted node as a separate project, without dependencies like S3 and MongoDB. For personal usage, strong replication or scalability is not necessary; what's important is small resource consumption and simplicity. This isn't planned yet, but we're considering it, something like an all-in-one "light node". Regarding any-store versus FerretDB on the client-side: |
Love this idea! Please let me know if you have that plan. I was also thinking about this, that's the source of this issue. Currently the default
Got that, thanks. |
+1 really need this, the current docker-compose file is too complicated |
Have you read a contributing guide?
Clear and concise description of the problem
any-sync-coordinator/db/db.go
Lines 19 to 20 in 1aec721
mongo is used in many parts of the project's source code:
https://github.com/search?q=repo%3Aanyproto%2Fany-sync-coordinator+%2Fmongo%2F+language%3AGo+NOT+path%3A%2F%5Edb%5C%2F%2F&type=code
Suggested solution
Same with theIt's much better in theconsensusnode
consensusnode
: https://github.com/anyproto/any-sync-consensusnode/blob/40bce1dbff2598befc37ad0c5a8fc16094f6a68d/db/db.go#L27-L40I believe it is better to extend the interface and abstract mongo within the database layer. This would make it easier for both users and developers to add and use other databases.
For example, in my expected use case, which is a personal self-hosted environment, mongo is too heavy, it'll be great if we can add some lightweight or embedded database.
Alternative
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: