-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Have you read a contributing guide?
- I have read CONTRIBUTING.md
- I have searched the existing requests and didn't find any that were similar
- I have considered creating a pull request instead and want to proceed
Clear and concise description of the problem
Lines 19 to 20 in 1aec721
| Db() *mongo.Database | |
| Tx(ctx context.Context, f func(txCtx mongo.SessionContext) error) error |
mongo is used in many parts of the project's source code:
Suggested solution
Same with the It's much better in the consensusnodeconsensusnode: https://github.com/anyproto/any-sync-consensusnode/blob/40bce1dbff2598befc37ad0c5a8fc16094f6a68d/db/db.go#L27-L40
I 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.
$ docker compose stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}"
NAME MEM USAGE
any-sync-dockercompose-netcheck-1 19.05MiB
any-sync-dockercompose-any-sync-node-1-1 31.32MiB
any-sync-dockercompose-any-sync-filenode-1 43.5MiB
any-sync-dockercompose-any-sync-consensusnode-1 33.27MiB
any-sync-dockercompose-any-sync-coordinator-1 35.17MiB
any-sync-dockercompose-generateconfig-processing-1 20.54MiB
any-sync-dockercompose-generateconfig-anyconf-1 25.71MiB
any-sync-dockercompose-any-sync-node-3-1 31.77MiB
any-sync-dockercompose-any-sync-node-2-1 32MiB
any-sync-dockercompose-minio-1 183.1MiB
any-sync-dockercompose-mongo-1-1 308.5MiB
any-sync-dockercompose-redis-1 26.3MiB
Alternative
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request