Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

azure table : Duplicate partition key results in (409) conflict

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?

like image 951
user20358 Avatar asked Feb 20 '14 20:02

user20358


1 Answers

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.

like image 147
BrentDaCodeMonkey Avatar answered Oct 04 '22 18:10

BrentDaCodeMonkey