5

I am trying to insert multiple rows into the Azure table service. As far as this article goes, I have understood the partition key to be able to store duplicates. However, while following this article, when I try to insert a duplicate partition key I get an error:

The remote server returned an error: (409) Conflict.

What could be wrong in my code? I am following it as per the second article; Or is my understanding incorrect? Also, the first article says that the row key is supposed to act as primary key. The second article says I can hardcode it for the example. This has me confused as to what is exactly correct. Both the articles are posted on credible sites. I am working on VS2013 with a trial account for azure. What am I missing?

user20358
  • 14,182
  • 36
  • 114
  • 186
  • Multiple entities can have the same PartitionKey, but the RowKey must be unique within the Partition. Hard to say what exactly is going wrong in your case without knowing what data you are trying to insert, and what data already exists in the table. – Brendan Green Feb 20 '14 at 21:13

1 Answers1

14

The Partition Key + the Row Key together act as a primary key for that entry into the table, this combination must be unique. You can have a virtually unlimited number of rowkeys within a single partition, as long as you don't violate the PK+RK=unique constraint.

Keep in mind however, that throughput scale targets for Azure table storage center around the partition. So the strategy you leverage to identify your partition key should be something that meets your needs for both scale and accessibility.

BrentDaCodeMonkey
  • 5,493
  • 20
  • 18