Exam objective 5.1 of the AWS Certified Database Specialty exam is all about keeping your database healthy and fast. This chapter tackles the specific tools Amazon gives you to watch how your database is performing, find what's slowing it down, and fix it before users get frustrated. For a complete beginner, understanding monitoring is like learning to read the dashboard in a car; you need to know which gauges matter and what the warning lights mean.
Jump to a section
A simple way to picture Database Performance Monitoring and Metrics
A restaurant kitchen is a high-pressure environment where timing, temperature, and precision decide success. The head chef's central workstation is a digital dashboard showing every order, every cooking station, and every plate in progress. This dashboard is the chef's single source of truth for knowing whether the kitchen is running smoothly or heading toward disaster.
When a ticket comes in for a medium-rare steak, the chef watches the grill station's timer. If the steak takes 12 minutes instead of the expected 8, the dashboard flashes a warning. That's like Amazon CloudWatch showing a database query taking longer than its baseline. If the chef notices the fryer temperature dropped, slowing down all fried items, that is like Amazon RDS Enhanced Monitoring showing a CPU spike on the database instance. The chef can then assign an extra cook to the fryer, just as a database administrator might scale up the instance or optimise a slow query.
The chef's performance dashboard also tracks which stations are overloaded. If the appetiser station has five tickets pending while the dessert station is idle, the chef rebalances the workload. This maps directly to Amazon Performance Insights, which shows database load by wait events, queries, and hosts. A well-trained chef doesn't just react to burnt orders; they use the dashboard to spot patterns before the dinner rush. In database monitoring, you use metrics and traces to catch performance degradation before users complain. The kitchen's success relies on real-time visibility, just as a database's health depends on constant, granular monitoring of resources and queries.
Let's start with the big picture. When you run a database in the cloud, you cannot physically walk up to a server and check if it is overheating. Instead, Amazon Web Services (AWS) provides three main monitoring tools that act like sensors, gauges, and diagnostic scanners for your database: Amazon CloudWatch, Amazon RDS Enhanced Monitoring, and Amazon Performance Insights. Each serves a different purpose, and together they give you a complete health picture.
Amazon CloudWatch is the foundational monitoring service for all AWS resources. Think of it as the basic dashboard in your car showing speed, fuel level, and engine temperature. CloudWatch collects raw data points called metrics from your database instance. Metrics are numerical values tracked over time, like CPU utilisation (the percentage of your processor being used), database connections (the number of applications talking to your database), and read/write latency (how long it takes to read data from or write data to the storage). CloudWatch gathers these metrics every minute by default, and you can set alarms that trigger when a metric crosses a dangerous threshold, like sending a text message when CPU utilisation exceeds 80%. These alarms are crucial because they allow you to react automatically or manually before performance crashes.
However, CloudWatch metrics are at the hypervisor level. That means AWS measures the performance of the virtual machine (the underlying computer) but not the database process itself. This is where Amazon RDS Enhanced Monitoring steps in. Enhanced Monitoring provides metrics from inside the operating system (OS) of the database host. It gives you granular data on all the processes running on the server, not just the database engine. For example, it can show you that the process called 'mysqld' (the MySQL database process) is using 70% of the CPU, while the 'os' processes and other system tasks are using the rest. Enhanced Monitoring collects this data every second, which is much more frequent than CloudWatch's standard one-minute interval. This high-frequency data helps you pinpoint bursty (very short, intense) spikes in resource usage that you would miss with less granular monitoring.
Now, having metrics about CPU and memory is useful, but the most important question for a database administrator is always: why is my database slow? The answer often lies in understanding database load and wait events. A wait event is anything that causes the database to pause or wait before it can complete a request. For instance, waiting for data to be read from disk (called I/O wait) or waiting for a lock on a row that another query has claimed. The tool designed to make this visible is Amazon Performance Insights.
Performance Insights gives you a visual dashboard called the 'database load' chart. Database load is measured in 'Average Active Sessions' (AAS). Think of sessions as the number of database connections that are actively doing work. If you have 2 CPU cores and your AAS rises above 2, your database is overloaded. Performance Insights breaks down that load into categories like which SQL queries are consuming the most resources, which hosts (applications or servers) are sending the most traffic, and which wait events are causing delays. It also shows you the top SQL queries that are using the most time, letting you quickly identify a slow query that might need an index (a special lookup table to speed up data retrieval) or a rewrite. Performance Insights keeps a rolling window of performance data, and you can enable a paid feature to retain that history for longer periods to analyse trends.
So, why do we need all three tools? They form a layered defence:
CloudWatch: Tracks overall resource utilisation and triggers alarms. It tells you that something is wrong (e.g., high CPU).
Enhanced Monitoring: Tells you which process (database engine vs. OS) is consuming resources. It helps you distinguish between a database problem and a server problem.
Performance Insights: Tells you exactly which queries or waits are causing the high load. It gives you the 'why' behind the symptom.
In practice, a database administrator monitors CloudWatch dashboards for broad trends, uses Enhanced Monitoring to dive into operating system-level bottlenecks, and relies on Performance Insights to diagnose which queries are the root cause of slowness. Each tool complements the others, and you will be asked on the DBS-C01 exam to know exactly when to use each one.
A common point of confusion is the difference between a metric and a dimension. A metric is the gauge (e.g., CPUUtilization). A dimension is a label that gives context to the metric, such as the specific DB Instance Identifier or the Database Class. When you configure CloudWatch metrics, you often need to specify dimensions to filter the data for your particular database.
Finally, AWS also offers Database Logs, which are not a monitoring tool per se but are vital for diagnosing errors. CloudWatch can ingest your database error logs and slow query logs, correlating them with metrics. For example, you might see a spike in CPU at 3:00 PM and then check the slow query log to find an unoptimised report query running right at that hour. Understanding how to combine metric data with log data is a core skill tested on the exam.
Enable CloudWatch Monitoring
When you provision an Amazon RDS database, CloudWatch monitoring is enabled by default at the 1-minute level. You do not need to enable anything extra. CloudWatch automatically collects metrics like CPUUtilization, DatabaseConnections, FreeStorageSpace, and Read/WriteLatency. Verify that your DB instance is publishing metrics by checking the CloudWatch console or the RDS console under 'Monitoring'.
Configure RDS Enhanced Monitoring
To get operating system-level details, you must explicitly enable Enhanced Monitoring when creating or modifying a DB instance. You choose a monitoring role (a special IAM role that grants permission to write to CloudWatch Logs) and a granularity (e.g., 15 seconds). Once enabled, Enhanced Monitoring sends OS metrics to CloudWatch Logs, which you view either in the RDS console or directly in CloudWatch Logs. This step is critical for distinguishing database process load from system load.
Enable Amazon Performance Insights
Performance Insights can be enabled during database creation or on an existing instance via the 'Modify' operation. Choose a retention period (7 days free, or longer for a fee). Once active, Performance Insights collects database load data and SQL wait event details. You access its dashboard from the RDS console under the 'Performance Insights' tab. This step gives you the 'why' behind performance issues by visualising database load in real time.
Create CloudWatch Alarms for Key Metrics
Based on your application's requirements, set up CloudWatch alarms on critical metrics such as CPUUtilization > 80% for 5 minutes, DatabaseConnections approaching the instance's maximum connections limit, or FreeStorageSpace < 10% of total allocated storage. Configure the alarm to send an email via Amazon SNS or trigger an auto-scaling action. This step ensures you are notified before a performance problem becomes a service outage.
Analyse Performance Insights Dashboard During an Incident
When an alarm fires, open the Performance Insights dashboard for the affected DB instance. Look at the 'Database load' chart. If the AAS exceeds the number of vCPUs, the database is overloaded. Sort the 'Top SQL' tab by 'Average latency' or 'Calls per second' to find the culprit query. Check the 'Top waits' tab to see if the database is waiting on I/O, locks, or network. Use this information to decide whether to optimise a query, add an index, increase instance size, or scale the application. This step transforms raw metrics into actionable diagnosis.
Update Monitoring Baseline and Repeat
After resolving an incident, document the baseline performance (normal CPU, connections, and load values). Modify your CloudWatch alarms to reflect the new baseline if thresholds changed (e.g., after scaling up the instance, the normal CPU is 20% lower). Continue to review Performance Insights data periodically to spot regressions before they become incidents. This step closes the loop from reactive to proactive performance management.
Imagine you are a database administrator for 'ShopEase', an online retail company that sells clothes. It is the day before Black Friday, and traffic is starting to build. Your manager asks you to ensure the main customer database can handle the load. Here is exactly what you do using the three monitoring tools.
First, you open the AWS Management Console and navigate to Amazon CloudWatch. You have pre-built a dashboard showing the key metrics for your primary database instance: 'SourceDB'. You see that the CPUUtilisation metric, which normally sits at 20-30%, is now hovering at 55%. That is not critical yet, but it is a trend worth watching. You also notice the DatabaseConnections metric is climbing. You have a CloudWatch Alarm set to trigger if CPUUtilisation exceeds 75% for more than 5 minutes. The alarm is currently in 'OK' state, meaning everything is within limits. You note that the ReadLatency metric is stable at 2 milliseconds, which is good for the storage type you are using (General Purpose SSD, or gp2).
Next, you open Amazon RDS Enhanced Monitoring. You want to see if the operating system itself is having issues. The Enhanced Monitoring dashboard shows that the 'rds processes' (which includes the database engine) are using about 45% of the CPU, and the 'os processes' (system daemons) are using about 10%. Memory usage is at 70%, and there is no swap usage (when the OS uses disk space as pretend memory, which severely slows performance). The disk I/O (input/output operations per second) is at 800, and the instance's maximum is 3,000. Everything looks healthy at the OS level. This tells you the performance issue is likely coming from the database engine itself, not the underlying server.
Now you open Amazon Performance Insights. You enable it on SourceDB (it is free for a 7-day rolling window). The database load chart shows the AAS is currently 1.8, and the instance has 4 vCPUs, so the load is well below the maximum. However, you sort the 'Top SQL' tab by 'Average latency' and see a single query that is taking an average of 500 milliseconds to execute. This query is searching for a customer's order history by date range. You remember that the developer just deployed a new search feature yesterday. You copy the query text and run it in a test environment to see its execution plan. The plan shows a full table scan (the database reading every single row to find the data) on the 'orders' table, which has over 10 million rows. The table is missing an index on the 'order_date' column.
You create a new index in a maintenance window (a scheduled period of low traffic), and the query execution time drops from 500ms to 5ms. You go back to Performance Insights and within minutes you see the database load decreasing. The AAS drops to 0.8, and the top SQL list changes to show other, faster queries. You send an update to your manager explaining that you identified and fixed a slow-performing query, which prevented a potential performance bottleneck during the Black Friday rush.
The next day, during the actual Black Friday surge, the CloudWatch alarm for CPUUtilisation does trigger at 78%. But because you already optimised the slow query, the database is able to handle the full traffic spike without customer-visible slowdowns. The Enhanced Monitoring still shows healthy OS resources, and Performance Insights shows the database load is distributed across many short, efficient queries rather than being dominated by one slow one. You used all three tools in concert to move from reactive firefighting to proactive performance management.
The DBS-C01 exam tests objective 5.1 heavily, and you will see multiple questions that require you to distinguish between CloudWatch, Enhanced Monitoring, and Performance Insights. The exam expects you to know the exact purpose, granularity (how often data is collected), and cost model of each tool.
Here are the specific concepts you must memorise:
CloudWatch metrics are collected at a standard 1-minute frequency. You can enable detailed monitoring for some services, but for RDS, the free tier is 1-minute. Enhanced Monitoring collects at 1-second intervals. Performance Insights collects data at 1-second intervals for the free tier (7-day retention) and 1-minute intervals for longer retention (paid).
CloudWatch metrics measure the hypervisor or the host. For example, 'CPUUtilization' in CloudWatch is the overall CPU of the virtual machine. Enhanced Monitoring measures the operating system and all running processes, breaking down CPU by process name (e.g., 'rds processes'). Performance Insights measures database load in Average Active Sessions (AAS) and breaks it down by SQL, host, and wait event.
The exam loves to ask: 'You see high CPU in CloudWatch, but Enhanced Monitoring shows low CPU usage. Why?' The answer is typically 'swap usage' or 'memory pressure' — the OS is spending CPU time shuffling memory to disk, which is not captured as 'database process' CPU. Or it might be that the CloudWatch metric includes all virtual CPU, while Enhanced Monitoring shows a breakdown that reveals the database process is not the consumer.
Performance Insights is specifically for diagnosing database performance issues at the database engine level. It replaces the need to manually parse slow query logs for quick triage. However, the exam will test that slow query logs are still useful for detailed analysis, while Performance Insights is for real-time visual analysis.
The default retention for Performance Insights is 7 days free. Longer retention (up to 2 years) costs extra. CloudWatch metric retention is 15 months for all metrics (no charge for standard resolution). Enhanced Monitoring logs are stored in CloudWatch Logs, which have their own pricing and retention settings.
You will be asked about combining metrics across dimensions. For example, you can create a CloudWatch metric math expression to compute the ratio of read IOPS (input/output operations per second) to write IOPS, or to calculate the percentage of memory used.
Traps in the exam often revolve around the word 'operating system'. Questions will describe a scenario where you need to see OS-level process details. The correct answer is almost always 'RDS Enhanced Monitoring'. If the question says 'you need to see which SQL queries are causing the most load', the answer is 'Performance Insights'. If it says 'you need to set an alarm when storage space is low', the answer is 'CloudWatch'.
Another common trap: 'Which tool can show you the number of active database connections?' Both CloudWatch (DatabaseConnections metric) and Enhanced Monitoring (can show PID-level connections) can show this. The exam will differentiate by whether you need the metric for an alarm (CloudWatch) or the detailed process list (Enhanced Monitoring).
Know that Performance Insights is available for Amazon RDS (Multiple engines: MySQL, MariaDB, PostgreSQL, Oracle, SQL Server, Aurora), Amazon Aurora (both MySQL and PostgreSQL compatible), and Amazon DocumentDB (MongoDB compatible). It is not available for DynamoDB, Redshift, or ElastiCache. That distinction is frequently tested.
The exam may present a scenario where you need to monitor Amazon Aurora's distributed storage. In that case, you need to look at Aurora-specific CloudWatch metrics like 'AuroraVolumeBytesLeftTotal' (storage remaining) and 'CommitLatency' (how long commits take). Performance Insights can also show Aurora-specific wait events like 'aurora_volume_sync'.
Finally, expect questions about setting up cross-account monitoring using CloudWatch cross-account dashboards. This is less common but appears in advanced scenarios. The pattern is: you have multiple AWS accounts with databases, and you want a single dashboard to monitor all of them.
Amazon CloudWatch provides the basic health metrics for your database instance at the hypervisor level, with 1-minute granularity and 15 months of retention.
Amazon RDS Enhanced Monitoring gives you operating system-level metrics every second, breaking down CPU and memory usage by individual process, including the database engine.
Amazon Performance Insights shows database load in Average Active Sessions (AAS) and identifies which SQL queries, hosts, and wait events are causing performance bottlenecks.
Always start troubleshooting with CloudWatch to see the symptom (e.g., high CPU), then use Enhanced Monitoring to confirm it is the database process, and finally use Performance Insights to find the root cause query or wait event.
Enhanced Monitoring is enabled per RDS instance and is not database-engine-specific; it works the same way for MySQL, PostgreSQL, Oracle, SQL Server, and Aurora.
Performance Insights has a free 7-day rolling window of data; longer retention requires a paid subscription, and it is available for RDS, Aurora, and DocumentDB but not DynamoDB or Redshift.
The standard CloudWatch metric frequency for RDS is 1 minute; Enhanced Monitoring can be configured at 1, 5, 10, 15, 30, or 60 second intervals.
You can create CloudWatch alarms on Performance Insights metrics like DBLoad to automatically notify or remediate high database load.
Slow query logs and Performance Insights serve complementary purposes: logs for detailed historical analysis, Performance Insights for real-time visual triage and trending.
Cross-account CloudWatch dashboards allow you to monitor databases in multiple AWS accounts from a single pane of glass.
These come up on the exam all the time. Here's how to tell them apart.
Amazon CloudWatch
Measures hypervisor-level metrics like CPUUtilization and DatabaseConnections.
Collects data every 1 minute by default.
Metrics are stored for 15 months and can trigger alarms.
Amazon RDS Enhanced Monitoring
Measures operating system-level metrics including per-process CPU and memory.
Collects data every 1 second (configurable from 1 to 60 seconds).
Data is stored in CloudWatch Logs and is used for deep OS-level troubleshooting.
Amazon Performance Insights
Provides a visual dashboard showing database load in Average Active Sessions.
Automatically identifies top SQL queries, wait events, and hosts in real time.
Retains data for 7 days free (longer for paid).
Amazon RDS Slow Query Logs
Requires manual configuration to enable and store logs.
Provides detailed text output of every query that exceeds a time threshold.
Logs are retained indefinitely in CloudWatch Logs (subject to storage costs).
CloudWatch Metric Filter
Counts occurrences of a pattern in log data and publishes that count as a metric.
Alarms can be set on the resulting metric (e.g., count of 'ERROR' in logs).
Best for simple pattern matching and alarm creation.
CloudWatch Logs Insights
Allows complex SQL-like queries across log data for deep analysis.
Does not create metrics; results are displayed as tables or charts in the console.
Best for ad-hoc troubleshooting and correlation of log entries across time.
Database Load (AAS) in Performance Insights
Measures the average number of active sessions running on the database engine.
AAS > number of vCPUs indicates the database is overloaded.
Directly correlates with application performance (response time).
CPUUtilisation in CloudWatch
Measures the percentage of total CPU capacity being used on the host.
CPU > 80% indicates the host is busy but does not specify if the bottleneck is the database.
Can be high due to OS processes, not database queries.
Mistake
CloudWatch and Enhanced Monitoring are the same thing; Enhanced Monitoring just shows the same data with a nicer interface.
Correct
CloudWatch measures the virtual machine from the hypervisor level. Enhanced Monitoring measures the operating system from within the guest OS, showing per-process CPU, memory, and disk I/O.
The names sound similar, and both appear in the AWS console, so beginners assume they are redundant interfaces rather than complementary data sources at different layers of abstraction.
Mistake
Performance Insights is only useful for finding slow SQL queries, and if you already have slow query logging enabled, you do not need it.
Correct
Performance Insights provides real-time, visual breakdowns of database load by wait events, hosts, and SQL, which is faster to interpret than parsing logs. It also automatically surfaces top wait events and load patterns that logs alone would miss.
Beginners often equate 'performance monitoring' with 'logging', not realising that Performance Insights is an analytical tool, not just a log viewer.
Mistake
If CloudWatch shows CPU utilisation at 90%, Enhanced Monitoring will also show the same number for the database process.
Correct
CloudWatch shows total CPU utilisation of the host. Enhanced Monitoring shows per-process CPU utilisation. If the database process itself is using only 30% of CPU, the remaining 60% might be consumed by OS processes, memory paging, or other overhead. The two numbers can diverge significantly.
People assume a single 'CPU' number is absolute, not understanding that CloudWatch and Enhanced Monitoring measure from different vantage points (hypervisor vs. guest OS).
Mistake
You need to enable Enhanced Monitoring separately for each database engine (MySQL, PostgreSQL, etc.) because it is a feature of the database engine itself.
Correct
Enhanced Monitoring is a feature of the RDS service, not the database engine. You enable it at the RDS instance level, and it works identically across all supported database engines (MySQL, MariaDB, PostgreSQL, Oracle, SQL Server, Aurora).
Because the feature is named 'RDS Enhanced Monitoring', beginners incorrectly assume it is tied to the specific database software rather than the RDS hosting layer.
Mistake
You cannot use CloudWatch alarms with Performance Insights data because Performance Insights is a separate service.
Correct
You can set CloudWatch alarms on Performance Insights metrics. Performance Insights publishes aggregated metrics to CloudWatch, such as 'DBLoad' (average active sessions) and 'DBLoadCPU'. You can create alarms on these to automate responses to high database load.
The AWS console presents CloudWatch and Performance Insights as separate sections, leading users to think they are entirely independent and cannot be used together.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
CloudWatch is the metrics and alarms service. CloudWatch Logs is a separate service for storing and searching log files. Enhanced Monitoring writes its OS metrics to CloudWatch Logs, while CloudWatch itself stores numeric metric data.
Yes, Performance Insights is fully supported for Aurora (both MySQL and PostgreSQL compatible versions). It provides Aurora-specific wait events like 'aurora_volume_sync' and is one of the primary tools for diagnosing Aurora performance.
Yes, you can use CloudWatch cross-account dashboards to view metrics from multiple accounts in a single dashboard. You need to set up cross-account roles and enable sharing of CloudWatch metrics.
Use RDS Enhanced Monitoring to see the breakdown of CPU usage by process. If the 'rds processes' (the database engine) are using the majority of CPU, it is a database issue. If 'os processes' are high, it might be system-level activity like backup or patching.
The free tier of Performance Insights provides a 7-day rolling window of performance data. For longer retention (up to 2 years), you must purchase a Performance Insights subscription at an additional cost.
Yes. Performance Insights publishes aggregated metrics to CloudWatch, including 'DBLoad' and 'DBLoadCPU'. You can create CloudWatch alarms on these metrics, for example, to alert when average active sessions exceed the number of vCPUs for more than 5 minutes.
No. Enhanced Monitoring is a managed feature of RDS. You only need to enable it and give AWS permission to write the OS-level data to CloudWatch Logs using a IAM role. AWS handles the agent installation and maintenance on the underlying host.
You've finished Database Performance Monitoring and Metrics. Continue through the DBS-C01 study guide to build a complete picture of the exam.
Done with this chapter?