Reputation: 6029
I know it is working but I will like to know it this is a good practice of having the same string as PartitionKey and RowKey?
Thi scenario is for one single table where all items are unique, Customer
table where every row has info about one single customer.
What I mean is that for example I will get this unique customer ID and I want to use it to get the record by PartitionKey + RowKey so the return will be fast and one single item.
What do you think?
Upvotes: 8
Views: 8868
Reputation: 10985
This will certainly make your customer look up quick. The RowKey can be an empty string so you technically don't have to make PartitionKey and Rowkey match if you will have a unique partition for every customer.
A couple of things to note here:
Check out the How to get most out of Windows Azure Tables article on choosing partition keys. You'll see most of what I said here is there as well (one of the places I learned it from) plus more.
Upvotes: 17
Reputation: 3748
Using a consistent string ID, "0" as your RowKey has the same uniqueness outcome as double PK. PK+0 = PK+PK.
A practical solution is considering the most common query process. You might use the zip/pocode within the PartitionKey -- and then the customer GUID in the RowKey. If your customer base is evenly spread over the country. PartitionKey doesn't necessitate PrimaryKey...
Upvotes: 2