-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: AEP 6: Sharding and refactoring of MongoDB deployment inside ArmoniK #48
base: main
Are you sure you want to change the base?
Conversation
AEP/aep-00004.md
Outdated
- Since the server is now preferably accessed with SRV strings, the port output is still present for retrocompatibility concerns but hardcoded with a value of 27017 (MongoDB default port). | ||
|
||
**What would be specific to the sharded MongoDB Helm chart ?** | ||
- It would be possible to deploy an out-of-the-box sharded MongoDB instance, with a configurable, but rather static, number of shards. We are currently working on a way to implement autoscaling. The number of config servers replicas and mongos "replicas" would also be configurable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je ne sais pas si cela devrait etre dans cette AEP. Cela me semble out of scope (un nouveau sujet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je pense que l'autoscaling (horizontal) est une conséquence plus que logique au sharding de base de données, donc le mentionner me parait pertinent
# Motivation Following aneoconsulting/ArmoniK.Infra#168, this PR aims to enable the deployment of a sharded MongoDB as ArmoniK's database. A more complete motivation is provided in AEP 004 (aneoconsulting/ArmoniK.Community#48). This PR is meant to treat a previsible bottleneck on ArmoniK's database by enabling a sharded architecture to it. For now, when a sharded database is specified, the following collections will be sharded : - Result - TaskData - SessionData # Description This PR adds : - A method `ShardCollectionAsync` to the `IMongoDataModelMapping` interface. - 2 new `MongoOptions` : a string `AuthSource` and a boolean `Sharding`. - A new class `ShardingExt` containing an extension method `shardCollection` for the `IClientSessionHandle` interface. When the `MongoOption` `Sharding` is true, the `MongoCollectionProvider` calls `ShardCollectionAsync`. Then the implementation depends on whether the collection is wanted to be sharded : - If the collection has to be sharded, the `shardCollection` extension method will be called. - If the collection isn't wanted to be sharded, the method directly returns a complete `Task`. The new `MongoOption` `AuthSource` is required because the `MongoClient` has to authenticate as an administrator to be able to shard a collection. # Testing It has been tested manually. Since these developmentsts are very coupled with ArmoniK's database, it is difficult to write unit tests. Anyhow, it is still possible to have automatized integration tests that would verify in a first time if a deployment of ArmoniK using these deployments succeeds, and in a second time if sharding is indeed enabled on the right collections. Workflows testing a deployment of ArmoniK with a sharded MongoDB are currently being studied. # Impact In the end, it is expected to enhance ArmoniK's strong scalability. # Additional Information To better understand how MongoDB sharding works see [MongoDB's documentation](https://www.mongodb.com/docs/manual/sharding/). To understand why this new MongoOption is required, see : MongoDB's documentation on the [shardCollection database command](https://www.mongodb.com/docs/manual/reference/command/shardCollection/#mongodb-dbcommand-dbcmd.shardCollection) and on [connection string's authSource option](https://www.mongodb.com/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.authSource) # Checklist - [X] My code adheres to the coding and style guidelines of the project. - [X] I have performed a self-review of my code. - [X] I have commented my code, particularly in hard-to-understand areas. - [ ] I have made corresponding changes to the documentation. - [X] I have thoroughly tested my modifications and added tests when necessary. - [X] Tests pass locally and in the CI. - [ ] I have assessed the performance impact of my modifications.
You need to rename the file to aep5 |
It is indeed going to be deleted ! I left the file named aep4 to keep the conversations on it ! |
I would use svg images for the illustrations. This would avoid storing binary files within the repo |
We have a public bucket to store this kind of image. |
No description provided.