How do you provision DynamoDB Capacity?
#dynamodb is a fully managed NoSQL database service in #aws cloud. All data is stored in the form of key-value pairs and inside DynamoDB tables.
To work with a DynamoDB table you need to first configure its throughput, which is basically how much do you read and write to a table per second.
DynamoDB offers two kinds of capacity modes
1. Provisioned Capacity, where you define how much do you read/write upfront.
When the reads/writes go beyond the configured limit, you get ProvisionedThroughputExceeded Exceptions in your code.
2. On-Demand capacity, where you don’t need to define anything before hand, Dynamo DB provisions automatically based on the demand, but is quite costly when compared to the provisioned throughput.
So, generally we go with Provisioned Capacity as it is a more cost-effective solution.
How is Provisioned Capacity Configured
In Provisioned Throughput, you configure your expected reads and writes in terms of units called Read Capacity Units (RCUs) and Write Capacity Units (WCUs)
These are the units of resource you expect to be required. 1 WCU is the unit of capacity you need to write 1KB of data into DynamoDB in one second.
For reads, you provision RCUs in two ways -
Strongly Consistent Reads
Eventually Consistent Reads
one Strongly Consistent RCU is the unit of capacity you would need to read 4 KB of data from Dynamo DB in one second.
You can do TWO Eventually Consistent Reads for one Strongly Consistent RCU.
That's all about capacity provisioning in Dynamodb.
Share with your friends if you find it useful.
Follow me for more such content on #programming, #cloudarchitecture and stuff.