Understanding Azure Table Storage billing before I run this script

Tim_Myth 26 Reputation points
2023-06-21T14:58:26.32+00:00

I have an Azure Table Storage table with 2.4 million entities. I need to update one property from "foo" to "bar" where another property equals "baz".

The Azure Table Storage Pricing page say "we charge $0.00036 per 10,000 transactions".

The TableBatchOperation class will Read/Write 100 entities per batch and Storage Performance Checklist says "an entity group transaction counts as a single transaction for billing purposes and can contain up to 100 storage operations". I can't find any language that mentions the size of Batch operations in Azure.Data.Tables (TableTransactionAction/SubmitTransactionAsync) but since I think it too is just a wrapper for the REST API, I'm guessing it also will only do 100 entities per batch.

I am using a filter to read the entities and return only those entities with PropertyB='Baz', and all entities in the table have the same PartitionKey. When I write the data back to the table, I will be writing batches of 100 entities.

Lets assume that 1 million of my entities are Baz entities. So what will be the cost of updating my 2.4 million entities?

Will it be:

A. 2.4 million Read transactions (to find all Baz entities) + 1 million Write transactions (to update Foo to Bar) then divided by 10,000 multiplied by .00036? ((2400000 + 1000000) / 10000) * .00036 = $0.1224

B. 2.4 million Read transactions (to find all Baz entities) + 1 million Write transactions (to update Foo to Bar) then divided by 100 (because that's how big each batch is) multiplied by .00036? ((2400000 + 1000000) / 100) * .00036 = $12.24

C. 1 million Read transactions (because I'm using a filter to find all Baz entities) + 1 million Write transactions (to update Foo to Bar) then divided by 10,000 multiplied by .00036? ((1000000 + 1000000) / 10000) * .00036 = $0.072

D. 1 million Read transactions (to find all Baz entities) + 1 million Write transactions (to update Foo to Bar) then divided by 100 (because that's how big each batch is) multiplied by .00036? ((2400000 + 1000000) / 100) * .00036 = $7.20

E. None of the above?

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
163 questions
0 comments No comments
{count} votes

Accepted answer
  1. Boris Von Dahle 3,121 Reputation points
    2023-06-21T18:13:08.8333333+00:00

    Hello,

    If you have 2.4 million entities to read (to find all 'Baz' entities) and 1 million entities to write (to update 'Foo' to 'Bar'), you would divide these numbers by the batch size (100) to find the number of transactions. The calculation would be:

    ((2400000 read operations / 100) + (1000000 write operations / 100)) / 10,000 * .00036

    This corresponds to option B from your list:

    • 2.4 million Read transactions (to find all Baz entities) + 1 million Write transactions (to update Foo to Bar) then divided by 100 (because that's how big each batch is) multiplied by .00036? ((2400000 + 1000000) / 100) * .00036 = $12.24

    Note that part of this answer was assisted by OpenAI Chat-GPT 4

    Hope this helps

    Regards

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful