Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-32657

Sharding GridFS has write bottleneck

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      As https://docs.mongodb.com/manual/core/gridfs/#sharding-gridfs
      says chunks sharding key should be files_id but it's an objectid and changes monotonically.

      As https://docs.mongodb.com/manual/reference/limits/#Monotonically-Increasing-Shard-Keys-Can-Limit-Insert-Throughput
      says
      ```
      For clusters with high insert volumes, a shard keys with monotonically increasing and decreasing keys can affect insert throughput. If your shard key is the _id field, be aware that the default values of the _id fields are ObjectIds which have generally increasing values.
      ```
      So the choice of files_id will lead to the write of gridfs chunks always happens on a single shard.
      It's really a big problem because if someone use gridfs it always means there will be a lot of files data to store and need sharding.

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            narychen Roben
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: