Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
DynamoDB Cookbook

You're reading from   DynamoDB Cookbook Over 90 hands-on recipes to design Internet scalable web and mobile applications with Amazon DynamoDB

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781784393755
Length 266 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Tanmay Deshpande Tanmay Deshpande
Author Profile Icon Tanmay Deshpande
Tanmay Deshpande
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Taking Your First Steps with DynamoDB FREE CHAPTER 2. Operating with DynamoDB Tables 3. Manipulating DynamoDB Items 4. Managing DynamoDB Indexes 5. Exploring Higher Level Programming Interfaces for DynamoDB 6. Securing DynamoDB 7. DynamoDB Best Practices 8. Integrating DynamoDB with other AWS Services 9. Developing Web Applications using DynamoDB 10. Developing Mobile Applications using DynamoDB Index

Analyzing DynamoDB metric on CloudWatch

It is very important to keep an eye on DynamoDB CloudWatch metrics in order to see the DynamoDB performance. CloudWatch provides real-time monitoring and alerting mechanisms to services provided by DynamoDB.

Getting ready

To get a better understanding of DynamoDB metrics, considering the fact that we don't have much of our data in our product table, go to the Query and Scan operations console and perform various Query and Scan operations back to back in order to get some metrics. Simply clicking on the Query and Scan buttons with some sample conditions will do the job for you.

Of course, in real time, in production systems, you would not need to do this as we will automatically have sufficient reads, writes, queries, and scans in progress.

How to do it…

Let's understand DynamoDB metrics on Cloudwatch:

  1. Go to the DynamoDB console, and click on the table whose metrics you would like to analyze. You will notice that the bottom frame will start showing some details about the table. It will have various tabs, such as Details, which will have the table details, Indexes, which will have details about the secondary indexes that we created in our table, Monitoring, which will have the details about the CloudWatch metrics that we would like to see in detail, and the last tab, Alarm Setup, which is used to set up various alarms in case you wish to get any:
    How to do it…
  2. If you scroll down a bit, you will see various graphs, such as Read Capacity, Throttled Read Requests, Write Capacity, Throttled Write Requests, Read-Write Capacity for Global Secondary Indexes, that we created. It will also show you graphs related to Read/Write Latency and Query/Scan latency for a given time frame:
    How to do it…
  3. You can also click on individual graphs to see the enlarged view. I have made a significant number of scans in the last hour; if I want to see how DynamoDB performed for a particular time frame, I need to click on the Scan Latency graph, which will open the enlarged view of the graph, as shown in the following screenshot:
    How to do it…

    The preceding graph tells us the average time taken by DynamoDB in milliseconds to perform the various scan operations.

  4. You can also change the Statistic drop-down value to select the various metrics. For example, if I want to see the exact time taken by each scan request over the last hour, it will show you the results immediately. I can also click on the data points on the graph to see the exact time. Here is an example of it:
    How to do it…

    Here, the graph tells us that the very first scan request took approximately 140 milliseconds to fetch the results, whereas the latency dropped in subsequent requests, and eventually, improved the performance.

How it works…

Almost every operation in Cloud is measured in terms of bytes read/written. CloudWatch keeps track of the requests that we make to DynamoDB and stores it in the internal data store. While generating the graphs, we will use these data points, which will help us analyze the performance.

There's more…

You can also analyze other CloudWatch metrics to better understand the DynamoDB behavior. These graphs will also help you decide upon the throughput values set for the tables and secondary indexes. If you see the consumed read/write capacity reaching the provisioned read/write capacity, then you can increase the provisioned throughput and vice versa.

Always look for consistent metrics; you might miss out on certain spikes because a lot of graphs give you an average of values over the last 5 minutes of time. For more detailed metrics, you can go to the CloudWatch console and look out for DynamoDB metrics at https://console.aws.amazon.com/cloudwatch/https://console.aws.amazon.com/cloudwatch/.

You have been reading a chapter from
DynamoDB Cookbook
Published in: Sep 2015
Publisher:
ISBN-13: 9781784393755
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image