crud-service icon indicating copy to clipboard operation
crud-service copied to clipboard

Creation/deletion of index done to secondary replica sets

Open flower-of-the-bridges opened this issue 1 year ago • 0 comments

Feature Description

Actually, the crud-service deletes and creates indexes at runtime on the configured database. By default, if not specified on the MONGODB connection string, all operations are done on the primary replica set.

When the primary set is required to use a high amount of memory/cpu, a crud-service that starts up and connects to it may increase the operation load on the primary replica set and slow down the whole infrastructure.

Desired solution

At runtime is possible to switch the type of replica set the MongoDB client is used with the method setReadPreference('<replica set type>') from the MongoDbClient.

So I expect that the crud-service can switch the creation/deletion of indexes on the secondary replica set and after the creation/deletion of indexes is completed can return to the main one to perform the operation submitted by the users.

flower-of-the-bridges avatar Mar 31 '23 10:03 flower-of-the-bridges