I have one user bulk deleting some 50K documents from one container using a stored procedure.
Meanwhile another user is trying to login to the web app (connected to same cosmos db) but the request fails due to rate limit being exceeded.
What should be the best practice in this case in order to avoid service shortages like the one described?
a) Should I provision RUs by collection? b) Can I set a cap on the RU's consumed by bulk operations from code when making a request? c) is there any other approach?
More details on my current (naive/newbie) implementation:
- Two collections : RawDataCollection and TransformedDataCollection
- Partition key values are the customer account number
- RU set at the database level (current dev deployment has minimum 400RUs)
- Bulk insert/delete actions are needed in both collections
- User profile data (for login purposes, etc.) is stored in RawDataCollection
- Bulk actions are low priority in terms of service level, meaning it could be put on hold or something if a higher priority task comes in.
- Normally when user logs in, retrieves small amounts of information. This is high priority in terms of service level.