We have a solution utilizing a micro-service approach. One of our micro-service is responsible for pushing data to Cosmos. Our Cosmos database is using serverless provision having a 5,000 RU/s limit.
The data we are inserting into Cosmos looks like the below. There are 10 columns and we are pushing a batch containing 5,807 rows of this data.
| Id | CompKey | Primary Id | Secondary Id | Type | DateTime | Item | Volume | Price | Fee |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Veg_Buy | csd2354csd | dfg564dsfg55 | Buy | 30/08/21 | Leek | 10 | 0.75 | 5.00 |
| 2 | Veg_Buy | sdf15s1dfd | sdf31sdf654v | Buy | 30/08/21 | Corn | 5 | 0.48 | 3.00 |
We are retrieving data from multiple sources, normalizing it, and sending out the data as one bulk execution to Cosmos. The retrieval process happens every hour. We understand that we are spiking the Cosmos database once per hour with the data that has been retrieved and then stop sending data until the next retrieval cycle. So if this high peak is the problem, what remedies exist for such a scenario?
Can anyone shed some light on what we should/need to do to overcome this issue? Perhaps we are missing a setting when creating the Cosmos database or possibly this has something to do with partitioning?