Q69.Guidelines on how to choose Partition Key and Row Key?

For any given Azure Table, the data architect must define (up front) a Partition Key and a Row Key. This is perhaps the most important decision one has to make when creating Windows Azure Tables. Partition Keys and Row Keys determine how your data is automatically partitioned by the storage service and the way your queries will perform. It is recommended that you understand how your data will be queried before finalizing your decisions on Partition Key and Row Key.

Some rough guidelines and suggestions on how to choose a Partition Key and a Row Key for your table :

  • First list all the important properties of your table.
  • List all the properties used in the queries.
  • List the properties in an order based on the importance of the queries.
  • If all these properties do not identify an entity uniquely, include an unique identifier in the list of key properties.