Managing performance
DocumentDB offers information about performance. We can use these to fine-tune our indexing policy and make the best decision on performance versus storage.
We can check the ResourceResponse
class to get more information about the used RUs for a specific operation but also on other metrics. The following table outlines some of the properties of the ResourceResponse
class that can be used to gather some metadata on the resource requests we perform:
Property |
Description |
---|---|
|
This returns the current size of a collection in kilobytes. This can be useful to detect if we are about to exceed the maximum of the collection. Based on this we can shard, scale out, or perform some other operation to prevent adding a document from failing. |
|
This specifies the number of collections present in the account. |
|
This returns the current size of the entity involved. This one can be useful to see if the documents we are adding... |