Domain 4 β Troubleshooting & Optimization
Learn to monitor, debug, trace, and optimize AWS applications. This domain covers observability tools, root cause analysis, and performance tuning across all AWS services.
π 18-22% of Exam Weight | 19 Key Topics | 50 Practice QuestionsWhat Does Domain 4 Actually Test?
Domain 4 is all about answering the question: "Something is wrong β how do you find it and fix it?" It also covers: "Everything is working β how do you make it faster and cheaper?"
The exam will give you scenarios like:
- Your API is returning errors β which tools do you use to find why?
- Your Lambda function is slow β what do you check and what do you change?
- A user says the app is down β but AWS Console shows everything is green. How do you investigate?
- Your RDS database is overloaded with read queries β what is the fix?
- Someone deleted an S3 bucket at 3am β how do you find out who did it?
The 3 Pillars of Observability β Core Framework
Before diving into individual services, understand this core concept. Every monitoring/troubleshooting question in the exam fits into one of these three pillars:
π Metrics
Numbers that change over time. Examples: CPU usage (80%), requests per second (1000 RPS), error rate (2%), latency (200ms).
AWS Tool: CloudWatch Metrics
Use for: Spotting trends, setting alarms, capacity planning.
π Logs
Text records of what happened. Examples: "ERROR: DB connection failed", "User login successful", "Request processed in 450ms".
AWS Tool: CloudWatch Logs
Use for: Debugging specific errors, understanding context, auditing.
π Traces
The journey of one request through multiple services. Example: One API call going through API Gateway β Lambda β DynamoDB β SES.
AWS Tool: AWS X-Ray
Use for: Finding bottlenecks in distributed systems, latency analysis.
All 19 Topics at a Glance
Click any topic to go to its detailed notes page. Importance ratings reflect how often the topic appears in exam questions:
Key Exam Patterns β What Questions Look Like
The exam does not ask you to memorize APIs. It gives you real-world scenarios and asks which service or approach to use. Here are the most common patterns:
Pattern 1 β "Log all AWS API calls"
Pattern 2 β "Find a bottleneck in microservices"
Pattern 3 β "Monitor application metrics and alert"
Pattern 4 β "Application is slow β Lambda cold starts"
Pattern 5 β "On-premises server logs to CloudWatch"
Pattern 6 β "S3 throttling β too many requests"
Quick Reference β Right Tool for the Job
| Problem/Need | Right Tool | Why |
|---|---|---|
| Track API calls / find who deleted resource | AWS CloudTrail | Logs every AWS API call with actor & timestamp |
| Monitor CPU, memory, request count | CloudWatch Metrics | Numerical time-series data |
| Search application error messages | CloudWatch Logs / Logs Insights | Store and query log text |
| Find which microservice is causing latency | AWS X-Ray | Distributed tracing + service maps |
| Get alerted when error rate > 5% | CloudWatch Alarm + SNS | Threshold-based alerting |
| Test API endpoint every 5 minutes | CloudWatch Synthetics | Scheduled canary scripts |
| Profile which code line uses most CPU | Amazon CodeGuru Profiler | Runtime performance profiling |
| Eliminate Lambda cold starts | Provisioned Concurrency | Pre-warms Lambda environments |
| Find optimal Lambda memory setting | Lambda Power Tuning | Tests multiple memory configs |
| Cache database reads | ElastiCache (Redis/Memcached) | In-memory caching layer |
| Reduce S3 load / serve globally fast | CloudFront | Edge caching CDN |
| Query 1TB of logs in S3 with SQL | Amazon Athena | Serverless SQL on S3 |
| Search and visualize logs | Amazon OpenSearch | Full-text search + Kibana dashboards |
| Real-time streaming data ingestion | Amazon Kinesis | High-throughput real-time streams |
| Collect logs from on-prem servers | Unified CloudWatch Agent + IAM User | Agent + credentials for non-AWS servers |
| React to DynamoDB table changes | DynamoDB Streams + Lambda | Event-driven change processing |
| Right-size EC2 / Lambda resources | AWS Compute Optimizer | ML-powered recommendations |
| Route messages to specific SQS queues | SNS Subscription Filter Policies | Filter by message attributes |
| Troubleshoot network connectivity | VPC Flow Logs | IP traffic accept/reject records |
How to Use These Notes
Start with the βββββ topics
CloudWatch and X-Ray together make up the biggest chunk of Domain 4. Cover these first. They also appear in other domains.
Learn the flow diagrams
Each topic has flow diagrams showing how data moves. Understanding these flows helps you answer scenario questions without memorizing every detail.
Pay attention to Exam Tip callouts
Orange callout boxes (π― Exam Tip) highlight things the exam specifically tests. These are the "gotcha" moments that separate pass from fail.
Do the 50-question practice quiz last
After reading all topics, take the quiz. The quiz covers all 19 topics with scenario-based questions β the same style as the real exam.