Throughput and Pricing Example 1 (from Amazon docs)
Your application needs to perform 5 million writes and 5 million eventually consistent reads per day on a DynamoDB table, while storing 8 GB of data. Items are no larger than 1 KB in size.
Pricing: $0.47 per WCU per month, At $0.09 per RCU per month, $0.25 per GB per month.
Write Capacity Units (WCUs)
= 5 million writes per day
= 57.9 writes per second.
1 WCU can handle 1 write per second, so you need 58 WCUs.
At $0.47 per WCU per month, 58 WCUs costs $27.26 per month.
Read Capacity Units (RCUs)
= 5 million reads per day
= 57.9 reads per second.
1 RCU can handle 2 eventually consistent reads per second, so you need 29 RCUs.
At $0.09 per RCU per month, 29 RCUs costs $2.61 per month.
Data Storage: $0.25 (per GB) X 8 (GB) = $2.00.
Total cost is $27.14 + $2.71 + $2.00 = $31.86 per month
Note: If you haven’t consumed your free tier allotment (25 WCUs, 25 RCUs, and 25 GB of storage), then total cost = (58 – 25) WCUs X $0.47 + (29 – 25) RCUs X $0.09 + $0.00 (for storage) = 15.51 + 0.36 = 15.87
Throughput and Pricing Example 2
Application needs to read 10 items of 1 KB per second using eventual consistency. Calculate read throughput.
Approach 1
Read Capacity Units (RCUs)
= 10 reads per second
1 RCU can handle 2 eventually consistent reads per second, so you need 5 RCUs.
Approach 2 (using acloudguru formulae)
(size of read rounded to nearest 4 KB chunk / 4KB) X no. of items
= (4 / 4) X 10 = 10
If eventual consistency, divide by 2 = 10 /2 = 5 RCUs
Throughput and Pricing Example 3
Calculate throughput for reading 10 items of 6 KB per second using eventual consistency.
Approach 1
Read Capacity Units (RCUs)
= 20 reads per second
1 RCU can handle 2 eventually consistent reads per second, so you need 10 RCUs.
Approach 2 (using acloudguru formulae)
(size of read rounded to nearest 4 KB chunk / 4KB) X no. of items
= (8 / 4) X 10 = 20
If eventual consistency, divide by 2 = 20 /2 = 10 RCUs
Note: When the size of read is larger than 4, formulae is easier.
Throughput and Pricing Example 4
Calculate throughput for reading 5 items of 10 KB per second using eventual and strong consistency.
(size of read rounded to nearest 4 KB chunk / 4KB) X no. of items
= (12 / 4) X 5 = 15
If eventual consistency, divide by 2 = 15 /2 = 8 RCUs (cannot be specified as decimals, so 7.5 became 8)
If strong consistency, no divide = 15 RCUs.
Throughput and Pricing Example 5
Calculate throughput for writing 5 items of 10 KB per second.
Size of item X no. of items
= 10 X 5 = 50 WCUs.
Throughput and Pricing Example 6
Calculate read throughput for writing 120 items of 10 KB in one minute, using eventual and strong consistency.
(size of read rounded to nearest 4 KB chunk / 4KB) X no. of items (per scond)
= (16/4) * 2 = 4 * 2 = 8
RCU for strong consistency read = 8.
RCU for eventual consistency read = 8/2 = 4.
NOTE! Actual pricing may have changed after this page was written. So always refer to the reference link and verify. If you see a difference, please do let us know. Usually for exam, you may have to calculate the read and write throughputs.
References:
- heartin's blog
- Log in or register to post comments
Recent comments