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

Creating unique index on sharded clusters apart from shard key

    XMLWordPrintable

Details

    Description

      Hi Team,
      Say, we are having two collections named "Students" & "Department" and in "Students" collection we are having the reference of department using the departmentID and each department is having more or less equal number of students. As "Students" collection is having more number of data, I am planning to shard/partition the same with respect to departments to maintain equal distribution and my queries will be modified to include the shard key also. In this case anyhow, I need to maintain uniqueness of "studentID". But unfortunately, currently our MongoDB is not supporting the same. We need to handle the same through application.
      Please consider this scenario in your future builds.

      Adding to this point, the following comments from your Chairman (Dwight Merriman) regarding maintaining the referenceIDs as the shard keys in both the collections to enable join-like sementics in future, clearly indicates that we need this option.
      "It's possible there will be some join-type features in mongodb in the future that have a restricted scope – for example if you sharded all the customer data and orders on customer id, and all those documents are on the same partition, the problem then goes away for that scope."

      Attachments

        Activity

          People

            backlog-server-sharding-nyc Backlog - Sharding NYC
            jebas Kingsly J
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated: