10 CloudWatch
Amazon CloudWatch is a web service for monitoring of Amazon resources, other services and applications that run in real-time. CloudFront collects data and displays it in forms of metrics that are essentially variables used to quantify various aspects of measured resources. Additionally, CloudFront provides means to set thresholds, alarms and also automatically notify users as well as make changes to monitored resources. Available metrics typically vary from one resource to another. For example for Elastic Cloud Compute CloudFront tracks statistics about CPU usage, memory usage, disk read/write operations, instance health and others. Optionally, CloudFront allows the user to define his own metrics to monitor. These can be then sent to AWS server with the use of AWS API where they can be transformed into statistics, graphed and published.
To prevent data clutter and not to overwhelm the user, CloudFront introduces other concepts that can be used to narrow down vast metric set. The most fundamental concept is naturally a metric. Metric is essentially just a time-ordered set of data points. These data points represent values of monitored variable in specific time instants and are used to generate statistics by CloudWatch. Each metric is uniquely defined by its name and namespace. Namespaces can be thought of as isolation containers for metrics. In order to use a metric, its namespace must be specified as there is no such thing as default template. Namespace name is characteristic to individual service and has a unique format. For AWS service that can be monitored by CloudWatch the namespace is formed with AWS/ prefix followed by service name. Other than by namespaces, metrics are also uniquely identified by dimensions. Dimensions allow the user to associate name/value pairs with metrics upon their creation. This approach enables to create entirely new metrics as well as associate custom data with existing metrics.
Finally, Amazon CloudWatch supports several units that allow expressing statistics obtained from metrics. The most common are seconds, bytes, percent and count. Metric data is turned into statistics with the help of aggregation methods such as minimum, maximum or average and displayed over time period. Once statistics are obtained, they can be used to automatically notify users about sudden changes in values, which will enable them to promptly react to the peaks in monitored data [26].
10.2 CloudWatch in Kentico AWS Manager
As with other services, the main CloudWatch window is accessible from the main view. In order to start monitoring, KAM uses CloudWatchManager class to asynchronously obtain a list of all available metrics. Once results are obtained from AWS server, KAM groups them together based on their namespace and proceeds to display them in the view. Since there is just too many ways of visualizing data and AWS management console already has many tools to achieve this, KAM doesn’t graph the statistics that are based on metrics but instead redirects the user to specific website in AWS management console. This is once again achieved with the use of WPF web browser control once the user clicks on metrics within a namespace.
CloudWatch already monitors most of the statistics for many AWS services; however, in certain cases detailed monitoring can be enabled. This option makes CloudWatch collect and record additional metrics. Since RDS detailed monitoring is enabled upon instance creation (which is done by AWS management console page) and S3 service stores detailed logs in buckets, the only service that requires manual approval of detailed monitoring is EC2. For this purpose I created a subview in CMS configuration subviews that are part of EC2 instance creation wizard. Once the user enables detailed monitoring, this information is passed to EC2Manager and used in launch configuration of new instance.
On top of monitoring AWS metrics, CloudWatch enables the user to upload his custom-defined metrics to AWS server where they can be turned into statistics. KAM (or KAI) currently doesn’t support this functionality; however it could be easily implemented to work in conjunction with Kentico Health Monitoring windows service, which stores Kentico-specific data (such as cache size) in performance counters. These metrics could be then sent to AWS server with the help of AWS SDK and processed by the server.
11 DynamoDB 11.1 Overview
Amazon DynamoDB is a full-fledged NoSQL database service that uses vast AWS edge network to provide fast and reliable service. Just like other NoSQL databases (such as MongoDB, Cassandra), DynamoDB forsakes some costly features of classic relational database systems such as transaction management or joins in order to provide fast and predictable performance with seamless scalability, which allows it to serve any level of request traffic. DynamoDB automatically spreads and replicates data among multiple servers within the same region and as such can handle any user-defined request capacity while retaining fast performance.
DynamoDB enables the user to take control over scalability of the database by specifying provisioned throughput for every single table that is created. AWS requires the user to give estimate throughput for both reads and writes. DynamoDB then reserves the necessary amount of resources – servers – to meet specified requirements. Read and write capacities are expressed in number of item reads/writes per second for items of 4 KB. Larger items are split among multiple reads/writes. DynamoDB allows the user to change these values at will to accommodate for increases (decreases) in overall throughput. Additionally, AWS doesn’t impose any limits on the amount of data that is stored in DynamoDB as it can automatically allocate more storage (or deallocate) if the situation requires so. Additionally, on top of described functionality, DynamoDB offers two types of reads for the user. Each time a write request is executed by the service, it takes a certain amount of time to entirely propagate updates. This could mean that a read operation issued immediately after this write might not return the latest changes. This approach is called eventually consistent read and is usually supported by most of the NoSQL database servers on the market. DynamoDB however also provides another type of read – strongly consistent read. Since consistency across all copies of the data is typically reached within one second, strongly consistent read makes sure that the user really gets the most up-to-date data reflecting updates by all write operations. Strongly consistent read can be enabled by modifying each read request configuration.
Since DynamoDB is NoSQL database, it doesn’t enforce any schema for its tables. However, even without this feature there are still enough similarities with relational data model. DynamoDB data model concepts include tables, items and attributes. Each database is essentially a collection of tables. Each table has its primary key and arbitrary number of other attributes (limited to 64 KB per record). DynamoDB supports two types of primary keys. Hash type primary key consists of only one attribute and has unordered hash index built on this primary attribute. Hash and range type primary key is made by two attributes. As before the first attribute is indexed with unordered hash index however the second, ranged attribute comes with sorted range index. Additionally, DynamoDB enables the user to build secondary indexes on other attributes in tables, which is a necessity if these attributes are to be used in database queries. Table attributes are just ordinary key/value pairs however each one of them has a data type. Amazon DynamoDB supports two categories of data types. Scalar data types are used by attributes with only one value and they can be number, string and binary. Multi-valued types are reserved for attributes with several values and can be string set, number set and binary set. Like many other NoSQL databases DynamoDB uses JSON syntax to represent database records.
Amazon DynamoDB is integrated with other AWS services. Operational metrics can are monitored and displayed by CloudWatch service, data tables can be loaded into Amazon Redshift, a fully managed data warehouse, and complex analytics on large data sets can be simplified with Amazon Elastic MapReduce service [27].
Share with your friends: |