amazon-web-servicesamazon-dynamodbdynamodb-queries

How does AWS DynamoDB count read units for Query?


I am working on a table, in which every item is approx. 3KB in size.

Now as per the docs, the read units are calculated in 4s - i.e. For every item less than 4 kb, it would be counted as 4KB, and occupy 1 read unit.


Let's say i have a table of 100 items, of 3kb each in size (total table = 300kb). I do a query, in which 50 items satisfy under the query condition, and they are returned to me.
Now, will the read units be counted like : 50 items of 3kb size (rounded to 4kb) = 200kb = 200/4 = 50 read units ?

Any help is appreciated! :) Thanks!


Solution

  • I think this should clarify the issue:

    DynamoDB calculates the number of read capacity units consumed based on item size, not on the amount of data that is returned to an application.

    When you do the query, you can specify a parameter ReturnConsumedCapacity to get the number of read capacity units consumed:

    TOTAL — The response includes the aggregate number of read capacity units consumed.

    It also depends if you use eventually consistent reads (by default for query) or strongly consistent: