Skip to content

Support disabling index creation #55

@imperugo

Description

@imperugo

Hi,
I'm writing this issue not in order to open a bug, but to share some possible scenarios related the index creation into MongoDb.

Looking the code it seems you are creating the indexes using the specific method that comes out of the box with the c# driver.
That's pretty good in commons scenarios but, if you have a sharded cluster probably the best way to manage the indexes into the MongoDb Ops Manager and not via code.

Let's think the scenario where you are running your application but you have to scale up your db, create a new sharded instance, new replicaset, disaster recovery, backup or whatever you need.

MongoDB backups automatically include any indexes you create using Ops Manager.

The ops manager is able to create all the indexes in a new instance easily, doing this via c# is more complicated because you have to stop & run again the application.
Moreover you are using unique index in some case and, in a sharded environment, the unique index works only if you include the shard key into the index.

MongoDB does not support unique indexes across shards, except when the unique index contains the full shard key as a prefix of the index. In these situations MongoDB will enforce uniqueness across the full key, not a single field.

Of course I'm not sure about everything I wrote in this post :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions