We have a write-heavy data so much that we are constantly experiencing RATE LIMIT on our application from COSMOS (mongo API) and we just not able to keep up with the pace of data that we have to insert then the rate of an insert we are seeing using COSMOS.
First, we already have Auto Scale Enable the RU is currently set to 55000 we might change it to serverless but before I need to understand the how COSMOS physical partition and logical partition understanding and whether the partition key selection is correct
So Cosmos states that
Maximum RUs per (logical) partition 10000
We Partition data on hourly rate example(this is done because we are planning to filter on date for our read request)
2020-09-17 00:00:00 -> 1 logical parition
2020-09-17 01:00:00 -> 2 logical partition
2020-09-17 02:00:00 -> 3 logical partition
and so on.
Now it's mentioned that in CosmosDB.
If we provision a throughput of 18,000 request units per second (RU/s), then each of the three physical partition can utilize 1/3 of the total provisioned throughput. Within the selected physical partition, the logical partition keys Beef Products, Vegetable and Vegetable Products, and Soups, Sauces, and Gravies can, collectively, utilize the physical partition's 6,000 provisioned RU/s.
The physical partition is something that is internal to COSMOS DB given in the above scenario but this is something (mention above) is puzzling me
So my questions are?
If our script is inserting record for shared key
2020-09-18 00:00:00
Will
2020-09-18 00:00:00logical partition gets the full 51000 RU or 10000 RU as mentioned by COSMOS.If we have 100 physical partition does the RU is shared among all the 100 partitions equally(strictly) even though the other Physical partition is not Serving any RU.