Reputation: 861
After reading several documentations and blogs about Dynamodb, I'm still struggling to understand how does RCU and WCU works.
I deployed a table with 5 RCU. The request on this table is mostly a GetItem
request with an average response payload of 7KB. I know it's not the size of the payload that will be measured but the consumed data size during a read operation. But let's just hypothetically say it consumed similar data size.
From Dynamodb docs, each provisioned RCU can support up to 4KB of consistent read so if I understand it, my provisioned throughput can support up to 20KB per second without throttling.
Based on this, if my average payload is 7KB, am I correct in saying that, my table can support like ~ 2 request/sec?
Would appreciate if anyone can shed some lights on this.
Upvotes: 3
Views: 3296
Reputation: 21912
Yes you're correct
You probably already know some of this, but for sake of completeness and to help others, I'm going to detail a bit:
WCU is Write Capacity Unit
Eventually consistent read: You may get stale data if the latest writes didn't replicate everywhere yet.
Units are not equivalent to request per seconds. Based on what and how you read, there are different performance profiles. I'll explain.
There are 3 kinds of reads: Strongly consistent, transactional and eventually consistent. It goes like this:
Per 4Kb blocks of data returned (which may be multiple rows from the DB):
So for your example where your items are about 7Kb and you want to do strongly consistent reads, it'll require 2 RCUs to read 1 item per second. Since you've provisioned 5 RCUs, you are correct and you can expect about 2 reads per second.
If you want to squeeze more juice out of your DB, be mindful how much data you are returning. I think if you're average item size is 7Kb, that's a little concerning. You may want to consider an object store instead and store references to the payloads in dynamodb instead of the payloads themselves. I guess it depends what you are storing and your use case. It might be legit, but it sounds a bit suspicious.
Upvotes: 2