Optimize DynamoDB usage
Provisioned read/write capacity units
The provisioned throughput will determine the number of concurrent database operations that can be performed by the application. Set it up too low; there will be throttling errors, set it up too high, then you will be paying AWS for unused throughput. Monitoring database performance for a continued time frame, will help you make informed decisions on when to scale up/scale down throughput settings.
Consumed read/write capacity units
Continuously monitoring the consumed read/write capacity units will give you an idea about request rate, application throughput pattern and table activity. Set up alerting mechanisms and get notified before the consumed request throuhgout exceeds the provisioned value.
![Monitor Amazon DynamoDB](http://static.site24x7.jp/images/consumed-write-capacity-units-1024@2x.png?p=Aug_29_2024)
Analyze database performance
Successful request latency
From a DynamoDB perspective, see how long it takes for your database requests to get processed. When you are operating too close to the provisioned throughput, you will start to see an increase in average latency. With Site24x7 you can get successful request latency data points for each DB operation viz., Get Item, Put Item, Scan, and Query. Monitor them on a regular basis to identify database actions with high latency.
![AWS DynamoDB request latency](http://static.site24x7.jp/images/get-latency-1024@2x.png?p=Aug_29_2024)
Troubleshoot request throttling
Throttled requests
When your application starts to perform a large number of database requests, the provisioned throughput configured on the table or secondary index will get exhausted. When this happens, all the subsequent DB operations will get denied, returning throttling errors. With Site24x7, you can get data points on the throttled read request metric for both single database actions and batch actions.
Throttled read/write events.
Depending on the number of secondary indexes, a single DB action can have multiple read/write events attached to it. Set up thresholds and get notified when throttled events gets generated. Correlate the throttled request with read/write throttle events to understand which event is throttling the request.
![Number of Throttled Requests for your DynamoDB Table](http://static.site24x7.jp/images/throttled-request-1024@2x.png?p=Aug_29_2024)
Handle DB errors and exceptions
User errors and system errors.
If the DynamoDB table is unable to process the sent action or DB request, it will return a HTTP status error code. Common problems like missing parameters, provisioned throughput exception can cause user errors to crop up.
System errors get generated when an unknown exception or internal server error occurs. The dashboard will show you an aggregate of errors generated during the period.
![User errors generated for AWS DynamoDB operations](http://static.site24x7.jp/images/user-errors-1024@2x.png?p=Aug_29_2024)
Gain insight into DB operations performed
Conditional check failed request.
Track the number of times a conditional write failed to proceed. Conditional checks are logical operators, that are used along with write requests. These checks help in maintaining database concurrency, when two or more clients perform write actions on the same item. An increase in failures, will indicate a issue in the request sent.
Returned item count.
For any time frame, monitor the number of items returned by the scan or query operation. This metric will give you an idea about the number and frequency of scan and query operations performed. Also, you will be able to judge whether the frequent scan operations are having an impact on the provisioned read capacity units or not.
![Number of items returned for scan operations](http://static.site24x7.jp/images/user-errors-1024@2x.png?p=Aug_29_2024)