Book Image

Learning Azure DocumentDB

By : Riccardo Becker
Book Image

Learning Azure DocumentDB

By: Riccardo Becker

Overview of this book

Learning DocumentDB adopts a practical, step-by-step approach to help you learn the basics of DocumentDB and use your new-found abilities in real-life scenarios and enterprise solutions. We start with the absolute basics, such as setting up a DocumentDB environment, and guide you through managing your databases, and executing simple and complex queries. Next, we explain how to work with DocumentDB using the open REST protocol, and demonstrate how JavaScript works with DocumentDB. We’ll also show you how to authenticate and execute queries. Moving on, you’ll find out how to use DocumentDB from within Node.js to kick-start your Node.js projects. Next, you’ll discover how to increase the performance of your DocumentDB database and fine-tune it. Finally, you’ll get to grips with using DocumentDB in conjunction with other services offered from the Microsoft Azure platform.
Table of Contents (15 chapters)
Learning Azure DocumentDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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

CollectionSizeUsage

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.

CollectionUsage

This specifies the number of collections present in the account.

CurrentResourceQuotaUsage

This returns the current size of the entity involved. This one can be useful to see if the documents we are adding...