Articles → AWS → Calculate The Read And Write Capacity Unit In AWS Dynamodb
Calculate The Read And Write Capacity Unit In AWS Dynamodb
What Is A Capacity Unit?
Read Capacity Unit
What Are The Factors Affecting The Read Capacity Unit?
- Item Size → The size of the items being read can impact RCU usage. Larger items require more RCUs to read because DynamoDB retrieves data in 4 KB blocks, so larger items may consume more RCUs
- Query Complexity → Complex queries, such as those involving scans or filtering operations, can consume more RCUs than simple key-based retrievals because they may involve scanning more data
- Consistency Model → The strongly consistent reads consume more RCUs than eventually consistent reads. You can perform 1 strongly consistent table read per second and 2 eventually consistent table read per second in 1 RCU
- Indexes → Using Global Secondary Indexes (GSI) or Local Secondary Indexes (LSI) can impact RCU usage, as additional RCUs may be required to query these indexes
- Proximity to Data → DynamoDB may be more efficient if the read request is geographically closer to the data, as it reduces latency and may result in fewer RCUs being consumed
- Caching → Implementing caching mechanisms like DynamoDB Accelerator (DAX) or application-level caching can reduce the need for frequent read operations and lower RCU consumption
Write Capacity Unit
Calculate The Number Of Items To Be Read Per Second
- The average Item size is 10KB
- Provisioned capacity is 10 RCU
- The read throughput for strong consistent read is 4 KB X 10 = 40KB/sec
- The read throughput for eventual consistent read is 2 X (4 KB X 10) = 80KB/sec
Calculate The Number Of Items To Write Per Second
- The average Item size is 10KB
- Provisioned capacity is 10 WCU
- The write throughput is 1 KB X 10 = 10KB/sec