Azure Table Storage data Consistency
Posted
by SeeR
on Stack Overflow
See other posts from Stack Overflow
or by SeeR
Published on 2009-11-19T14:00:16Z
Indexed on
2010/04/09
17:43 UTC
Read the original article
Hit count: 726
Azure
|windows-azure
Let say I have Table in Azure Table Storage
public class MyTable
{
public string PK {get; set;}
public string RowPK {get; set;}
public double Amount {get; set;}
}
And message in Azure Queue which says Add 10 to Amount.
Now let say one worker role
- Takes this message from queue
- Takes row from table
- Amount += 10
- Updates Row in Table
- And Fails
After a while message is available in queue again. So next worker role:
- Takes this message from queue
- Takes row from table
- Amount += 10
- Updates Row in Table
- Removes message from queue
Those actions results in Amount += 20
instead of Amount += 10
.
How can I avoid such situations?
© Stack Overflow or respective owner