🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Data Management / Database Administration › Cloud Storage for Database Administrators › Lesson 7
TEC-DATA86-08 · Lesson 7 · 11 clock hours · practice

Performance Monitoring and Cost Management

Objective. Students will interpret cloud database performance metrics, set threshold-based alerts, and produce a rightsizing recommendation that reduces estimated monthly cost without violating performance targets.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

Performance Monitoring and Cost Management in Cloud Databases

Cloud platforms give database administrators real-time visibility into how their databases are running and what they cost. Understanding how to read that data, act on it, and right-size resources is a core DBA skill tested by Microsoft DP-300, the Oracle DBA CA, and the DAMA CDMP.

Key Performance Metrics to Watch

Three metrics appear on almost every cloud monitoring checklist:

AWS surfaces these metrics through Amazon CloudWatch. Each metric is a time series you can graph, filter by instance, and attach an alarm to. Azure surfaces similar data through Azure Monitor, with an extra blade called Query Performance Insight that shows the top queries by CPU, duration, or I/O so you can drill straight to the problem SQL.

Setting Threshold-Based Alerts

An alert does nothing useful unless the threshold is meaningful. A CPU alarm set at 100% fires too late; one set at 50% fires constantly. A practical starting point for a production RDS instance is:

In CloudWatch, you create an alarm by choosing a metric, setting the threshold condition, and attaching an SNS topic that sends an email or text to the on-call team. Document the SNS ARN and the alarm ARN; you will need both if you automate remediation later.

In Azure Monitor you create Metric Alerts with the same logic: choose a metric, set a threshold, pick an Action Group that holds the notification targets. Query Performance Insight does not send alerts on its own, but it identifies the queries you should target for tuning before alerts become necessary.

Index Tuning from Query Performance Insight

Query Performance Insight ranks queries by resource consumption. When you find a high-CPU query, open its execution plan. Look for:

When you write the `CREATE INDEX` statement, include:

1. A meaningful name (e.g., `IX_Orders_CustomerID_OrderDate`).

2. The table and the key column(s) in the `ON` clause.

3. Any covering columns in an `INCLUDE` clause.

4. `WITH (ONLINE = ON)` if the table must stay available during the build (supported on most Azure SQL tiers).

Cost Optimization and Rightsizing

Cloud spend grows when instances are provisioned at peak capacity and then never reviewed. Rightsizing means matching the compute tier to the actual workload. Steps:

1. Pull a 30-day utilization report from AWS Cost Explorer or Azure Cost Management.

2. Identify instances averaging below 40% CPU and low memory pressure for the full period – these are candidates for a smaller tier.

3. Check storage usage – if provisioned IOPS are far above consumed IOPS, switch to a lower IOPS tier or gp3 storage on AWS.

4. Compare on-demand vs. reserved pricing – AWS Reserved Instances and Azure Reserved VM Capacity offer significant discounts for 1- or 3-year commitments on stable workloads. Use the AWS Pricing Calculator or Azure Pricing Calculator (both are free, publicly available, and require no login) to model the savings.

5. Write the recommendation with specific numbers: current monthly cost, proposed tier, new monthly cost, and percentage saved.

Safety and Access Controls

Performance monitoring involves reading live production data. Always use a read-only IAM role or Azure RBAC role scoped to monitoring; never run optimization tests against production without a change-control ticket. When modifying indexes on production tables, run changes during a maintenance window or use online index operations to avoid blocking. Keep backups verified before any schema change.

Cost changes—like moving to a different compute tier—can require a brief instance restart. Coordinate with application owners and schedule downtime properly. Document every change in your change log.

Key terms10

Amazon CloudWatchAWS's monitoring and observability service that collects metrics, logs, and events from AWS resources including RDS instances, and supports threshold-based alarms.
Azure MonitorMicrosoft Azure's platform service for collecting, analyzing, and acting on telemetry from cloud and on-premises resources, including Azure SQL Database metrics.
Query Performance InsightAn Azure SQL Database blade within the Azure portal that ranks queries by CPU, duration, or I/O consumption and displays their execution plans.
FreeStorageSpaceA CloudWatch metric reporting the number of bytes of storage remaining on an RDS instance's volume; when it reaches zero, write operations fail.
Covering IndexA nonclustered index that includes all columns a query needs—both key and non-key (INCLUDE) columns—so the query engine can satisfy the query from the index alone without a Key Lookup.
RightsizingThe process of matching a cloud instance's compute tier, memory, and storage to its actual workload utilization, typically to reduce cost without violating performance targets.
Reserved PricingA cloud billing model in which a customer commits to using a specific resource for one or three years in exchange for a lower hourly rate compared to on-demand pricing.
SNS Topic (Simple Notification Service)An AWS messaging resource that CloudWatch alarms use to deliver notifications—such as emails or SMS messages—when a metric breaches its defined threshold.
Evaluation PeriodIn CloudWatch alarms, the number of consecutive metric data points that must breach the threshold before the alarm state changes to ALARM, preventing false alerts from brief spikes.
Execution PlanA query-optimizer-generated map of the operations the database engine will perform to execute a SQL statement, used to identify inefficiencies such as full table scans or Key Lookups.

Worked examples4

1. An RDS db.t3.medium instance runs at an average of 38% CPU and consumes 120 GB of a 500 GB provisioned gp2 storage volume. On-demand cost is $0.068/hour for compute and $0.115/GB-month for storage. Calculate the current monthly compute and storage cost, then calculate the new monthly storage cost if storage is reduced to 150 GB (rounded up from actual usage with 25% headroom). Assume 730 hours per month.
  1. Monthly compute cost = $0.068 × 730 = $49.64
  2. Current monthly storage cost = 500 GB × $0.115 = $57.50
  3. Proposed storage = 120 GB × 1.25 = 150 GB (25% headroom)
  4. New monthly storage cost = 150 GB × $0.115 = $17.25
  5. Current total monthly cost = $49.64 + $57.50 = $107.14
  6. New total monthly cost = $49.64 + $17.25 = $66.89
  7. Monthly savings = $107.14 − $66.89 = $40.25
  8. Percentage saved = ($40.25 ÷ $107.14) × 100 ≈ 37.6%
Answer: Current monthly cost is $107.14. Reducing storage to 150 GB lowers the monthly cost to $66.89, saving $40.25 per month (approximately 37.6%).
2. A CloudWatch alarm must fire when CPU Utilization on an RDS instance exceeds 80% for 5 consecutive 1-minute data points. The metric period is 60 seconds. What values should you enter for Threshold, Period, Evaluation Periods, and Datapoints to Alarm?
  1. Threshold: 80 (percent)
  2. Period: 60 seconds (one data point per minute)
  3. Evaluation Periods: 5 (the window CloudWatch examines)
  4. Datapoints to Alarm: 5 (all 5 must breach the threshold — this is the M-of-N setting)
  5. Condition: Greater than or equal to 80%
Answer: Threshold = 80%, Period = 60 s, Evaluation Periods = 5, Datapoints to Alarm = 5. All five consecutive data points must exceed 80% before the alarm transitions to ALARM state.
3. An Azure SQL Database on-demand cost is $150/month. A 1-year reserved commitment reduces the hourly rate so that the equivalent monthly cost drops to $95/month. A 3-year commitment drops it to $68/month. Calculate the total 1-year savings and the total 3-year savings compared to staying on-demand.
  1. On-demand 1-year total = $150 × 12 = $1,800
  2. Reserved 1-year total = $95 × 12 = $1,140
  3. 1-year savings = $1,800 − $1,140 = $660
  4. On-demand 3-year total = $150 × 36 = $5,400
  5. Reserved 3-year total = $68 × 36 = $2,448
  6. 3-year savings = $5,400 − $2,448 = $2,952
Answer: A 1-year reservation saves $660 over the year. A 3-year reservation saves $2,952 over the three-year period compared to continuous on-demand pricing.
4. Query Performance Insight shows a query spending 4,200 ms/execution. Its execution plan shows a Clustered Index Scan on the Orders table (2 million rows) with a predicate on CustomerID. Write a valid T-SQL CREATE INDEX statement that would convert the scan to a seek and also cover the columns OrderDate and TotalAmount that the SELECT clause references.
  1. Identify the key column for the seek: CustomerID (the filter column).
  2. Identify covering columns needed by SELECT: OrderDate, TotalAmount.
  3. Choose a descriptive index name: IX_Orders_CustomerID_Inc_OrderDate_TotalAmount.
  4. Use INCLUDE for the non-key covering columns to avoid widening the key.
  5. Add WITH (ONLINE = ON) to minimize blocking on a live table.
  6. Final statement: CREATE NONCLUSTERED INDEX IX_Orders_CustomerID_Inc_OrderDate_TotalAmount ON dbo.Orders (CustomerID) INCLUDE (OrderDate, TotalAmount) WITH (ONLINE = ON);
Answer: CREATE NONCLUSTERED INDEX IX_Orders_CustomerID_Inc_OrderDate_TotalAmount ON dbo.Orders (CustomerID) INCLUDE (OrderDate, TotalAmount) WITH (ONLINE = ON);

The math in this lesson1

Learners compute monthly compute and storage costs and resize storage with 25% headroom.
7.RP.3
Brush up in the math halls at newSchoolWorks.com:
In class: Guided practice: use Amazon CloudWatch metrics (CPU utilization, FreeStorageSpace, DatabaseConnections) for a running RDS instance; create a CloudWatch alarm that sends an email when CPU exceeds a defined threshold for five consecutive minutes; document each step. · Practice: use Azure Monitor and the Query Performance Insight blade for Azure SQL Database to identify the top three queries by CPU consumption; for each query, record the execution plan, identify the missing or unused index, and write the CREATE INDEX statement. · Cost-optimization worksheet: given a Cloud provider cost report (simulated spreadsheet provided by instructor), students identify over-provisioned instances, calculate potential savings from moving to a lower compute tier or reserved pricing, and present a one-page written recommendation with numeric justification using the platform pricing calculator.
Materials: AWS CloudWatch console; Azure Monitor and Query Performance Insight; simulated cost report spreadsheet (instructor-provided); AWS and Azure pricing calculators (publicly available); Microsoft DP-300 study guide (monitoring and optimization chapters)
Check: CloudWatch alarm demonstrated as active with correct threshold; at least two valid CREATE INDEX statements confirmed by instructor review; cost worksheet shows correct arithmetic and a recommendation with numeric savings estimate; pass requires all three elements present and correct.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Monitoring and Alerting (Microsoft DP-300)
1. In Amazon CloudWatch, you set an alarm on CPU Utilization with the condition greater than 80%, Evaluation Periods = 5, and Datapoints to Alarm = 5. The metric reports 82%, 84%, 79%, 83%, and 81% across five consecutive 1-minute periods. What happens?
Cloud Database Monitoring (PostgreSQL CE / Oracle DBA CA)
2. Which CloudWatch metric would you monitor to receive an early warning before an RDS instance runs out of disk space?
Query Optimization (Microsoft DP-300)
3. Query Performance Insight in Azure SQL Database is primarily used to:
Index Tuning (Microsoft DP-300 / Oracle DBA CA)
4. An execution plan shows a Key Lookup operator after a nonclustered index seek on an Orders table. The SELECT clause references OrderDate and ShipCity in addition to the indexed column. The BEST fix is to:
Cost Optimization (DAMA CDMP / Microsoft DP-300)
5. During a rightsizing analysis you find an RDS instance averaging 22% CPU and 18% memory utilization over 30 days. The MOST appropriate immediate recommendation is to:
Cost Management (DAMA CDMP)
6. A workload has been stable for 18 months and is forecast to remain consistent for two more years. Compared to on-demand pricing, the BEST billing model to reduce cost is:
Monitoring and Alerting (Microsoft DP-300 / PostgreSQL CE)
7. When creating a CloudWatch alarm for an RDS instance, you attach it to an SNS topic. The SNS topic's role in the alarm workflow is to:
Change Management and Safety (Oracle DBA CA / DAMA CDMP)
8. Before reducing the storage tier of a production Azure SQL Database during a maintenance window, the MOST important safety step is to:
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.