DynamoDB's cost model is built on Read and Write Capacity Units. It's likely that you'll start out in the free tier and it's still good to start building up an understanding of how what you do in DynamoDB will affect how much you pay.
Don't Worry too much. The amounts we're talking about here are dollars for up to a million units.
Instructor: [00:00] We said earlier that DynamoDB has two major pricing models, on-demand and provisioned. The table we're looking at right now has a provision capacity, per beat capacity, as well as write capacity.
[00:12] That capacity is 5 for both. If we look at an on-demand table, you'll see that the read-write capacity mode is on-demand and that there's no provision values. Let's look at what a read capacity unit and a write capacity unit are. When you read from a DynamoDB table for an item up to 4 KB in size, that counts as one read capacity unit.
[00:32] For example, if your item was 8 KB, that would count as two read capacity units. It's the same thing for write capacity units except the amount is smaller. When you're writing, 1 KB is one write capacity unit. A 2 KB item would require two write capacity units.
[00:49] For both read capacity and write capacity units, you have the option of making them strongly consistent or transactional. In this case, that doubles the size of the read capacity unit or write capacity units.
[01:01] If we were reading an item that's 4 KB in size with a strongly consistent or transactional read, it would count as two read capacity units. The same thing happens for transactional writes. If we had an item that was 3 KB or you're going to include it in a transaction write request, that will cost us six write capacity units.
[01:20] If this is a little hard to hold in your head, Dynobase has a DynamoDB pricing calculator that handles the on-demand and provision capacity modes. If we were going to provision 10 write capacity units and 10 read capacity units per second under the free tier, that wouldn't cost us anything. If we weren't using the free tier, that would cost us about six dollars a month.
[01:40] Note that how much data in the table also affects your cost, but we're not talking about how much data is in your table in this video.