Book Image

Microsoft Azure Storage Essentials

By : Chukri A Soueidi
Book Image

Microsoft Azure Storage Essentials

By: Chukri A Soueidi

Overview of this book

Table of Contents (16 chapters)
Microsoft Azure Storage Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Selecting the best PartitionKey


The key selection process might be the trickiest part when it comes to tables. Three things to keep in mind when picking the key:

  • Scalability: How to be able to distribute data evenly among partitions

  • Efficient queries: How to avoid frequent large scans

  • Entity Group Transactions: How to reduce round trips to the server

Your choice of PartitionKey should achieve balance between the above, ensuring scalability, efficient querying and data consistency. Normally, you will find the most suitable property in your entity for distributing your entities into adequate partitions.

Here are some guidelines that will help you select your key:

  • If your entity has one key property, use this property as the PartitionKey.

  • If your entity has two key properties, use one as PartitionKey and the other as RowKey.

  • In many cases you may have more than one dominant query for your entities. You can then insert the same entity multiple times in the table with different RowKeys; this can be...