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?


  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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




  1. The average Item size is 10KB
  2. Provisioned capacity is 10 RCU
  3. The read throughput for strong consistent read is 4 KB X 10 = 40KB/sec
  4. 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




  1. The average Item size is 10KB
  2. Provisioned capacity is 10 WCU
  3. The write throughput is 1 KB X 10 = 10KB/sec





Posted By  -  Karan Gupta
 
Posted On  -  Monday, October 16, 2023

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250