简体   繁体   中英

Choosing "Partition Key" in Cosmos DB collection

I have a collection which will store at around 1 millions records monthly in cosmos db collection, which comes to 4-5 GB of data quarterly. I want to create a partition key based on "EventType", but in this case also, each "EventType" reach up 10 GB limit within in a year.

So the next option for us to create a partition key based on "PayerNumber" field. But we may have 10,000 unique payer numbers.

Is it a good idea to choose this field("PayerNumber") to create a partition key? How many logical partitions are supported by Cosmos DB? Is there any limit to it?

Following is the sample json:

{
"PayerName": "XYZ",
"PayerNumber": "XYZ00000667",
"EventType": "CARD_BLOCK",
"EventTypeDescription": "CARD_BLOCK",
"ModifiedByUUID": "4f371d98-0e31-442b-9ff9-9dcf4a629640",
"ModifiedByUserName": "Postman",
"SubscriptionIsPayerAccountBased": false,
"Data": [
    {
        "AccountName": "XYZ",
        "AccountNumber": "XYZ00000667",
        "DriverName": "DSDSDS",
        "ExpiryDate": "2019-03-31",
        "PAN": "*******912068",
        "Status": "Active",
        "VRN": "FDFDFD"
    }
]

}

There is no limit to logical partitions in Cosmos DB. You should read choosing the right partition key article. You might want to create an artificial partition key, based on how your data will be spread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM